[systemd-devel] Tips for using GDB to analyze systemd init process (`/sbin/init`)

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sat Mar 14 05:10:36 PDT 2015


On Sat, Mar 14, 2015 at 09:14:33AM +0100, Paul Menzel wrote:
> Dear systemd folks,
> 
> 
> using Debian Sid/unstable with systemd 215-12, I attached to it with GDB
> to analyze some things. Attached with `gdb --pid 1` worked.
> 
> But continuing the execution and then hitting Ctrl + c to stop and
> analyze it again, systemd caught that command and shut the system down.
> 
> How do you accomplish the goal to analyze systemd with GDB?
I usually set a breakpoint in advance, and then execute actions which
cause the breakpoint to trip. When I make a mistake and want to interrupt,
I kill gdb (with kill from some other terminal), and reattach gdb to systemd.

Zbyszek


More information about the systemd-devel mailing list