Assembly problem

B

bilaribilari

Hello,
I have a huge application thats written in C and C++. The application
crashes and I am trying to find a pattern to these crashes. I recently
got my hands on the DrWatson log and the user.dmp file. On running this
dump using Visual studio, I got a lot of Assembly code that I can't
make head or tail of. I was wondering if I can compile the entire
application on my local box and generate the assembly code so that I
can then pinpoint the section of the assembly code that causes the
unhandled exception and trace it back to my C/C++ code. So my questions
are:
1. Is there a better way to know what function in C C++ code is causing
the Unhandled exception when you ONLY have access to assembly code
without any symbols?
2. Is there a setting in some compiler (visual studio for e.g.) that
generates Assembly code instead of object code?
Thanks in advance for your time.

Best regards,
B.
 
J

jaysome

Hello,
I have a huge application thats written in C and C++. The application
crashes and I am trying to find a pattern to these crashes. I recently
got my hands on the DrWatson log and the user.dmp file. On running this
dump using Visual studio, I got a lot of Assembly code that I can't
make head or tail of. I was wondering if I can compile the entire
application on my local box and generate the assembly code so that I
can then pinpoint the section of the assembly code that causes the
unhandled exception and trace it back to my C/C++ code. So my questions
are:

This newsgroup, comp.lang.c, is about discussing standard C
language-related issues.

Unfortunately, the C standard doesn't mention anything about DrWatson
or user.dmp or Visual Studio or even assembly code, so technically
your post is off-topic and consequently we can't really, technically,
help you.
1. Is there a better way to know what function in C C++ code is causing
the Unhandled exception when you ONLY have access to assembly code
without any symbols?

Maybe, but some would equate this to making a cow out of hamburger. Be
forewarned.
2. Is there a setting in some compiler (visual studio for e.g.) that
generates Assembly code instead of object code?
Thanks in advance for your time.

If there is, you're best off asking this question in a newsgroup that
is more specific to your compiler. Search http://groups.google.com.
 
B

Ben C

Hello,
I have a huge application thats written in C and C++. The application
crashes and I am trying to find a pattern to these crashes. I recently
got my hands on the DrWatson log and the user.dmp file. On running this
dump using Visual studio, I got a lot of Assembly code that I can't
make head or tail of. I was wondering if I can compile the entire
application on my local box and generate the assembly code so that I
can then pinpoint the section of the assembly code that causes the
unhandled exception and trace it back to my C/C++ code. So my questions
are:
1. Is there a better way to know what function in C C++ code is causing
the Unhandled exception when you ONLY have access to assembly code
without any symbols?

You can usually tell the linker to emit a "map file" as well the
executable, which can help you find your way back from a code address to
the C function the code came from.

Check your tool's docs for map file-- hopefully it will also explain how
they work on your system.
2. Is there a setting in some compiler (visual studio for e.g.) that
generates Assembly code instead of object code?

Most compilers can do this, I don't know how you do it in Visual Studio.
The alternative is to disassemble the object code with a disassembler,
which usually works just as well (assembly -> object code is a pretty
much reversible transformation, unlike cow -> hamburger).
 
D

Dave Thompson

Most compilers can do this, I don't know how you do it in Visual Studio.

M$VC has options to generate assy listing _in addition to_ object, and
for linker to generate a map. And the IDE debugger can display
disassembly (by default for code with no symbol info) but see below.
The alternative is to disassemble the object code with a disassembler,
which usually works just as well (assembly -> object code is a pretty
much reversible transformation, unlike cow -> hamburger).

Not fully. Disassembly can't give you any macros, assy-time
computations, comments, formatting, or ordering of pieces of segments;
and depending on what symbols are kept in your object or executable
maybe not names (symbols) for values or even for locations.

What is true is that disassembly usually gives you code that can be
read with modest effort and even maintained (modified) if needed,
while decompilation doesn't.

To stretch the analogy: A bunch of hamburger pressed back together
isn't really a steak, and it would be fraud to price it as such, but
you can cook it and eat it and get (essentially) the same nutrition.
Whereas you have no hope of getting it to amble and moo.

- David.Thompson1 at worldnet.att.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,800
Messages
2,569,656
Members
45,399
Latest member
JettTancre
Top