Bug 6922 - objdump fails to read debugging stabs from SUNPro C++ compiler
Summary: objdump fails to read debugging stabs from SUNPro C++ compiler
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-29 20:24 UTC by Andrew Paprocki
Modified: 2008-09-30 12:20 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.9
Target: sparc-sun-solaris2.9
Build: sparc-sun-solaris2.9
Last reconfirmed:


Attachments
Solaris binary exhibiting the problem in the description (3.02 KB, application/octet-stream)
2008-09-29 20:27 UTC, Andrew Paprocki
Details
Patch to add "cbv" intrinsic encoding parsing support. (531 bytes, patch)
2008-09-29 21:40 UTC, Andrew Paprocki
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Paprocki 2008-09-29 20:24:03 UTC
Also noted here:
http://osdir.com/ml/gnu.binutils/2002-08/msg00624.html

If the SUNPro C++ compiler is used with the "-xs -g" (embed debugging symbols in
executable, debugging enabled) options, 'objdump -g' fails to output the
debugging stabs:

$ objdump -g foo.o
foo.o:     file format elf32-sparc

Bad stab: uv4;0;32
Last stabs entries before error:
n_type n_desc n_value  string
198    0      0000000000000000 short:t(0,2)=bs2;0;16
198    0      0000000000000000 int:t(0,3)=bs4;0;32
198    0      0000000000000000 long:t(0,4)=bs4;0;32
198    0      0000000000000000 long long:t(0,5)=bs8;0;64
198    0      0000000000000000 unsigned char:t(0,6)=buc1;0;8
198    0      0000000000000000 unsigned short:t(0,7)=bu2;0;16
198    0      0000000000000000 unsigned:t(0,8)=bu4;0;32
198    0      0000000000000000 unsigned long:t(0,9)=bu4;0;32
198    0      0000000000000000 unsigned long long:t(0,10)=bu8;0;64
198    0      0000000000000000 signed char:t(0,11)=bsc1;0;8
198    0      0000000000000000 wchar_t:t(0,12)=buc4;0;32
198    0      0000000000000000 void:t(0,13)=bs0;0;0
198    0      0000000000000000 float:t(0,14)=R1;4
198    0      0000000000000000 double:t(0,15)=R2;8
198    0      0000000000000000 long double:t(0,16)=R6;16
198    0      0000000000000000 ...:t(0,17)=buv4;0;32
Comment 1 Andrew Paprocki 2008-09-29 20:25:53 UTC
$ cat /tmp/foo.cc
int main(void) {
    return 0;
}
$ CC -xs -g -o /tmp/foo /tmp/foo.cc
$ objdump -g /tmp/foo
<produces the error in the description>
Comment 2 Andrew Paprocki 2008-09-29 20:27:05 UTC
Created attachment 2968 [details]
Solaris binary exhibiting the problem in the description

Run 'objdump -g' on this file to reproduce the problem.
Comment 3 Andrew Paprocki 2008-09-29 21:40:52 UTC
Created attachment 2970 [details]
Patch to add "cbv" intrinsic encoding parsing support.

This information was gleaned from the following OpenSolaris code:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/tools/ctf/cvt/ctf.c#281
Comment 4 Nick Clifton 2008-09-30 12:20:59 UTC
Hi Andrew,

  Thanks for reporting this problem, and for providing a fix as well.

  I have checked your patch in (to the mainline only) along with this changelog
entry.

Cheers
  Nick

binutils/ChangeLog
2008-09-30  Andrew Paprocki  <andrew@ishiboo.com>

	PR 6922
	* stabs.c (parse_stab_sun_builtin_type): Parse, but ignore SUN's
	'b' and 'v' extensions.