Gdb on a 64 bit executable - cannot access memory


 
Thread Tools Search this Thread
Operating Systems AIX Gdb on a 64 bit executable - cannot access memory
# 1  
Old 09-08-2014
Gdb on a 64 bit executable - cannot access memory

Hi,
Can anyone explain this please.....

A simple test program...

### snip
Code:
#include <stdio.h>

main() {
static int n;

n = 6;

printf("hello %d\n", n);
n=7;
}

### snip

64 bit compile/link....


Code:
$ export OBJECT_MODE=64
$ cc -g -o hello hello.c
$ gdb ./hello
(gdb) b 8
Breakpoint 1 at 0x1000004a4: file hello.c, line 8.
(gdb) r
Starting program: /src/kiwi_7.94_01oct2014/hello 

Breakpoint 1, main () at hello.c:8
8       printf("hello %d\n", n);
(gdb) p n
Cannot access memory at address 0x10000708
(gdb)

If you take off the "static" on line 4, it works fine. Smilie

Also it works fine in 32 bit mode.
Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, output, and code segments.

Last edited by Don Cragun; 09-08-2014 at 04:42 PM.. Reason: Add CODE tags.
# 2  
Old 09-25-2014
Looks like a bug.
# 3  
Old 09-25-2014
It works fine with my 64-bit gcc and gdb, which are:

Code:
$ gcc --version
gcc (Gentoo 4.7.3-r1 p1.4, pie-0.5.5) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gdb --version
GNU gdb (Gentoo 7.6.2 p1) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>.

$

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

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: Can a 32bit gdb (v7.6) and ddd (data display debugger - v3.3.12), debug a 64bit executable ? If I have a small 64bit a.exe executable that seems to work. If I have a more complicated executable... (4 Replies)
Discussion started by: biju64
4 Replies

2. Filesystems, Disks and Memory

Maximum Memory RAM for windows 7 32 bit

Hi, i have just installed 4 gb RAM ddr3 on OS Windows 7 32 bit. In "manage peripherals" i see this section: Memory installed (ram) : 4,00 gb (2,30gb usable) Why only 2,30 gb usable ? In Windows 7 32bit the maximum size is not 3,00gb ? see file attached, please (4 Replies)
Discussion started by: nash83
4 Replies

3. Linux

Memory issue on My CentOS 5.8 x64 bit server

Hello, I am using CentOS 5.8 x64 server for our one of internal application which is developed on PHP and Mysql as DB. Currently there are 8-10 instances deployed on this server some of them are rarely used. Below is the H/W specification fort the same :- Procesor :- Intel(R) Xeon(R) CPU ... (6 Replies)
Discussion started by: sunnysthakur
6 Replies

4. Ubuntu

Not able to access wi-fi from ubuntu 9.04 -AMD 64-bit.

Hi, I am not able to access wi-fi network from my laptop HP-DV6-1111au. Please suggest how can i load a driver for the device and set the network right!! (3 Replies)
Discussion started by: guru_gyan
3 Replies

5. Programming

gdb: problem while debug an executable file

I created one file (test.cpp)and complied it and get the executable file(test) and run it.It is giving the out put but when I am trying to debug that executable.I am getting the error -- please tell me the solutions?? Thanks in advance ..... (2 Replies)
Discussion started by: smartgupta
2 Replies

6. Programming

gdb: how to debug an executable file with a few command line papameters

If an executalbe file has several parameters, gdb can not pass parameters correctly. Let us see: run: ./executablefile1 agr1 arg2 arg3 debug: gdb executablefile1 run executalbefile1 arg1 arg2 arg3 then argv : executablefile1 argv : executablefile argv : arg1 ... (3 Replies)
Discussion started by: cdbug
3 Replies

7. Programming

Access process memory from kernel space

Hi, I'm currently working on a project to help the analysis of malware from inside the kernel to avoid any kind of detection. So I need to be able to read the process memory from my kernel module. As of now, I'm stuck at converting a virtual memory address (for example 0x080483e8 found... (3 Replies)
Discussion started by: anonymoose
3 Replies

8. Programming

Cannot access memory at address 0x8

Hi All I have a structure pointer and setting that pointer as NULL. When i tried to access the elements in the structure i am getting the error message. "Cannot access memory at address 0x8". This i tried in LINUX. When the same program is tried thro UNIX (HP-UX), i am not getting the message... (8 Replies)
Discussion started by: rkraj
8 Replies

9. UNIX for Dummies Questions & Answers

0403-015 - Cannot access a required executable file. It is in use.

How is this error resolved please? I'm just trying to run a shell script and am getting this error. All file permissions are fine. Thanks (0 Replies)
Discussion started by: miwinter
0 Replies

10. Programming

Creting 64-bit executable

Hi I am using solaris 8 and I need to create 64-bit executable 'lsof'. what is the cc equivalent option? and how to check whether my compiler supports 64-bit executables or not? Thanks in advance (1 Reply)
Discussion started by: axes
1 Replies
Login or Register to Ask a Question