LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2006, 11:37 AM   #1
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
program execution path debugger? (C++)


anyone knows a debugger which let me trace every function call made?
is gdb able to do this?

i tried ltrace, but i only get "Error: call nesting too deep!"
and strace only traces system calls, but i want function calls too

thx@ll
 
Old 02-23-2006, 03:43 PM   #2
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
gdb can, pretty much. The 'bt' command will show a complete backtrace of the program, up until the segfault (or other signal). It won't, however, actually show you incidental function calls (if I call a function Function1(), and then call another one - Function2(), and a sigfault happens in Function2(), you won't see any record of Function1() anywhere in the backtrace).

Last edited by rose_bud4201; 02-23-2006 at 03:48 PM. Reason: re-read your question and realized my example was crap
 
Old 02-23-2006, 03:47 PM   #3
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Original Poster
Rep: Reputation: 30
bt only works with signals, not?

but i would need a complete program flow

not only on error

cause i have a bug in my app and it begins to be very very complex and it takes very long to identify such problems

any hints on debugging an app with many childs (10 to 100 childs)?
 
Old 02-23-2006, 04:16 PM   #4
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
Oh, UGH. Yeah, gdb with threaded programs is going to be nine kinds of hell, no matter which way you slice it.
If it's a logic bug somewhere, the only thing I can suggest is cut it down to 1 child process at a time, and start working with breakpoints, printing out all of the frame information at each breakpoint.
If it's something more complex, like a race condition...I'm not sure what to tell you. Those are usually manual and painful to debug, and if using a tool a more sophisticated one than plain gdb is probably necessary. A quick google search revealed a tool called 'smartGDB', which appears to have support for debugging individual threads. It looks like it's not been updated since 1999, but it was at version 1.0 then. That (or something like it) may be worth a shot :-/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ redirect program execution blizunt7 Programming 6 09-13-2005 12:09 PM
paralell program execution vishamr2000 Programming 17 08-28-2005 09:15 AM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 09:09 PM
program execution at startup DeeDub Linux - Software 2 09-11-2003 01:25 PM
program execution monitoring imp Linux - General 1 05-26-2002 09:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration