News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Make.bat, debug & pdb info

Started by LordAdef, May 01, 2018, 06:33:57 AM

Previous topic - Next topic

LordAdef

Hi,

I'm trying to have a debug build as detailed as possible, so I could have my asm code in the debugger.
I'm on win10 and cannot read the help file.

since this is a simple thing for you guys, I wondered if you could show me a make.bat that does this.. and I thank you in advance for that.

I'm currently using a modified version of Hutch's make.bat:

@echo off

if not exist rsrc.rc goto over1
\masm32\bin\rc /v rsrc.rc
\masm32\bin\cvtres /machine:ix86 rsrc.res
:over1

if exist "main.obj" del "main.obj"
if exist "main.exe" del "main.exe"

\Masm32\bin\UAsm64 /c /coff "main.asm"
if errorlevel 1 goto errasm

if not exist rsrc.obj goto nores

\Masm32\bin\polink /SUBSYSTEM:CONSOLE /OPT:NOREF "main.obj" rsrc.res
if errorlevel 1 goto errlink

dir "main.*"
goto TheEnd

:nores
\Masm32\bin\polink /SUBSYSTEM:console /OPT:NOREF "main.obj"
if errorlevel 1 goto errlink
dir "main.*"
goto TheEnd

:errlink
echo _
echo Link error
goto TheEnd

:errasm
echo _
echo Assembly Error
goto TheEnd

:TheEnd

pause


My prog is a 32bit one.
Either debugging in Olly or Visual Studio (Do I Have to export a pdb file for that?)

Thanks
Alex

fearless

for debug and pdb output the linker needs, as an example:

/DEBUG /DEBUGTYPE:CV /PDB:"main.pdb"

LordAdef

Quote from: fearless on May 01, 2018, 10:08:53 AM
for debug and pdb output the linker needs, as an example:

/DEBUG /DEBUGTYPE:CV /PDB:"main.pdb"


thanks Fearless, I tried that but it didn't work..

johnsa

For the assembly portion don't forget to include debugging output with -Zi, -Zd
For the linker (assuming MS Link) just /debug should be sufficient.

I use this for 32 and  64bit inside Visual Studio for full source-level debugging. As I mentioned in another post I've started using AsmDude plugin for Visual Studio to provide intellisense, completion, timings and syntax highlighting so it makes the whole experience quite pleasant. Combined with an integrated shell plugin in VS you can do everything from the IDE without ever leaving, even if you still use batch files for building (as I do).


LordAdef

Quote from: johnsa on May 01, 2018, 06:03:09 PM
For the assembly portion don't forget to include debugging output with -Zi, -Zd
For the linker (assuming MS Link) just /debug should be sufficient.

I use this for 32 and  64bit inside Visual Studio for full source-level debugging. As I mentioned in another post I've started using AsmDude plugin for Visual Studio to provide intellisense, completion, timings and syntax highlighting so it makes the whole experience quite pleasant. Combined with an integrated shell plugin in VS you can do everything from the IDE without ever leaving, even if you still use batch files for building (as I do).

I'm using Polink.
Yes, I saw your post about AsmDude and had it already installed. It's nice. Do you have any special settings for Visual Studio (mine is community) in order to work with masm and Uasm?

johnsa

Nope nothing specific, just a plain installation of asmDude, I think i customised the style/colours etc a bit and I added a proper terminal window extension to VS too (so it's like VSCode with a terminal at the bottom).