|
How to interpret Stack trace from gdb out put
Hi
I have the following issue
I have some C code which is similar to the following snippet
All the Functions are Declared in K&R-Style
Function_A (args )
{
declarations;
assignments ;
Function_B( args1 );
}
Function_B (args1 )
{
declarations;
assignments ;
.........
.........
}
While debugging the issue with the help of DDD on linux I m facing following issues
Issue 1 :
---------
1. In the stack trace some library calls are getting embedded between the flow from functionA to function_B
I expect the stack trace should look some thing like the follwoing
#34 0x0807a4c1 in function_B
#35 0x0808036f in function_A
#36 0x080501b7 in main (argc=27, argv=0x82906c0)
But I am getting some thing like the below
#14 0x0807a4c1 in function_B
#15 0x00000089 in ?? ()
#16 0x000000cf in ?? ()
#17 0x00000001 in ?? ()
#18 0x09fbc008 in ?? ()
#19 0x09fa26e8 in ?? ()
#20 0x00000001 in ?? ()
#21 0x00000003 in ?? ()
#22 0x00411a78 in __DTOR_END__ () from /lib/tls/libc.so.6
#23 0x00000005 in ?? ()
#24 0x000001d9 in ?? ()
#25 0x000007b1 in ?? ()
#26 0x00000004 in ?? ()
#27 0x000007d6 in ?? ()
#28 0x0000000a in ?? ()
#29 0x0000001a in ?? ()
#30 0x00411a78 in __DTOR_END__ () from /lib/tls/libc.so.6
#31 0xfefe882c in ?? ()
#32 0x00000001 in ?? ()
#33 0xfefe87ec in ?? ()
#33 0xfefe87ef in ?? ()
#34 0x00370859 in __tz_convert () from /lib/tls/libc.so.6
#35 0x0808036f in function_A
#36 0x080501b7 in main (argc=27, argv=0x82906c0)
1.1 Why are these library calls coming into picture even if the
function_B is called directly by Function_A ?
1.2 Is there any way to avoid them ? any repurcations if we
avoid them ?
Issue 2
-------
While running DDD on the program I set a break point at the call to Function_B,in Function_A, at this point if you watch the values of the arguments ,the args are having correct values , on issuing 'Next' the control comes to the declarations section of the Function_B if you watch the arguments at this point the args are having some junk values
Now another 'Next' will take you to the assignments section in Function_B , at this point of time the args are having the correct values .
Why is this transistion in the values in the due course ?
Please let me know if any body faced the similar issues
Anticipating a quick reply
-Regards
Neo
Last edited by NeoMagic; 11-30-2006 at 12:47 AM.
|