Any Way To Find The Call Stack For Debug And Release C++ Builds?

a_unique_name 401 Reputation points
2022-03-15T22:02:30.063+00:00

Hi Folks:

Developing on Windows 10 Pro, Visual Studio Community 2022, all C++, no MFC.

I'd like to log and/or display a call stack, line numbers, function names, whatever hints are available, when a commonly used function is called.

A break point won't do because this function is going to be called many times from many points in the application and I won't know if there's something interesting to look at until I've run the code.

I'm looking for finding this information for both debug and release code.

I'm assuming less, or perhaps no, stack information is available for a release build, but I'd like testing to be done by users who won't have the development environment.

Perhaps there's a way to add some debugging information to a release build I could give the beta testers, but not put in the "real" release build the customers will see.

Thanks
Larry

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,787 questions
{count} votes

Accepted answer
  1. RLWA32 46,031 Reputation points
    2022-03-15T22:16:12.237+00:00

    First of all you want to make sure that you have symbols for Windows dlls as well as for your own application. Of course, debuggers are capable of displaying a call stack. If your interest is to generate a call stack display programmatically then the stackwalk function looks promising.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.