jkmcnk / sx-gcc

The GNU Compiler Collection port to NEC SX CPU architecture.
GNU General Public License v2.0
0 stars 2 forks source link

a debugging information issue when compiling c++ programs #120

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When trying to debug the sample code below, using DBX:

{{{
#include <algorithm>
#include <stdio.h>

int main(int argc, char *argv[])
{
    for (int i=0; i<10; i++) {
        printf("alg. i=%d\n", std::min<int>(i,5));
    }
    return 0;
}
}}}

the DBX crashes with the following error:

reading symbolic information ...warning: symbol entry unrecognized: name
_ZSt3minIiERKT_S2_S2_,entryindex 0x376, sclass 0x7f, ntype 0x00000604,
value 0x0000000400000898'
Bus error (core dumped)

The problematic function is "std::min<int>". If I remove it from the code,
the DBX doesn't crash anymore.

Also, the crash occurs only if I include the debugging information into the
executable (i.e. if I use the "sx8-nec-superux-g++ -g ..." command). If I
don't use the "-g" switch with "sx8-nec-superux-g++", the DBX works fine.

Original issue reported on code.google.com by nou...@gmail.com on 9 Apr 2009 at 9:17

GoogleCodeExporter commented 8 years ago

Original comment by jmoc...@gmail.com on 24 Apr 2009 at 6:19

GoogleCodeExporter commented 8 years ago
As it turns out, this issue had its roots in linker not being able to handle the
".bss.*" and ".rodata.*" sections properly (see issue #122). Now, that that 
problem
was fixed, the debugging works fine for c++ programs too.

Original comment by nou...@gmail.com on 21 May 2009 at 10:22

GoogleCodeExporter commented 8 years ago
Ooops, it looks like i was executing the wrong test case... :(

The problem still persists.

Original comment by nou...@gmail.com on 21 May 2009 at 3:42

GoogleCodeExporter commented 8 years ago
disable debugging for C++ and remove all related hacks for release: SDB 
debugging
format just can't cope.

Original comment by jmoc...@gmail.com on 9 Oct 2009 at 9:30