Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8399639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:21:29+00:00 2026-06-09T21:21:29+00:00

Possible Duplicate: print call stack in C or C++ Often times when debugging code

  • 0

Possible Duplicate:
print call stack in C or C++

Often times when debugging code I need to figure out who is calling the function that I have placed a debug statement in. I know that __FUNCTION__ evaluates to the name of the current function, but is there something similar that will give me the name of the callee? Or maybe print out the call stack?

The information must be available. If I put in an assert or code that will segfault, I get a stack trace that shows the entire call stack. Where does the stack trace-printing code get that information?

If you are unable to produce a platform-agnostic solution, then something that will work on x86_64 Ubuntu 12.04 compiled with gcc will do. Bonus points for providing solutions for other platforms as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:21:31+00:00Added an answer on June 9, 2026 at 9:21 pm

    This is OS-dependent.

    On Linux and gcc, use backtrace(3). For Windows, see this SO question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to print out the method name and line number and conditionally
Possible Duplicate: Call Python From PHP And Get Return Code probably a very stupid
Possible Duplicate: Is it possible to print out the size of a C++ class
Possible Duplicate: Python, Printing multiple times, I'd like to know how to print a
Possible Duplicate: Where should I call Free() function? When I used valgrind --leak-check=full --show-reachable=yes
Possible Duplicate: Pass a buffer by reference to other function When I call the
Possible Duplicate: function call with different semantics I am reading about function pointers in
Possible Duplicate: Timeout on a Python function call I want to implement that when
Possible Duplicate: C++: Print out enum value as text Say I have an enumeration:
Possible Duplicate: translate vs transform-origin css3 I've been stuck trying to figure out how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.