If I compile the following example on linux-i386 ABIv1
int x = 3;
printf("x = %d\n", x);
with i386-linux-aros-gcc -Wall -g- local.c -o local
and run it it stops as expected at the break point.
After loading the symbols:
(gdb) findaddr 0xd83d825e
Searching in the loaded modules...
Address found in System:local, in segment 0xd83d8124.
If this is an executable, its .text section starts at 0xd83d8130.
Cannot access memory at address 0x134
(gdb) add-symbol-file local 0xd83d8130.
I tried to print the content of the local variable x:
(gdb) print x
$1 = -667823216
This seams to happen only with local variables which are defined in "main". Global variables, static variables, variables which are defined in a function are working as expected.
Note that only in the debugger the result is wrong. The application itself is working correctly (i.e. it prints "x = 3".
Log in to post a comment.