64 bit code debugging using gdb and ddd


 
Thread Tools Search this Thread
Top Forums Programming 64 bit code debugging using gdb and ddd
# 1  
Old 03-10-2014
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 ?
    1. If I have a small 64bit a.exe executable that seems to work.
    2. 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.
  2. 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
# 2  
Old 03-10-2014
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 * .

Last edited by Praveen_218; 03-10-2014 at 09:01 AM.. Reason: Typo
This User Gave Thanks to Praveen_218 For This Post:
# 3  
Old 03-10-2014
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.
# 4  
Old 03-10-2014
How about scaling down you application to 32-bit...
# 5  
Old 03-14-2014
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Best guide or video for gdb <register level debugging>

would like to know best guide or document for gdb for different architectures x86 , power pc etc.. would like to understand how to debug segmentation faults because of stack corruption .. understand utilities ELF , objdump etc.. please guide me (1 Reply)
Discussion started by: Gopi Krishna P
1 Replies

2. AIX

Gdb on a 64 bit executable - cannot access memory

Hi, Can anyone explain this please..... A simple test program... ### snip #include <stdio.h> main() { static int n; n = 6; printf("hello %d\n", n); n=7; } ### snip 64 bit compile/link.... (2 Replies)
Discussion started by: bagpussnz
2 Replies

3. Red Hat

Gdb error while debugging core file

Hi, I am trying to analyze one core file on my RHEL 6.5, but I am getting below error related to the core file. So I am not getting any stack trace about the crash. # gdb MyDebugBin /var/core/MyDebugBin.27005 GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1) Copyright (C) 2010 Free... (2 Replies)
Discussion started by: sanzee007
2 Replies

4. UNIX for Dummies Questions & Answers

GDB Debugging Problem

I have added some code in my file. I have created executable rpm file of our code and also I have created debuginfo and debugsource files and installed all three. But when I debug in gdb I see the the code changes in soucre file. But the break point does not hit at that place as if it did not... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

5. UNIX for Dummies Questions & Answers

DDD is waiting for GDB to get Ready

Hello, I'm attempting to use the DDD program. After launching it from the shell I try to set a breakpoint on a source code file and when I click run it hangs and says Waiting until GDB gets ready. I cannot do anything inside the program except quit (and even that takes a while). Can someone tell... (3 Replies)
Discussion started by: lamentofking
3 Replies

6. UNIX for Advanced & Expert Users

DDD and GDB rereads ~/.cshrc

Who know why GDB reads my ~/.cshrc again when I type "run" command? Same happends when run DDD debugger (it runs GDB inside) I need the program to inherit the environment from the current shell. How to disable this behavior? I use GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-32.el5_6.2) (3 Replies)
Discussion started by: baruchgu
3 Replies

7. Programming

ddd/gdb debugger problem

I hope this is the right thread - not sure if it belongs in the Linux forum. Anyway, I'm having an issue with ddd and gdb. When using ddd to run gdb, there are extra parameters being appended, and my program is picking them up. I'm running on Ubuntu 11.04... Here's my command line entry - ... (1 Reply)
Discussion started by: jalburger
1 Replies

8. Programming

Debugging a running process in GDB

Hi , Any gdb user could see my problem. Let me describe what i want to do. i have a test utility to send message to running process. My interest is to go through to functions calls when my test case starts. In a simple way i want have a code walk for a particular scenario of a test... (1 Reply)
Discussion started by: meet123321
1 Replies

9. Programming

Debugging 64bit code with gdb and ddd in AIX

I'm trying to use the GDB debugger and DDD to debug 64bit code. It seems that the AIX toolkit gdb version 6.0 works with 64bit code. But the ddd tool when running gdb gives the following errors : Starting program: <my binary> <my params> warning: "": not in executable format: There is an input... (2 Replies)
Discussion started by: bean66
2 Replies
Login or Register to Ask a Question