64 bit code debugging using gdb and ddd

Hello
I have built our application on AIX 7.1 as a 64 bit application.

My queries are as follows:

  1. Can a 32bit gdb (v7.6) and ddd (data display debugger - v3.3.12), debug a 64bit executable ?
    [list=1]
  2. If I have a small 64bit a.exe executable that seems to work.
  3. If I have a more complicated executable involving several shared libs and objects (all 64bit), then gdb seems to work (as in I can step through code) but ddd seems to die with "During startup program terminated with SIGKILL, Killed".

    Note that the same executable as a 32bit one works fine with both gdb & ddd.
    [/list]
  4. So I tried building gdb and ddd as 64 bit applications. Started with gdb...but finding there are too many errors being reported that the 'make' is not getting through to the end. Most of the errors are to do with 'assigning a 8 byte pointer to a 4 byte variable' etc. Has anyone tried building gdb (and ddd - haven't tried this yet) on AIX as a 64bit application ?

Any help / comments gratefully received.

Regards

For small applications the same would work to an extent but when it requires to examine a piece of memory located at addresses under truly 64-bit address space (say, >32-bit addressable value) then the issues would start creeping in; as the 32-bit GDB would have variable size of 32-bit and the value of the 64-bit address would be rounded-off when assigned to the variable making altogether a different address at all. Would crash.

It'll print variables and you can step through the code as the same is treated as char * .

1 Like

Thanks for the quick reply Pravin_218.
So I guess I'll have to rebuild both gdb & ddd in 64 bit mode.
Finding it hard to build gdb in 64bit as the code does not seem to be geared towards a 64bit build. Getting errors such as:

aix5ppc-core.c: In function 'xcoff64_core_p':
aix5ppc-core.c:194:13: error: assignment makes integer from pointer without a cast [-Werror]
sec->vma = ldinfo.ldinfo_dataorg;

If anyone has any idea on what to do about such errors please help.

How about scaling down you application to 32-bit...

Scaling down to 32-bit is not an option as application is currently running as 32-bit and we wanted to make it a 64-bit application.

In any case I just ignored gdb and built ddd in 64bit and this is able use the 32-bit gdb and work fine to debug 64-bit application.

I'm able to malloc, examine pointers etc. and all show 64-bit addressing correctly. So I guess it is not a problem.