Re: Problem in finding source code line number from ExceptionAddress
- From: "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
- Date: Thu, 16 Mar 2006 10:05:43 +0200
I have created an class for exception handling, it is derived from
CException abstract class. This exception handler is capable of
catching all asynchromous exceptions, so no no need of using dirty
catch(...). It contains an overloaded function GetErrorMessage() which
returns the exact exception type and exception-address.
I tried to use the compiler generated .MAP file to find the exact
source line number from exception-address. But I could't find any
formula to do so. I tried to use following formula, but it seems to
work only in case of address found when application crashes :
<crash_addr> - <Preferred_load_address> - 1000h
The formula is correct (assuming that the module was not relocated,
otherwise you would have to also compensate for the difference between
the real and preferred load addresses, and also assuming that the exception
has occurred in the given module).
Could you please provide the sample data for the situation when
the formula does not work? (Exception address, preferred load address,
real load address of the module, the relevant contents of .MAP file
(list of sections, snippet of function list, snippet of line number list)).
Also take a look at minidumps. It is a modern post-mortem debugging technique,
much more efficient than .MAP files:
http://www.codeproject.com/debug/postmortemdebug_standalone1.asp
Regards,
Oleg
[VC++ MVP http://www.debuginfo.com/]
.
- References:
- Problem in finding source code line number from ExceptionAddress
- From: prashant_mandhare04
- Problem in finding source code line number from ExceptionAddress
- Prev by Date: Re: VS 2005: Object Browser failure
- Next by Date: Re: how to debug an eeaddin? or how to debug a VC addin?
- Previous by thread: Problem in finding source code line number from ExceptionAddress
- Next by thread: VS 2005: Object Browser failure
- Index(es):
Relevant Pages
|