News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Symbolic Debugger

Started by cman, July 14, 2010, 07:38:14 PM

Previous topic - Next topic

cman

Is there a debugger available for Masm in which the user can debug source code line by line and view the status of symbols declared in the original source? I've been looking for something that will help me debug assembly as fast as I can debug C ( C is almost too easy to debug compared to assembly  :bg ). Thanks for any information....

redskull

WinDBG does it very well.  OllyDbg can follow the source, but I don't think it can do symbols.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

dedndave

from what Jochen says, Olly v 1 can handle symbols
this capability hasn't been added to v 2 as yet, but is intended in future builds

GregL


cman

Is there any information available on the web about configuring VC++ to debug Masm source code files? I haven't had any luck trying to do this. Thanks.

clive

Quote from: cman on July 15, 2010, 07:08:27 PM
Is there any information available on the web about configuring VC++ to debug Masm source code files? I haven't had any luck trying to do this. Thanks.

Well the general trick is to make sure that you assemble the with CodeView, COFF or PDB debug symbols so that the debugger can find the source code and cross reference the source, line numbers and the object code.

Suggest you start by using the ML /Zi option, or perhaps /Zd, you can also pass command line options to the linker using the -link option to control if the file has embedded COFF symbols or generates a PDB file.

Generally if you have installed MSVC, and an application traps/faults, and has debug symbol, these will normally appear in the debugger.

C:\MASM>ml -Fl -coff -Zi test32.asm -link /SUBSYSTEM:CONSOLE
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: test32.asm
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/SUBSYSTEM:CONSOLE
"test32.obj" /DEBUG
"/OUT:test32.exe"

C:\MASM>dir test32.*
Volume in drive C has no label.
Volume Serial Number is xxxx-xxxx

Directory of C:\MASM

07/15/2010  03:01 PM               198 test32.asm
07/15/2010  03:00 PM               196 test32.bak
07/15/2010  04:21 PM            20,515 test32.exe
07/15/2010  04:21 PM             9,072 test32.ilk
07/15/2010  04:21 PM             2,481 test32.lst
07/15/2010  04:21 PM               872 test32.obj
07/15/2010  04:21 PM            66,560 test32.pdb
               7 File(s)         99,894 bytes
It could be a random act of randomness. Those happen a lot as well.

GregL

#6
I have gone over how to do this more than once in these forums.

Like Clive said assemble with the /Zi switch. Link with the /DEBUG switch. Open the .exe in Visual C++ IDE under Open Project. From the command-line you can use devenv.exe program.exe /debugexe or VCExpress.exe program.exe /debugexe. Once your program is open in the debugger under Debug select Step Into. You might also want to select Goto Dissassembly.

cman

Ok , thanks guys! I finally got VC++ to spit out the symbol associations. Thanks for your help!

brixton

I wrote an application in C which did this (it forms part of my master's thesis).  Assembling and linking using MASM is the way forward, and a tip: compiling with Cygwin's GCC (with -g and -gcoff) is a pain, so many (seemingly) useless symbols included..
If you love somebody, set them free.
If they return, they were always yours. If they don't, they never were..