Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / June 2008



Tip: Looking for answers? Try searching our database.

Getting a stack trace from a running application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fernando Rodriguez - 27 Jun 2008 18:55 GMT
Dear fellow dinosaurs,

Some customers are complaining that my VB6 app raises a GPF on exiting. Unfortunately,
the only infromation they can provide is a memory address, which is pretty
useless as it doesn't tell me if my main exe is the culprit or if it's some
dll or ocx or whatever.

I managed to catch that and other exceptions using SetUnhandledExceptionFilter()
(see http://urlmini.us?i=1099) , but I still have no idea where the exception
is comming from.  Is there a way to get a stack trace up to the offending
function and module?

Even better, is there any pre-built solution for this?  Free or commercial.

Thanks in advance!
Stoil Marinov - 27 Jun 2008 19:21 GMT
> Dear fellow dinosaurs,
>
[quoted text clipped - 11 lines]
>
> Thanks in advance!

Hi Fernando,

If you can reproduce the error on your computer, you could run the
program in the VS (VC++) debugger and catch the error in there. If you
compile the the program with debug information (check the Compile
options), the debugger will show the responsible line of your code that
caused the error.
I use this method of tracking down bugs that happen only in the compiled
version. Usually they stem from the optimizations I have selected for
the compiler.

If the error happens only on the users' computers, then you might want
to check Matthew Curland's book and debug code:
"Advanced Visual Basic 6: Power Techniques for Everyday Programs"
   Author: Matthew Curland
   Published by: Addison-Wesley, July 2000
   ISBN: 0-201-70712-8
   http://www.PowerVB.com
On the CD, accompanying the book he has several modules (.bas) that let
you get source code location of the error from the memory address of the
error. he discusses the debugging in Chapter 11 of his book.
You still have to compile with Create Symbolic Debug Info option
checked. You can create a debug version of your program using this
modules and ask the user to run it. When an error happens you could
display the information you get from the stack (using the debug modules)
and display it for the user or save it into a file.

Regards,

Stoil
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.