This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Stabs debug info (buggy) in g++ 2.95.2


Hi,

I am using g++ 2.95.2 compiler for RedHat 6.2 Linux on X86. I have compiled 
Bubble.cpp with "-gstabs":

// this is Bubble.cpp
template <class X> void bubble_sort(X *items, int size);

void main(void)
{
int iarray[7] = {7, 5, 4, 3, 9, 8, 6};
bubble_sort(iarray, 7);
}
template <class X> void bubble_sort(X *items, int size)
{
register int i, j;
X temp;
for (i = 1; i < size; i++)
for (j = size-1; j >= i; j--)
if (items[j-1] > items[j])
{
temp = items[j-1];
items[j-1] = items[j];
items[j] = temp;
}
}
// end of Bubble.cpp

After dumped the .stab section in a.out, it tells me that:

n_type 	n_value
==========================
N_SO 	0x080483b0
... 		...
N_FUN 	0x080483b0
... 		...
N_FUN 	0x08048430
... 		...
N_SO 	0x080483e9

Why the 2nd N_SO's n_value is LESS THAN 2nd N_FUN's n_value? This
causes some problems in debuggers. It should be GREAT THAN.

Is this a bug?

Thanks.

Thomas Peng
tpeng@metrowerks.com





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