|
|
 | | From: | Darren R. Starr | | Subject: | obtaining stack traces through code | | Date: | Mon, 03 Jan 2005 15:06:27 +0100 |
|
|
 | When developing code under Visual Studio, there is a library (imagehlp.dll) which allows traversal of browser database information from within code.
For example, I can easily write a function which will dump the stack trace of the running program from the current execution point by making use of this library. This is extremely useful when debugging from CodeWarrior since the CodeWarrior debugger is less than reliable at best.
It is important to me that I should be able to write a function prints out the following information upon being called :
Dumping stack trace : 3 ... cyclic.cpp (451) void Cycler::cycling(int a, int b, int c) Frame Pointer - 0x3949438F DumpStackTrace(); 2 ... cyclic.cpp (100) void Cycler::cycler() Frame Pointer - 0x7843344A cycling(1, 2, 4); 1 ... main.cpp Frame Pointer - 0x43959843 c->cycler();
This is in fact extremely easy to accomplish on Windows using Visual C++. Please see http://www.microsoft.com/msj/0597/hood0597.aspx for further information.
|
|
|