Discussion:
Need thread information in exception
(too old to reply)
Alan
2010-01-12 15:15:01 UTC
Permalink
It seems my application may sometimes get into an infinite loop. The
application has a top level exception handler which creates an error report
(ERRLOG.TXT) which is created using the information in an EXCEPTION_POINTERS
record. The report lists the type of exception, the module and address where
the exception occurred, system data, registers, stack dump and module
information.

I would like to provide an facility to users to force an exception if the
application "stops working". Unfortunately, the report created for such a
forced exception only relates to the code that forces the exception, which is
not where the infinite loop is. I would really like to access the program
counter for every thread and print it in this same report so I can try to
find the offending code. Is there any way to grab this information? I know it
exists because DumpMiniDump gets thread information.
Jochen Kalmbach [MVP]
2010-01-12 17:05:35 UTC
Permalink
Hi Alan!
Post by Alan
I would like to provide an facility to users to force an exception if the
application "stops working". Unfortunately, the report created for such a
forced exception only relates to the code that forces the exception, which is
not where the infinite loop is.
I suggest you write a minidump (MiniDumpWriteDump). This will write a
(small) dmp-file with all the threads and callstacks...
It can be easily debugged in VS/WinDbg by just loading the dmp-file and
providing the correct symbols (pdb) for your exe/dlls.
Post by Alan
counter for every thread and print it in this same report so I can try to
find the offending code. Is there any way to grab this information? I know it
exists because DumpMiniDump gets thread information.
You can enum all threads and the the context... but I do not suggest
this method... use MiniDumpWriteDump... it makes life easier!
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Loading...