4 ms·
>Sure, seeing source is fine, but what if you want >disassembly too? Mixed source/assembly? Register view? >Watches? Switching between threads easily? Viewing m
by clhodapp 14y ago
>Sure, seeing source is fine, but what if you want >disassembly too? Mixed source/assembly? Register view? >Watches? Switching between threads easily? Viewing memory?
Disassembly: (gdb) layout asm
Mixed source/assembly: (gdb) layout split
Register view: (gdb) layout regs
Watches: There is no window, which is too bad. You can say "display foo" and it will print the value of foo each time the execution breaks. You can also say just "display" and it will print the values of all variables you currently have set to display.
Switching between threads: Say "info threads" to show all the threads in your application. Say "thread x" to switch to thread number x.
Viewing memory: Again, there is no window, which is too bad. You can, however, use the "x" command, which is pretty full-featured and allows you to print the contents of a given-size chunk of memory, starting at a given point to the console in pretty much any format you might desire.
You may already be aware of these features, but be discounting for some reason?
Edit:
Turns out, GDB also supports writing memory regions to disk:
(gdb) dump binary memory <outfile> <startlocation> <stoplocation>