Writing a Linux debugger
2017-07-16 12:51:18.032252+00 by Dan Lyke 0 comments
Writing a Linux debugger: Part 1: Setup. A gentle introduction to using ptrace()
and:
Before we jump into things, let’s get our environment set up. I’ll be using two dependencies in this tutorial: Linenoise for handling our command line input, and libelfin for parsing the debug information. You could use the more traditional libdwarf instead of libelfin, but the interface is nowhere near as nice, and libelfin also provides a mostly complete DWARF expression evaluator, which will save you a lot of time if you want to read variables. Make sure that you use the fbreg branch of my fork of libelfin, as it hacks on some extra support for reading variables on x86.