RadASM2 icon indicating copy to clipboard operation
RadASM2 copied to clipboard

RadASM creates $.pdb in debug mode

Open blue-devil opened this issue 3 years ago • 3 comments

Problem

While using UASM64.ini(or MASM64.ini), and if we want to compile our sources as debug, RadASM creates appname.exe and $.pdb

Expectation

When compiling as debug we want RadASM to create appname.exe and appname.pdb

Details

In RadASM.chm, RadASM > Customizing RadASM > Assembler.ini section states that:

Special characters
' $ ' Gets the filename from topmost editor window without extension

So when we write e.g. /PDB:$.pdb, we expect RadASM to create appname.pdb, but it creates $.pdb I have tried this on on:

  • masm
  • masm64
  • UASM64

But unfortunately if someone uses a single $ sign, RadASM interprets it as a single dollar sign. If someone uses dollar sign with a number stated under [MakeFiles], there is no problem; then RadASM interprets $ sign as appname.

Temporary workaround

Only for debug version we don't need to use linker parameter /PDB. Without this parameter link.exe already creates appname.pdb

blue-devil avatar Sep 24 '22 17:09 blue-devil

Temporary Workaround 2

We can add xx=.pdb under [MakeFiles] section in Assembler.ini

blue-devil avatar Sep 24 '22 18:09 blue-devil

Yes, I use the makefiles section. Most of my templates that I use add the following:

17=AppName.dp32
18=AppName.pdb
19=AppName.dp64

then i can reference them in the asm or link section:

LINK.EXE /SUBSYSTEM:CONSOLE /DEBUG /DEBUGTYPE:CV /PDB:"$18" /VERSION:4.0 /LIBPATH:"$L" /OUT:"$5",3,4

the dp32 and dp64 are for creating x64dbg plugins (that are essentially dll files names .dp32 or dp64)

So yes modifying templates to use the makefiles section and adding a ref to a .pdb is what i do as well. Another example I use this in is the DialogAsMain.tpl template:

[MakeFiles]
18=DialogAsMain.pdb

Then when an app is made with that template, the app inherits the 18=appname.pdb and the link settings refer to a "$18" by default then

mrfearless avatar Sep 24 '22 18:09 mrfearless

Exactly!

But in UASM64.ini there are these lines https://github.com/mrfearless/UASM-with-RadASM/blob/726fd843709081babeaed37adc5b205216b4fb3f/UASM64.ini#L253

Maybe you want to review them.

blue-devil avatar Sep 24 '22 19:09 blue-devil