5 ms·
I wish GDB was a bit more like Acid, in that the debugger was really just a scripting language* that let you do things like set breakpoints at an address, read
by ori_b 10y ago
I wish GDB was a bit more like Acid, in that the debugger was really just a scripting language* that let you do things like set breakpoints at an address, read the symbol table and parse DWARF debug info, set watchpoints, and not much else.
Basically everything else that you would use at the source level could be built on top of those.
Maybe this is the start of a new underwear project: A debugger in [part of] the spirit of Acid, but built on top of the lldb library.
- pekk 10y agoDo we really need yet another special ad hoc scripting language?
- abiox 10y agodoes it matter how many there are?
- current_call 10y agoOnly if your time is valuable.
- abiox 10y agowhat's the correlation?
- dman 10y agoFor reference => http://plan9.bell-labs.com/sys/doc/acidpaper.html http://plan9.bell-labs.com/sys/doc/acidpaper.html
- Manishearth 10y agoI believe this is true already? Rust used to pretend to be C, and got breakpoints/debuginfo for free. Python scripts could help with pretty printing. I'm not sure of subexpression evaluation is something a gdb Python script can do, but I see no technical barrier to this. Having it in gdb itself means less work for people who want to use it. Rust ships with gdb/lldb pretty printers, but not everyone knows about them.
- davexunit 10y agoGDB can be extended using Guile Scheme. I am pretty ignorant when it comes to GDB, but I've seen people write Scheme extensions to help with V8 development and inspect certain C++ data structures more easily.
- ori_b 10y agoI've looked at the Python API, and it's not exactly good. I can look at the Scheme API, but after seeing the Python attempt, I'm not optimistic. ...I put in the star to say that the Python API didn't count, but forgot to actually elaborate on it.
- sanxiyn 10y agoWhat is missing in Python API? You can set breakpoints/watchpoints with gdb.Breakpoint.
- _yosefk 10y agoI use gdb's Python API all the time, and I'm really happy that they have it. It's good for custom pretty-printing (well, almost - I wish p vec[6] worked well and not just print vec if vec has a pretty printer defined for its type) and it's good for commands needing to access a bunch of state and print a custom summary/run external commands based on that (for instance, view an image object graphically.) So when you say it's not good I guess you want to do other things (which?) - or else you mean that it's messy (if so I ought to say that I've seen much worse and in relative terms I'd say gdb's API is rather lovely.)