Re: Win32 SEH question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tom Stewart (tastewar_at_newsgroups.nospam)
Date: 04/30/04


Date: Fri, 30 Apr 2004 15:45:48 -0400

Generally, your code starts at 0x401000, so you subtract that from your EIP to determine the offset in your code that
the error occurred. In VS.NET 2003, to generate a listing file, go to the Properties for the project, select the C/C++
section, Output Files, and select a choice that includes Machine Code from the Assembler Output dropdown. The resulting
.COD file will have the offset (within the current function) as the first bit on each assembler line. So, you start with
your offending instruction address, subtract 401000, look in your map file to find the function where that offset would
be found, subtract the offset of that function, then look in the listing file for the instruction at that offset within
that function.

HTH.

--
Tom
"Trevor" <trevor@nospam.com> wrote in message news:%23LPvebuLEHA.268@TK2MSFTNGP10.phx.gbl...
>
> "Tom Stewart" <tastewar@newsgroups.nospam> wrote in message
> news:euqfA5tLEHA.3324@TK2MSFTNGP10.phx.gbl...
> > EIP will show you exactly the offending instruction. If you maintain
> listing and map files for your projects, you should
> > be able to figure out where (in the source) the problem came from. Takes
> practice, however...
> >
> Tom,
>
>     You have been very helpful so far.  Thank you for your help.  I know how
> to maintain a map file but how do I maintain a list file in Visual C++ 6.0?
> I have an example I would like to verify with you.  I got "0x0040392D" out
> of the EIP in a crash that I caused on purpose.  I opened up my log file and
> looked for "392D".  I couldn't find it.  So I started looking for numbers
> near "392D" and I came up with:
>
>  0001:00002920       _IPStartup                 00403920 f   IPCODE.OBJ
>
> The next entry in the map file is:
>
>  0001:000029a0       _IPCleanup                 004039a0 f   IPCODE.OBJ
>
> Given that 392D is between the two (3920 & 39a0) is it safe to assume that
> the crash happened somewhere inside of IPStartup?  IPStartup _is_ where I
> caused a NULL pointer dereference on purpose.  Is it just a coincidence or
> am I heading on the right path to finding out which function I was in while
> my program crashed?
>
>


Relevant Pages

  • Re: debugging a "data abort"
    ... But, looking in my .map file, I don't have anything anywhere near that. ... Subtract the app load address from PC and you get ... function call closest but not above that offset. ... "Data Abort" error when running. ...
    (microsoft.public.pocketpc.developer)
  • Re: debug message and map information
    ... ofcourse I omitted the "magic" 0x1000 ofset beteen the map file ... You need to subtract ... 0x1000 from the offset, so the correct offset should be 0x47f0. ... Henrik Viklund ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Debugging
    ... > In the map file you will find the base addresses of functions ... Find the function that would contain that offset, ... > beitman AT applieddata DOT net ... > ychammings AT adeset DOT com> ...
    (microsoft.public.windowsce.platbuilder)
  • Re: debugging a "data abort"
    ... then passing it to another function in the DLL (since the RA is also in the ... But, looking in my .map file, I don't have anything anywhere near that. ... function call closest but not above that offset. ... "Data Abort" error when running. ...
    (microsoft.public.pocketpc.developer)
  • Re: [OOPS] less /proc/net/igmp
    ... not maintain the offset into the file in the application. ... > bash# mount /proc ... > EIP is at 0x8051be0 ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)