C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 3rd, 2006, 12:48 AM
George2 George2 is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: May 2006
Posts: 763 George2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 3 h 52 m
Reputation Power: 9
How to get function call stack

Hello everyone,


I am using C/C++ on Windows. I am wondering how to get the function call stack from my application.

For example,

if function foo call function goo, then function goo call function zoo, in function goo, I want to output the function call stack (foo --> goo --> zoo), and in goo, output the function call stack (foo --> goo).

Are there any samples of how to implement that? Does Windows runtime support this feature?


thanks in advance,
George

Reply With Quote
  #2  
Old November 3rd, 2006, 09:40 AM
Paul820 Paul820 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Location: United Kingdom
Posts: 428 Paul820 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 7 h 55 m 4 sec
Reputation Power: 9
Doesn't google come up with anything useful? You can view the call stack inside your ide, and then dump the results. Give google a try, see what it comes up with.

Reply With Quote
  #3  
Old November 5th, 2006, 03:34 AM
George2 George2 is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: May 2006
Posts: 763 George2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 3 h 52 m
Reputation Power: 9
Hi Paul820,


Quote:
Originally Posted by Paul820
Doesn't google come up with anything useful? You can view the call stack inside your ide, and then dump the results. Give google a try, see what it comes up with.


I have found some solutions, but all of them are not suitable for me. I am not using any IDE, but testing the release version program. There are some solutions for C++, but no C...

Any useful tutorials/samples to recommend?


regards,
George

Reply With Quote
  #4  
Old November 5th, 2006, 01:49 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 10
Send a message via AIM to ubergeek
You can run your program inside the gdb debugger, which has the ability to set breakpoints and view stack traces, and even tell you the vales of variables.

There's also a very complicated Win32 process described here.

Last edited by ubergeek : November 5th, 2006 at 01:52 PM.

Reply With Quote
  #5  
Old November 7th, 2006, 07:58 AM
George2 George2 is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: May 2006
Posts: 763 George2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 3 h 52 m
Reputation Power: 9
Hi ubergeek,


Quote:
Originally Posted by ubergeek
You can run your program inside the gdb debugger, which has the ability to set breakpoints and view stack traces, and even tell you the vales of variables.


I am using Windows platform. So can not use gdb.

Quote:
Originally Posted by ubergeek
There's also a very complicated Win32 process described here.


But I can not access the URL. Is the URL correct? If it is correct, it may be caused by the school proxy settings. So, could you send an alternative URL with the same content please?


regards,
George

Reply With Quote
  #6  
Old November 7th, 2006, 08:25 AM
Paul820 Paul820 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Location: United Kingdom
Posts: 428 Paul820 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 7 h 55 m 4 sec
Reputation Power: 9
George, gdb is available for windows. And the link ubergeek put up works for me. I will put the link up again, and also the link for gdb. I will also just put them as text so you can copy and paste. I would suggest getting the gdb documentation aswell.

ubergeeks link
gdb
gdb documetation

Here they are in text format:

http://www.eptacom.net/pubblicazioni/pub_eng/except.html
http://www.gnu.org/software/gdb/download/
http://www.gnu.org/software/gdb/documentation/

Hope this helps you a bit more. Good luck.

Reply With Quote
  #7  
Old November 7th, 2006, 05:12 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 10
Send a message via AIM to ubergeek
If your school is being annoying, I bet it won't block Google's cache of the file:
google cache of that except.html page
Keep in mind that URL might change -- I just found it by searching google for cache: and then the url.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > How to get function call stack


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap