Gdb init v7.4

Hello,

Just posting a small update to gdbinit. A friend asked for colouring the registers changes as it happens in Ollydbg. I have enabled it by default (modify variableย  SHOWREGCHANGES if you don’t like it).
I have also added a colour patch that Phillipe sent me – it will colour the 1st line of the disassembly (by default it’s off, modify variable SETCOLOUR1STLINE).

Here it is a screenshot of both options enabled:

Gdbinit 7.4 screenshot

I will create a github project so everyone can contribute if they wish so. This post will be updated with the required info.

Now, back to my PowerPoint ๐Ÿ™‚

Have fun,
fG!

gdbinit74.gz
SHA256(gdbinit74.gz)= b8caeea8848690635f756183c72a7004e82365d3b8c48235bd99926f2ab0f895

Update:

Just added version 7.4.1, which adds a small patch sent by Sofian to search for byte patterns. I forgot to add this one when I received it, more than 1 year ago. Lazy me ๐Ÿ™

gdbinit741.gz
SHA256(gdbinit741.gz)= b981bf99f05380544d403bd26df8aee2023ef49c81605d28c82177bf6684585a

The latest version can always be found here.

9 thoughts on “Gdb init v7.4

  1. hmm, which version of gdb are you running? I’m getting errors with the stock OS X gdb. for example:

    GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)

    gdb$ file mybinary
    Reading symbols for shared libraries .. done
    gdb$ main
    Breakpoint 1 at 0x100000db5
    Reading symbols for shared libraries +. done

    Breakpoint 1, 0x0000000100000db5 in main ()
    Error while running hook_stop:
    Invalid type combination in ordering comparison.
    gdb$ ni
    0x0000000100000db7 in main ()
    Error while running hook_stop:
    Invalid type combination in ordering comparison.

    (it’s a x86_64 binary and I changed the line in .gdbinit to enable 64bits … also tried this with “64bits” in gdb)

  2. Hi,

    I have Snow Leopard and Xcode 4.1 and using the .gdbinit 7.4.1 gives an “Invalid type combination in equality test” error, although I am using the exec-file work around…

    $ gdb
    […]
    gdb$ exec-file /bin/ls
    Reading symbols for shared libraries … done
    gdb$ break *0x0000000100001478
    Breakpoint 1 at 0x100001478
    gdb$ run
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries …. done

    Breakpoint 1, 0x0000000100001478 in ?? ()
    ————————————————————————–[regs]
    Error while running hook_stop:
    Invalid type combination in equality test.
    gdb$

    1. Hello,

      You are probably trying to debug with the 32bit settings. Use the command 64bits when debugging 64bits targets or modify the variable at the top to default to 64bits binaries.

      fG!

Leave a Reply

Your email address will not be published. Required fields are marked *