Issues with C++ and -xdebugformat=dwarf

Hi,

I tried to compile C++ code with -xdebugformat=dwarf and ran into some issues:

- a few compilations aborted with the following message:

>> Assertion: DBGGEN ERROR: FILE="../src/dbg_dwarf2.c", LINE=%6630,

dwarf_transform_to_disk_form() returned DW_DLV_NOCOUNT [DBG_GEN 5.0.8]

(../lnk/dbg_dbggen.cc, line 4306

- I worked around this by using stabs debug format for these files. But in the end, linking failed with the following message:

ld: fatal: relocation error: file: ... section: .rela.debug_info symbol: : relocation against a discarded symbol,

symbol is part of discarded section: .text%...

The symbol in question is a inline member function which is used in several files.

Any idea how to proceed?

Regards

Dieter Ruppert

[816 byte] By [dieter_ruppert] at [2007-11-26 10:19:25]
# 1

You dont' say what compiler version you are using.

DWARF format is not supported for C++ in Sun Studio 11.

In Studio Express, it is a work-in-progress, known to be buggy. The next update of Sun Studio Express will fix many problems with DWARF in C++. The release is tentatively scheduled for mid-November. Try out that release when it is available, and let us know whether it fixes your problems.

clamage45 at 2007-7-7 2:16:54 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Well, I am probably overstating the case for the current version of Sun Studio Express (SSX2). DWARF is the default for C++, and mostly works. All known problems are already fixed in our development version, and the fixes will be in the next SSX update.

If you have problems with DWARF in the current SSX, please post a test case here or at bugs.sun.com. If it's a problem not already fixed, we'll fix it.

clamage45 at 2007-7-7 2:16:54 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
Thanks for the clarification. I misunderstood the current version of Sun Studio Express as having only Linux-related enhancements.Anyway, I tried with the SSX2 version, and everything seems to work. Thanks again.
DieterRuppert at 2007-7-7 2:16:54 > top of Java-index,Development Tools,Solaris and Linux Development Tools...