CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > C++ (Non Visual C++ Issues)
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    C++ (Non Visual C++ Issues) Ask or answer C and C++ questions not related to Visual C++. This includes Console programming, Linux programming, or general ANSI C++.

    Reply
     
    Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
      #1    
    Old November 3rd, 2006, 12:46 AM
    George2 George2 is offline
    Elite Member
    Power Poster
     
    Join Date: Oct 2002
    Posts: 4,466
    George2 is on a distinguished road (30+)
    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, 02:30 AM
    laitinen laitinen is offline
    Senior Member
     
    Join Date: May 2006
    Location: Norway
    Posts: 1,706
    laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)
    Re: how to get function call stack

    Hi!

    Are you looking for something like this; http://www.codeproject.com/useritems/cmtrace.asp

    Thanks

    Laitinen
    Reply With Quote
      #3    
    Old November 3rd, 2006, 02:49 AM
    George2 George2 is offline
    Elite Member
    Power Poster
     
    Join Date: Oct 2002
    Posts: 4,466
    George2 is on a distinguished road (30+)
    Re: how to get function call stack

    Hi Laitinen,


    Quote:
    Originally Posted by laitinen
    Hi!

    Are you looking for something like this; http://www.codeproject.com/useritems/cmtrace.asp

    Thanks

    Laitinen
    I have looked into this utility. It is not very convenient to use, since we need to manually invoke trace at the beginning of each function...

    What I want to have is something like printStackTrace in Java, which is provided by system SDK or system internal accessible interface to produce the function call stack information.


    regards,
    George
    Reply With Quote
      #4    
    Old November 3rd, 2006, 02:58 AM
    laitinen laitinen is offline
    Senior Member
     
    Join Date: May 2006
    Location: Norway
    Posts: 1,706
    laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)laitinen has much to be proud of (1500+)
    Re: how to get function call stack

    Sorry George!

    I dont have any good suggestions for you!

    Laitinen
    Reply With Quote
      #5    
    Old November 3rd, 2006, 04:36 AM
    exterminator's Avatar
    exterminator exterminator is offline
    Microsoft MVP
    Power Poster
     
    Join Date: Feb 2005
    Location: "The Capital"
    Posts: 5,293
    exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)
    Re: how to get function call stack

    This should be helpful - http://www.eptacom.net/pubblicazioni...ng/except.html
    Reply With Quote
      #6    
    Old November 5th, 2006, 03:43 AM
    George2 George2 is offline
    Elite Member
    Power Poster
     
    Join Date: Oct 2002
    Posts: 4,466
    George2 is on a distinguished road (30+)
    Re: how to get function call stack

    Hi exterminator,


    Quote:
    Originally Posted by exterminator
    I think the material you recommend should be good. But I can not open the URL, so could you try whether the URL is correct?

    If the URL is correct, it may be school proxy settings blocks the access to the URL. So, could you upload the tutorial you recommended as an attachment please? :-)


    regards,
    George
    Reply With Quote
      #7    
    Old November 5th, 2006, 03:48 AM
    exterminator's Avatar
    exterminator exterminator is offline
    Microsoft MVP
    Power Poster
     
    Join Date: Feb 2005
    Location: "The Capital"
    Posts: 5,293
    exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)exterminator has a brilliant future (2000+)
    Re: how to get function call stack

    Don't take that for granted. Always, verify what you get unless I say "take my word for it" which I rarely say!

    Here's an alternate link to it from DDJ - http://www.ddj.com/dept/cpp/184403512
    Reply With Quote
      #8    
    Old November 5th, 2006, 04:01 AM
    George2 George2 is offline
    Elite Member
    Power Poster
     
    Join Date: Oct 2002
    Posts: 4,466
    George2 is on a distinguished road (30+)
    Re: how to get function call stack

    Thank you exterminator!


    Quote:
    Originally Posted by exterminator
    Don't take that for granted. Always, verify what you get unless I say "take my word for it" which I rarely say!

    Here's an alternate link to it from DDJ - http://www.ddj.com/dept/cpp/184403512
    As I said, you always recommend good materials. And this one is just what I am looking for.


    regards,
    George
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > C++ (Non Visual C++ Issues)


    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

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


    All times are GMT -5. The time now is 09:47 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009