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
  • 182,696
  • 29
  • 267
  • 329

2 Answers2

12

They seem to be using this .gdbinit file:

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

Sergei Danielian
  • 4,731
  • 4
  • 33
  • 57
Jan Larres
  • 885
  • 7
  • 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
  • 23,949
  • 5
  • 42
  • 119
matt
  • 5,139
  • 1
  • 24
  • 24