I was bored and decided to fix gdbinit to support 64 bit binaries. I had tried it before but the solution was a piece of crap (not that this one is much better). I was testing the registers to see if the binary was 32 or 64 bit. Now there is a default setting to 32 bit (change it if you want to default to 64 bit) and two commands, 32bits and 64bits to change between the two types of targets. If you have 32 bit by default and debug a 64 bit target, the first time GDB breaks you will get an error; just issue the 64bits command to change and you can issue the context command to get the correct display and continue your debug session. I remember I couldn’t find a better way to detect the type of binary inside gdbinit, since there’s no support for regex and all that kind of tools. If you have an elegant method feel free to tell me about or patch this version and send it back.

I have patched too the 64 bit mode to have available the 32 and 16 bit registers versions. The Objective-C messages display and the stepo command still need to be fixed to 64 bit. The calls are different in 64 bit so I need to rework that part. Everything else seems to be working. Please report if not.

Can’t remember anything else to say about this one.

As usual, have fun!
fG!

Grab it here:
gdbinit73
(SHA1(gdbinit73)= c4da85f3ba6e8cfa311fb63c2ab5d606df6b837c)

The latest version can always be found here.