Thursday May 03, 2007

dbx .ldynsym support - stack traces for stripped programs
Stack traces for stripped programs should get easier to read on Solaris. Solaris Nevada added a new strip-proof symbol table that inherits part of the symbols that normally get stripped out by the strip command. Basically static functions. Static functions have always been the number one cause of unreadable stack traces in stripped programs, but not the Solaris utilities (dtrace, mdb, pstack, etc) and also dbx (in Sun Studio 12 FCS) will be able to make use of these new symbols. The new Solaris feature is described here.
Before:
% cc t.c && strip a.out && ./a.out ; dbx -c 'where;quit' - core
"t.c", line 2: warning: implicit function declaration: abort
Abort (core dumped)
Corefile specified executable: "/home/quenelle/a.out"
Reading a.out
core file header read successfully
Reading ld.so.1
Reading libc.so.1
program terminated by signal ABRT (Abort)
0xbff80717: __lwp_kill+0x0007: jae __lwp_kill+0x15 [ 0xbff80725, .+0xe ]
=>[1] __lwp_kill(0x1, 0x6), at 0xbff80717
[2] _thr_kill(0x1, 0x6), at 0xbff7ded4
[3] raise(0x6), at 0xbff2ced3
[4] abort(0x8047408, 0x80506db, 0x8047514, 0x8047428, 0x805062d, 0x1), at 0xbff10969
[5] 0x80506c8(0x8047514, 0x8047428, 0x805062d, 0x1, 0x8047434, 0x804743c), at 0x80506c8
[6] main(0x1, 0x8047434, 0x804743c, 0x80505cf), at 0x80506db
After:
% cc t.c && strip a.out && ./a.out ; dbx -c 'where;quit' - core
"t.c", line 2: warning: implicit function declaration: abort
Abort (core dumped)
Corefile specified executable: "/home/quenelle/./a.out"
Reading a.out
core file header read successfully
Reading ld.so.1
Reading libc.so.1
program terminated by signal ABRT (Abort)
0xff344a24: __lwp_kill+0x0008: bcc,a,pt %icc,__lwp_kill+0x18 ! 0xff344a34
=>[1] __lwp_kill(0x0, 0xffffffff, 0x0, 0x0, 0xfffffffc, 0x0), at 0xff344a24
[2] raise(0x6, 0x0, 0x5, 0x6, 0xffffffff, 0x6), at 0xff2f7504
[3] abort(0xff386a80, 0x1, 0x6, 0xff3836c0, 0xacf34, 0x0), at 0xff2d3824
[4] baz(0x0, 0x1000, 0xff385ac0, 0xff3a2000, 0x0, 0x4), at 0x10e6c
[5] main(0x1, 0xffbff3e4, 0xffbff3ec, 0x21000, 0xac71c, 0xff3a0140), at 0x10e9c
Posted by Chris Quenelle
( May 03 2007, 05:49:06 PM PDT )
-
Permalink
-
-
Dbx
Older blog entries: