This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug backtrace/14646] New: [x32] backtrace doesn't work before main


http://sourceware.org/bugzilla/show_bug.cgi?id=14646

             Bug #: 14646
           Summary: [x32] backtrace doesn't work before main
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: backtrace
        AssignedTo: unassigned@sourceware.org
        ReportedBy: hjl.tools@gmail.com
    Classification: Unclassified


On Linux/x32 with glibc compiled with GCC 4.7.2, I
got

[hjl@gnu-tools-1 tmp]$ cat x.c
int
main ()
{
  return 0;
}
[hjl@gnu-tools-1 tmp]$ gcc -mx32 -g x.c 
[hjl@gnu-tools-1 tmp]$ gdb a.out 
GNU gdb (GDB) 7.5.50.20120925-cvs
Copyright (C) 2012 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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/a.out...done.
(gdb) b __init_misc
Function "__init_misc" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (__init_misc) pending.
(gdb) r
Starting program: /tmp/a.out 

Breakpoint 1, 0xf7b1cbc0 in __init_misc () from /libx32/libc.so.6
(gdb) bt
#0  0xf7b1cbc0 in __init_misc () from /libx32/libc.so.6
#1  0xf7a45b96 in _init () from /libx32/libc.so.6
#2  0x00000004 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) 

Linux/x86-64 works much better:
[hjl@gnu-tools-1 tmp]$ gcc -g x.c -o 64
[hjl@gnu-tools-1 tmp]$ gdb 64
GNU gdb (GDB) 7.5.50.20120925-cvs
Copyright (C) 2012 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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/64...done.
(gdb) b __init_misc
Function "__init_misc" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (__init_misc) pending.
(gdb) r
Starting program: /tmp/64 

Breakpoint 1, 0x00000035978f1540 in __init_misc () from /lib64/libc.so.6
(gdb) bt
#0  0x00000035978f1540 in __init_misc () from /lib64/libc.so.6
#1  0x0000003597821519 in _init () from /lib64/libc.so.6
#2  0x000000359740f850 in call_init.part.0 () from /lib64/ld-linux-x86-64.so.2
#3  0x000000359740f950 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#4  0x000000359740152a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#5  0x0000000000000001 in ?? ()
#6  0x00007fffffffe386 in ?? ()
#7  0x0000000000000000 in ?? ()
(gdb)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]