This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Backtrace limited to caller and callee when debugging on SPARC


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I cross-compiled GDB 7.2 source files for a sparc-elf target and I
noticed some trouble in using the backtrace command for debugging.
Although the backtrace is expected to output the whole call tree, it
only prints the last caller and callee's frames. For instance, I
compiled the following file with a cross-compiled GCC 4.5.1 with no
optimization (-O0) and full debug information (-g3):

typedef struct list {
  int value;
  short suiv;
} list;

int function_test_2 (int c)
{
	int j;

	for (j=0; j < 100; j++)
		c+=c;

	return 0;
}

int function_test (list* liste)
{
  function_test_2 (liste->value);
  return liste->value;
}

int foo (int a, char b)
{
  int i;
  list liste;
   for (i = 0 ; i < a; i++)
     b*=b;
   liste.value = b;
   printf ("Value = %d\n", liste.suiv);

   function_test (&liste);
   return b+a;
}

int main ()
{
  int a = 6, b=7;
  foo (a, b);
  return(0);
};

The object code is executed on a simulated SPARC machine and debug in
remote with sparc-elf-gdb. Then, if I put a breakpoint on
"function_test_2" and display the backtrace at this time, sparc-elf-gdb
outputs:

#0  function_test_2 (c=1) at src/main.c:12
        j = 100
#1  0x4000129c in function_test (liste=0x0) at src/main.c:21
No locals.
... entries for foo() and main() are missing.

I suppose that a bug may compromise the debug frame building. Since
"sparc-elf-gdb" build from GDB 6.4 works fine, I suppose that this bug
has been introduced in recent versions of GDB (7.x)

Thank you guys for the help.

Alex.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNObMiAAoJEIcGK9++iddVUbsH/ikwgtnRvflXkkspIy2O2OH1
rV2ZnqXciDBJLFt/giFYeZC322CNGeS21tjruaGUtdDtH1CHOa9NSAqyzP9prVFp
5o2HB97hUon836nLeyPq9LjaCWq0JrWXk1/ifc2VeKmOujFK12RlJuCJktMJ9C0c
VqmP+jTCRpCTvo1fLACJouXSNgrTP40d0g+T0vl84dnZD/0I7wRaXr5sKUqIlS7p
hl1Bcf4oBTMfxrB5/0aztqv9SjsQDmYuS/6Ppxj4/ckZ61Q4AQfkJJ6qVT1zZG6Y
iccorv/Lp2P3kJIFbJLPAPg5L6Z9StrmAwGKuwOLFQ/G9SIumuyEaWRIZdU79P4=
=GH67
-----END PGP SIGNATURE-----


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