Some context: I tried writing a Linux debugger a while back as a learning project and to improve my programming skills. I was able to write code that allowed basic assembly level debugging functions like setting breakpoints, reading and writing register values, stepping over instructions. I decided that I should move to implementing source level debugging features which meant I would have to parse DWARF and ELF files. I wanted to make this project without using any libraries and so I started reading the DWARF and ELF specification. I was quickly overwhelmed by DWARF spec and after days of trying to understand it I abandoned the project.
I am thinking of giving it another shot and would like some advice on how to proceed with the project.
- If I decide to still try to write this project from scratch, how should I make my way through the DWARF spec? Should I read and understand the entire spec first or read only those parts that are required to implement the feature I am working on at any given time? Any advise on parsing huge spec like DWARF would be helpful.
- I would like to get some DWARF library suggestions if I decide to use libraries. Libdwarf(https://www.prevanders.net/dwarf.html) seems to be a good choice but would like to know if there is a better library.
- Lastly any advice/resources for writing a Linux debugger(or any debugger in general) would also be really helpful.
Thanks
- Karan