Settings

Theme

Writing a Linux Debugger (2017)

blog.tartanllama.xyz

108 points by lrsjng 3 years ago · 13 comments

Reader

PhilipRoman 3 years ago

Nice, I really like that it describes the DWARF format instead of just handwaving around it. I've been considering adding DWARF support to my compiler so that I can use mainstream debuggers with it and this article has just destroyed my last excuse to procrastinate.

I must admit, the title got me very excited (it's still a cool article regardless) - something I've always wanted is a system-wide debugger for Linux. Something that can put breakpoints in arbitrary executables or shell scripts (via custom /bin/sh wrapper?) system wide, not just within a debugging session. I'd love to be able to put conditional breakpoints on, say, any process that opens a named pipe matching some regex. I find that when dealing with complex systems involving systemd services, cron jobs, udev and 30 different daemons running in background, gdb and strace simply aren't enough.

  • jjnoakes 3 years ago

    SystemTap or ebpf might be the way to go for visibility at that level. Not quite a debugger, but they can be very helpful.

    • PhilipRoman 3 years ago

      I had heard of SystemTap, but had no idea it was that powerful. In particular, the user space marker feature sounds like what I need. Although it sounds like it may require manual instrumentation.

  • schemescape 3 years ago

    Not sure about Linux specifically, but it sounds like you’re looking for a kernel debugger that can communicate with a user mode debugger (or debuggers).

    Edit: actually SystemTap mentioned in a sibling comment sounds simpler if you just need instrumentation.

Veserv 3 years ago

As someone who does debugger development as part of their day job, I can attest that this is a very good introduction to the details of basic debugger operation and implementation. If you are unfamiliar with the topic, I recommend you give it a try as it immediately starts giving useful nuggets of knowledge that are applicable in other circumstances if you are ever interested in doing low level or embedded development.

hoten 3 years ago

Appreciated the How is Babby Formed reference in chapter two:)

setheron 3 years ago

How does one debug the Linux kernel ? I want to step through some portions.

Even with UML it sounds arduous

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection