News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

noob with windbg not working could be masm settings

Started by flipflop1, March 26, 2013, 05:49:39 AM

Previous topic - Next topic

flipflop1

hi im new to the forums but here goes

ive been programming for 20 years and programming in asm for a while but ive desided I would like to have a debugger that can step through my source. I downloaded olly and couldn't really get on with it so I thought id try windbg but ive had problems now its turning into a mission to solve this problem

I have a standard masm32 setup and a standard windbg setup but Im having problems with my symbols ive downloaded all the needed symbols from Microsoft but it seems as though this is not the problem link does not seem to create a pdb file for windbg to find

this is the command ive been using

\masm32\bin\Link /SUBSYSTEM:WINDOWS /VERBOSE /DEBUG /DEBUGTYPE:COFF  /PDB:prime.pdb prime.obj

it compiles fine but no pdb file is found anywhere on my harddrive

please help

ragdog

Hi

Have you set in ML settings the Zi switch?

ml /c /coff /Cp /Zi /Zd "source.asm"
link /SUBSYSTEM:WINDOWS /DEBUG /VERSION:4.0 /OUT:"source.exe" "source.obj"  "rsrc.res"

Magnum

Try this.



\masm32\bin\ml /c /coff /Zi %1.asm

\masm32\bin\Link /RELEASE /DEBUG /SUBSYSTEM:WINDOWS /OPT:NOREF %1.obj rsrc.obj

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

rsala

Hi flipflop1,

I use the command line options below and I get the .pdb file.

\masm32\bin\ml  /X /nologo /c /coff /Cp /Zp4 /Zi /Zd

\masm32\bin\Link  /nologo /subsystem:windows /debug /nodefaultlib:libc
EC coder

flipflop1

thanks ragdog and magnum

ragdog your settings worked

I will play for a bit to see which setting that was different seemed to work I think it may have been the rsrc.obj

but my problems continue do I post a new thread or continue in this thread


cheers to rsala as well

Gunther

Hi flipflop 1,

welcome to the forum. Have fun.  :t

Gunther
You have to know the facts before you can distort them.

jj2007

/Zi for the assembler, /debug for the linker. The /zd switch is not needed.

Note this works for ML 6.14 or 6.15 and JWasm. Higher Masm versions may throw fatal error LNK1103: debugging information corrupt.

New thread only if you have a really new theme. Nothing gets lost, most of us have this link bookmarked ;-)

Welcome to the forum :icon14:

TouEnMasm


The binary of the masm32  package need an update to be used with windbg (\masm32\bin).
Replace link.exe and all the mspdb*.dll with a more recent version,c++ express.
Fa is a musical note to play with CL

japheth

Quote from: jj2007 on March 26, 2013, 09:15:23 AM
Note this works for ML 6.14 or 6.15 and JWasm. Higher Masm versions may throw fatal error LNK1103: debugging information corrupt.

I guess that the linker and not Masm is throwing the fatal error.

The reason is simple: Masm v8 and above use a newer codeview format ( v8 instead of v4 ). The problem is: if an old linker is fed with this new debugging format, it may decide to keep silent and not emit any warning - or emit a warning that is misleading. Hence: if you use Masm v8 or newer and want debug info, you must use a MS linker from at least 2005 ( i.e. VC EE 2005 ); Polink is NOT a good replacement if WinDbg is to be used.


jj2007

Quote from: japheth on March 26, 2013, 08:32:24 PM
Quote from: jj2007 on March 26, 2013, 09:15:23 AM
Note this works for ML 6.14 or 6.15 and JWasm. Higher Masm versions may throw fatal error LNK1103: debugging information corrupt.

I guess that the linker and not Masm is throwing the fatal error.

Yes, sloppy wording, sorry. Unfortunately, using higher linker versions entails new problems:
fatal error LNK1101: incorrect MSPDB???.DLL version

The best option to get debug info is imho JWasm plus MS link 6.14. Olly 1.0 shows even local variables, Olly 2.0 only the global ones.

Magnum

You can get those dlls from VB package.

I have them if anyone needs them.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

I have these dlls. The linker complains about incorrect installation.

dedndave

i am able to make all but masm version 11 work under XP (32-bit)
the linkers that come with masm versions 9 and 10 work fine

japheth

Quote from: jj2007 on March 27, 2013, 01:42:38 AM
I have these dlls. The linker complains about incorrect installation.

For VC 2008 link, you'll need these files:

link.exe
mspdb80.dll
mspdbcore..dll
msobj80.dll
mspdbsrv.exe ( !!! )

There's no need for registry entries.

dedndave

i think they should be in the same folder as the linker
and - that folder should be in the PATH
otherwise, you may get the error message

mspdbsrv ?
i didn't need that one, but i didn't test all cases (link errors, etc)
is that for masm version 9 ?