By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

stack trace not working independently?

P: n/a
We have an application developed in c++ and the development environment
is visual studio .net 2003. We have added a cpp program to the
application which will create a log file containing the trace back
details which will help us to identify the areas of application
crashes. The log file will contain details about the file name, line
number and the order of the called functions leading to the crash. The
cpp program we had added is stackwalker.cpp which is downloaded from
the net. This application is working fine in the system where we are
building the application. But when we copy the executable alone to a
different system where we dont have any supporting softwares like
visual studio .net 2003, it is creating a log file but the log file
does not have the necessary trace back details. Can any one say why the
trace back details is not getting generated when we run the executable
alone in a separate system. Is there any separate library files or dll
files that we need to include along with the executable or do we need
to make any changes in the environmental variable settings.

Apr 11 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
sa**************@gmail.com wrote:
We have an application developed in c++ and the development environment
is visual studio .net 2003. We have added a cpp program to the
application which will create a log file containing the trace back
details which will help us to identify the areas of application
crashes. The log file will contain details about the file name, line
number and the order of the called functions leading to the crash. The
cpp program we had added is stackwalker.cpp which is downloaded from
the net. This application is working fine in the system where we are
building the application. But when we copy the executable alone to a
different system where we dont have any supporting softwares like
visual studio .net 2003, it is creating a log file but the log file
does not have the necessary trace back details. Can any one say why the
trace back details is not getting generated when we run the executable
alone in a separate system. Is there any separate library files or dll
files that we need to include along with the executable or do we need
to make any changes in the environmental variable settings.


This is not a C++ language question. You should instead ask it in a
Microsoft-specific group, or ask it of the vendor of stackwalker.cpp.
See this FAQ for what is on-topic in this group and for some
suggestions of where else you might post:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

Apr 11 '06 #2

P: n/a

<sa**************@gmail.com> píse v diskusním príspevku
news:11**********************@e56g2000cwe.googlegr oups.com...
We have an application developed in c++ and the development environment
is visual studio .net 2003. We have added a cpp program to the
application which will create a log file containing the trace back
details which will help us to identify the areas of application
crashes. The log file will contain details about the file name, line
number and the order of the called functions leading to the crash. The
cpp program we had added is stackwalker.cpp which is downloaded from
the net. This application is working fine in the system where we are
building the application. But when we copy the executable alone to a
different system where we dont have any supporting softwares like
visual studio .net 2003, it is creating a log file but the log file
does not have the necessary trace back details. Can any one say why the
trace back details is not getting generated when we run the executable
alone in a separate system. Is there any separate library files or dll
files that we need to include along with the executable or do we need
to make any changes in the environmental variable settings.


If you look at its implementation you will see that it relies on MS's
dbghelp.dll (imagehlp.dll), which implements the tracing capabilities and
interprets the MS debugging information, so that stack can be traced
and function addresses can be translated to function names. The reason
why it does not work on your machine is (either or both):

a) symbol files (.pdb) for your executable and dlls are not present on the
target computer

b) the supporting dlls on the target computer do not understand debugging
information produced by MSVC7.1 (this is very likely - for example
dbghelp.dll/imagehlp.dll shipped with Windows2000 does not understand
PDB files generated by MSVC7)

Back in 2003 I implemented another stack tracer that takes a similar
approach as stackwalker.cpp does. You might want to look at:
http://cvs.sourceforge.net/viewcvs.p...=1.8&view=auto

-- Marek

Apr 11 '06 #3

P: n/a
Thanks for your great help.
Is there any way to fix this issue, i mean make the present executable
working in another windows machine..
Shall i copy all thie required dll and .pdb file to the second machine
where my executable having problem.?

sam

Apr 12 '06 #4

P: n/a
> Is there any way to fix this issue, i mean make the present executable
working in another windows machine..
Shall i copy all thie required dll and .pdb file to the second machine
where my executable having problem.?


Yes. Copy the pdb files and the required DLLs. Debugger can be used to
determine what DLLs are mapped to your process (this should actually be
inspected after a stack trace is dumped because SymInitialize() might load
other DLLs).

Be aware that the stackwalk.cpp implementation (unlike mine) does not work
on NT4 nor W9x. However, this is probably no longer an issue...

-- Marek


Apr 12 '06 #5

P: n/a
Hi Marek,

Could you please help us in sharing the piece of sample code for
tracking the Stacks in release and debug code .We are not getting the
reuslts what we are expected.We are not able get the base class
StackTracer and stack_tracer_win32.h file.

We are getting compilation results when we build with #include
<dbghelp.h> included in the code .We dont find this file in my system.
Thanks in advance

Apr 12 '06 #6

P: n/a
sa**************@gmail.com wrote:
Hi Marek,

Could you please help us in sharing the piece of sample code for
tracking the Stacks in release and debug code .We are not getting the
reuslts what we are expected.We are not able get the base class
StackTracer and stack_tracer_win32.h file.

We are getting compilation results when we build with #include
<dbghelp.h> included in the code .We dont find this file in my system.


How about taking this to an MS newsgroup?
Apr 12 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.