[systemd-devel] Systemd Debugging with GDB

Lennart Poettering lennart at poettering.net
Thu Sep 13 05:25:58 PDT 2012


On Thu, 13.09.12 13:52, eleven (elevenyang at linpus.com) wrote:

> Dear All
> 
> I am so interested in Systemd Design and it is so attractive to me! So I
> want to join with you.
> 
> But I have a problem bothered me for a while.
> 
> Is there any way to debug Systemd's source codes with gdb ?

You can attach to PID 1 with gdb:

gdb /usr/lib/systemd/systemd 1

And that's already it. Also, in many cases it's possible to gdb through
it in user mode. For that simply run "gdb /usr/lib/systemd/systemd" and
run this as unprivileged user. Of course, some things don't apply to
systemd user mode the same way as to system mode, hence this isn't
always the best option.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list