Combined source/disassembly listing files 
Author Message
 Combined source/disassembly listing files

I would like to generate at compile/link time a combined source
code/disassembly listing file for each OBJ file in my EXEs/DLLs, like
what I see in the de{*filter*} when stopped at a break point with the
"Disassembly" window displayed, so that I can save the files in my
archive of all released versions.  This way, when my app traps an
exception at a specific address, I can figure out where it occured
without having to load the previous version into a de{*filter*}, set a
breakpoint in the correct function, and display the Disassembly window
then.

I can use DUMPBIN /DISASM to get an assembly listing, but it does not
contain address offsets or an integrated display of source-code lines.

Any suggestions?

Barry



Tue, 07 Jun 2005 00:57:10 GMT  
 Combined source/disassembly listing files
In the project settings, you can specify several different combinations
of "Listings", including one with the source and assembly combined.


Quote:

> I would like to generate at compile/link time a combined source
> code/disassembly listing file for each OBJ file in my EXEs/DLLs, like
> what I see in the de{*filter*} when stopped at a break point with the
> "Disassembly" window displayed, so that I can save the files in my
> archive of all released versions.  This way, when my app traps an
> exception at a specific address, I can figure out where it occured
> without having to load the previous version into a de{*filter*}, set a
> breakpoint in the correct function, and display the Disassembly window
> then.

> I can use DUMPBIN /DISASM to get an assembly listing, but it does not
> contain address offsets or an integrated display of source-code lines.

> Any suggestions?



Tue, 07 Jun 2005 08:56:18 GMT  
 Combined source/disassembly listing files

Quote:
> > I would like to generate at compile/link time a combined source
> > code/disassembly listing file for each OBJ file in my EXEs/DLLs, like
> > what I see in the de{*filter*} when stopped at a break point with the
> > "Disassembly" window displayed

> In the project settings, you can specify several different combinations
> of "Listings", including one with the source and assembly combined.

Yes, those settings control the /FA compiler flag, and /FAcs includes
both source, assembly, and machine code.  However, the addresses
specified in the listing file are not the same as those that appear in
the Disassembly output in the de{*filter*}; they are all zero-based in the
individual .OBJ files, instead of based on the actual addresses in the
.EXE or .DLL.  The address is the critical part---when my app crashes
on a customer's machine, I trap the exception and log the address, and
I'd like to be able to look up the exact line of code in an archive of
listing files I will create when make each release.

The solution I need has to come from LINK, DUMPBIN, or some other tool
that operates on EXEs/DLLs.

Thanks,

Barry



Tue, 07 Jun 2005 23:05:45 GMT  
 Combined source/disassembly listing files
To get the line of c/c++ code from a crash address you only need the mapfile
generated with /mapinfo:lines in the linker settings. You only have to
subtract your exes load address (typicaly 0x401000) an you come to the exact
line of code right away.

Soeren

Quote:
> The address is the critical part---when my app crashes
> on a customer's machine, I trap the exception and log the address, and
> I'd like to be able to look up the exact line of code in an archive of
> listing files I will create when make each release.

> The solution I need has to come from LINK, DUMPBIN, or some other tool
> that operates on EXEs/DLLs.

> Thanks,

> Barry



Fri, 10 Jun 2005 22:00:59 GMT  
 Combined source/disassembly listing files
Check out Crash Finder and other utilities by John Robbins:

http://www.wintellect.com/about/instructors/robbins/code.aspx

They generally use the .pdb file, which gives much more information than the
.map file.

If you're skeptical about enabling .pdb information on release
executables, this article will explain why you should do it,
and how:
http://www.cygnus-software.com/papers/release_debugging.html

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> To get the line of c/c++ code from a crash address you only need the
mapfile
> generated with /mapinfo:lines in the linker settings. You only have to
> subtract your exes load address (typicaly 0x401000) an you come to the
exact
> line of code right away.

> Soeren

> > The address is the critical part---when my app crashes
> > on a customer's machine, I trap the exception and log the address, and
> > I'd like to be able to look up the exact line of code in an archive of
> > listing files I will create when make each release.

> > The solution I need has to come from LINK, DUMPBIN, or some other tool
> > that operates on EXEs/DLLs.

> > Thanks,

> > Barry



Sat, 11 Jun 2005 03:33:04 GMT  
 Combined source/disassembly listing files

/mapinfo:lines doesn't work with VC++ 5.0, which is what I'm using.
Ditto for CrashFinder.  Perhaps it really is time to upgrade.  <sigh>

Thanks,

Barry



Sat, 11 Jun 2005 05:50:46 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Linked List, Copy source file to destination file

2. List and Tree controls combined?

3. combine a list box and an edit ctrl?

4. Accessing header files from source listing

5. Exporting fully qualified source file and dependency list

6. Combining files...How

7. Combining files...How??

8. Combining BSC files?

9. Combining BSC files?

10. combining two C(Audio)File objects in memory

11. Conversion of Ansi C source files to cc source

12. VISUAL C++ source browser source file location

 

 
Powered by phpBB® Forum Software