Created
August 17, 2012 15:24
-
-
Save clsn/3379853 to your computer and use it in GitHub Desktop.
gdb mystery...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mark@dev ~]$ cat A.c | |
#include <string.h> | |
int | |
main() { | |
} | |
[mark@dev ~]$ cc -g -c -o A32.o A.c | |
[mark@dev ~]$ cc -g -c -o A64.o +DD64 A.c | |
[mark@dev ~]$ cc -g -o A32 A32.o | |
[mark@dev ~]$ cc -g -o A64 +DD64 A64.o | |
[mark@dev ~]$ gdb ./A32 | |
HP gdb 6.1 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3. | |
Copyright 1986 - 2009 Free Software Foundation, Inc. | |
Hewlett-Packard Wildebeest 6.1 (based on GDB) is covered by the | |
GNU General Public License. Type "show copying" to see the conditions to | |
change it and/or distribute copies. Type "show warranty" for warranty/support. | |
.. | |
(gdb) stop in main | |
Breakpoint 1 at 0x40007e0:0: file A.c, line 4 from /home/mark/./A32. | |
(gdb) run | |
Starting program: /home/mark/./A32 | |
Breakpoint 1, main () at A.c:4 | |
4 } | |
(gdb) p memcmp("A","A",1) | |
$1 = 0 | |
(gdb) c | |
Continuing. | |
Program exited normally. | |
(gdb) exit | |
[mark@dev ~]$ gdb ./A64 | |
HP gdb 6.1 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3. | |
Copyright 1986 - 2009 Free Software Foundation, Inc. | |
Hewlett-Packard Wildebeest 6.1 (based on GDB) is covered by the | |
GNU General Public License. Type "show copying" to see the conditions to | |
change it and/or distribute copies. Type "show warranty" for warranty/support. | |
.. | |
(gdb) stop in main | |
Breakpoint 1 at 0x4000000000000ae0:0: file A.c, line 4 from /home/mark/./A64. | |
(gdb) run | |
Starting program: /home/mark/./A64 | |
Breakpoint 1, main () at A.c:4 | |
4 } | |
(gdb) p memcmp("A","A",1) | |
$1 = 1 | |
(gdb) c | |
Continuing. | |
Program exited normally. | |
(gdb) exit | |
[mark@dev ~]$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment