Re: Win32 SEH question
From: Tom Stewart (tastewar_at_newsgroups.nospam)
Date: 04/30/04
- Next message: Bill McKenzie: "Re: driver book for beginners"
- Previous message: Marcio Ferreira: "Re: Running a Service Executable from a Network Path"
- In reply to: Trevor: "Re: Win32 SEH question"
- Next in thread: Oleg Starodumov: "Re: Win32 SEH question"
- Messages sorted by: [ date ] [ thread ]
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? > >
- Next message: Bill McKenzie: "Re: driver book for beginners"
- Previous message: Marcio Ferreira: "Re: Running a Service Executable from a Network Path"
- In reply to: Trevor: "Re: Win32 SEH question"
- Next in thread: Oleg Starodumov: "Re: Win32 SEH question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|