16

I've just tried using gdb on BackTrack Linux and I must say that its awesome. I wonder how gdb in backtrack is configured to act this way.

enter image description here

When I set a breakpoint, all the register values, a part of the stack, a part of the data section and the next 10-15 instructions to be executed are printed. The same happens when I step or next through the instructions.

I find this amazing and would love to have this on my Ubuntu machine too; how could I go about doing this?

Employed Russian
  • 199,314
  • 34
  • 295
  • 362

2 Answers2

12

They seem to be using this .gdbinit file:

https://github.com/gdbinit/Gdbinit/blob/master/gdbinit

Sergei Danielian
  • 4,938
  • 4
  • 36
  • 58
Jan Larres
  • 895
  • 8
  • 10
3

I'm guessing that this is done using a post command hook:

http://sourceware.org/gdb/current/onlinedocs/gdb/Hooks.html#Hooks

inside of a system wide gdbinit:

http://sourceware.org/gdb/onlinedocs/gdb/System_002dwide-configuration.html

which may or may not reference shell commands and/or use gdb python scripts. try:

strace gdb /bin/echo 2>&1 | grep gdbinit
Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
matt
  • 5,364
  • 1
  • 25
  • 25