News:

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

Question on .pdb file

Started by PeterRod, September 17, 2008, 03:23:58 PM

Previous topic - Next topic

PeterRod


I am using the following makeit.bat file which is similar to the makeit template in the MASM32 console tutorial.

I include /Zi in the assembler command line
and /PDP: in the linker line.
I dont get a .pdb file and I dont get source display in Olly.

What am I doing wrong?


@echo off

    if exist "myApp.obj" del "myApp.obj"
    if exist "myApp.exe" del "myApp.exe"

    \masm32\bin\ml /c /coff /Zi /FlmyApp.lst "myApp.asm"
    if errorlevel 1 goto errasm

    \masm32\bin\PoLink /SUBSYSTEM:CONSOLE /MAP:myApp.map /PDB:myApp.pdb  "myApp.obj"
    if errorlevel 1 goto errlink
    dir "myApp.*"
    goto TheEnd

  :errlink
    echo _
    echo Link error
    goto TheEnd

  :errasm
    echo _
    echo Assembly Error
    goto TheEnd
   
  :TheEnd

pause

lingo

Just add /DEBUG  option  :wink


PeterRod

Thanks for the reply.
Even with /DEBUG I still dont get the .pdb file.

I was able to get the .pdb file when I changed the linker from PoLink to Link.
What is PoLink? its in the MASM32\bin folder.

seems strange to use it in a tutorial if it is not fully functional.

BTW I am having issues using the Str$, add$ etc macros.
Is there any reading material you can suggest on the correct usage of the string macros.
Is there a PadRight or PadLeft string macro. I could not find any.

Thanks anyway
Peter

hutch--

Peter,

Just run PoLink from the command line to get its options, its Pelle's linker and an excellent tool.

The reference for the string macros are in the HLHELP.CHM file set up on the QE menu. You can also refer to the masm32 library that provides most of these functions. There is no paddleft or right string functions but you can either append what you like on the end and use left$() or right$() or alternatively write a simple algo that will do what you need.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

lingo

"I was able to get the .pdb file when I changed the linker from PoLink to Link.
What is PoLink?"


PDF file is Microsoft term and  it is not serious to expect other linkers ( like PoLink)  to know about and manage it better than MS link.exe...
"A program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program."
http://msdn.microsoft.com/en-us/library/yd4f8bd1.aspx

As Hutch stated above if you "run PoLink from the command line to get its options" you can't see the option /PDB...  :wink



P1

Here is my batch file for MS link.  Works with non 8.3 Dos file names.

I debug in MS C++, I got with a game programming book of mine.  Shows source and works well for tracing.

Regards,  P1   :8)

Line for menus.ini
Build All &Debug,\MASM32\BIN\BldallD.bat {b}


Here is my BLDALLD.BAT file that works.
@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 "%1.obj" del "%1.obj"
if exist "%1.exe" del "%1.exe"

\masm32\bin\ml /c /coff /Fl"%1.lst" /FR"%1.pdb" /Sa /Zd /Zf /Zi  "%1.asm" > "%1.txt"
if errorlevel 1 goto errasm

if not exist rsrc.obj goto nores

\masm32\bin\Link /SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV /PDB:"%1" "%1.obj" rsrc.obj
if errorlevel 1 goto errlink

dir "%1.*"
goto TheEnd

:nores
\masm32\bin\Link /SUBSYSTEM:WINDOWS /DEBUG /OPT:REF /DEBUGTYPE:CV /PDB:"%1" "%1.obj"
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd

:errlink
echo _
echo Link error
goto TheEnd

:errasm
echo _
echo Assembly Error
goto TheEnd

:TheEnd

pause

PeterRod

Thanks for all the help guys.
For the moment, I will stay with the Microsoft Link.exe. At least I now know that Pelle's linker exists and that its a good product.

Hutch thanks for the pointer on strings. Didn't look in that section of the Help.

P1 I will certainly try your .bat file
Thanks again