DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
sdb: symbolic debugger

Printing a stack trace

It is often useful to obtain a listing of the function calls that led to the error. This is obtained with the t command. For example,

   *t
   sub(x=2,y=3)       [prgm.c:25]
   inter(i=16012)     [prgm.c:96]
   main(argc=1,argv=0x7fffff54,envp=0x7fffff5c)[prgm.c:15]
This indicates that the program was stopped within the function sub at line 25 in file prgm.c. The sub function was called with the arguments x=2 and y=3 from inter at line 96. The inter function was called from main at line 15. The main function is always called by a startup routine with three arguments often referred to as argc, argv, and envp.


NOTE: argv and envp are pointers, so their values are printed in hexadecimal.


Next topic: Examining variables
Previous topic: Using sdb

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003