Is there a way with Linux x86 to report a way the current stack trace for a thread?

Discussion in 'C++' started by kevin.hall@motioneng.com, Oct 20, 2005.

  1. Guest

    Is there a way with Linux x86 to report a way the current stack trace
    for a thread during runtime without a debugger? (I couldn't find
    anything searching Google.)

    For Windows this is possible. Here's an example of an application that
    uses Window's stack tracing abilities:

    http://www.codeproject.com/tools/visualleakdetector.asp

    Many thanks!

    - Kevin
     
    , Oct 20, 2005
    #1
    1. Advertising

  2. mlimber Guest

    wrote:
    > Is there a way with Linux x86 to report a way the current stack trace
    > for a thread during runtime without a debugger? (I couldn't find
    > anything searching Google.)
    >
    > For Windows this is possible. Here's an example of an application that
    > uses Window's stack tracing abilities:
    >
    > http://www.codeproject.com/tools/visualleakdetector.asp
    >
    > Many thanks!
    >
    > - Kevin


    This is off topic in this newsgroup, which is concerned with standard
    C++ language issues. Try in a Linux programming forum. See this FAQ for
    some specific suggestions:

    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9

    Cheers! --M
     
    mlimber, Oct 20, 2005
    #2
    1. Advertising

  3. Re: Is there a way with Linux x86 to report a way the current stacktrace for a thread?

    wrote:
    > Is there a way with Linux x86 to [...]


    You seem lost. You need 'comp.os.linux.development.*' hierarchy.
    'comp.lang.c++' is about C++ _language_. When you have a C++ language
    question, please come back and ask it.

    V
     
    Victor Bazarov, Oct 20, 2005
    #3
  4. red floyd Guest

    Re: Is there a way with Linux x86 to report a way the current stacktrace for a thread?

    wrote:
    > Is there a way with Linux x86 to report a way the current stack trace
    > for a thread during runtime without a debugger? (I couldn't find
    > anything searching Google.)
    >
    > For Windows this is possible. Here's an example of an application that
    > uses Window's stack tracing abilities:
    >
    > http://www.codeproject.com/tools/visualleakdetector.asp
    >
    > Many thanks!
    >
    > - Kevin
    >


    I was able to write one in SCO ODT 2. Look at ptrace(2) or whatever the
    equivalent in Linux is.

    However, as mlimber pointed out, this is OT. Try gnu.g++.help
     
    red floyd, Oct 20, 2005
    #4
  5. wrote:
    > Is there a way with Linux x86 to report a way the current stack trace
    > for a thread during runtime without a debugger? (I couldn't find
    > anything searching Google.)


    You should ask in linux newsgroup then.
    For a gcc there is void* __builtin_return_address(unsigned level);
    and void* __builtin_frame_address(unsigned level);
    with level 0 returning current function and frame address respectively.

    Greetings, Bane.
     
    Branimir Maksimovic, Oct 20, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grumble

    Re: x86 Stack Confusion

    Grumble, Jan 9, 2006, in forum: C Programming
    Replies:
    51
    Views:
    1,065
    Dave Thompson
    Jan 16, 2006
  2. Nelson Ashton
    Replies:
    15
    Views:
    8,624
    Nelson Ashton
    Oct 15, 2008
  3. omkarenator

    stack pointer alignment on x86 and x86_64

    omkarenator, May 1, 2009, in forum: C Programming
    Replies:
    2
    Views:
    1,491
    omkarenator
    May 1, 2009
  4. Replies:
    1
    Views:
    132
    Bob Barrows [MVP]
    Oct 4, 2007
  5. Replies:
    3
    Views:
    190
Loading...

Share This Page