Author Topic: 64 bit debuggers for masm 64  (Read 525 times)

jj2007

  • Member
  • *****
  • Posts: 7541
  • Assembler is fun ;-)
    • MasmBasic
Re: 64 bit debuggers for masm 64
« Reply #15 on: October 02, 2017, 05:20:24 PM »
jj2007:  I am hunting for x64dbg.ini.  Haven't found it yet.

\Masm32\x64Dbg\release\x64\x64dbg.ini

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #16 on: October 03, 2017, 12:07:24 AM »
Hello sinsi,

The link.exe version I'm running doesn't have a /DEBUGTYPE switch.  Has only /DEBUG.  I'm assembling with ml64.exe with /Zi and /Zf options.  When I link I use the command line:  "link.exe /DEBUG /SUBSYSTEM:console /ENTRY:main /OUT:mystart.exe mystart.obj".    Then I get the error message that MSPDB100.DLL is the wrong version.

Mark

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #17 on: October 03, 2017, 12:33:19 AM »
JJ:

Thank you.  Very kind.  I'll let you know what happened.

Mark

aw27

  • Member
  • ****
  • Posts: 697
Re: 64 bit debuggers for masm 64
« Reply #18 on: October 03, 2017, 12:34:43 AM »
Then I get the error message that MSPDB100.DLL is the wrong version.
Each link.exe requires a matched version of MSPDB in the same folder (or in system32).
Were you using the link.exe from VS2017 you would need mspdb140.dll in the same folder.
Sounds complicated?

fearless

  • Member
  • ***
  • Posts: 274
    • LetTheLightIn
Re: 64 bit debuggers for masm 64
« Reply #19 on: October 03, 2017, 12:56:12 AM »
I use the microsoft linker to output pdb files for debugging with x64dbg:

LINK.EXE /SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV /PDB

and also the /Zi /Zd switches when assembling to help with showing other debug info
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI, Samsung 256GB + 1TB SSD, WD Black 2TB x2 + 4TB HDD, Asus 27" LCD

www.LetTheLight.in  My Github

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #20 on: October 03, 2017, 07:13:57 AM »
AW27 and Fearless,

AW27:  I have mspd100.dll and mspd140.dll in the same folder along with link.exe.  Moreover, this folder is reachable via the PATH environmental variable.

Fearless:  Thanks for the info on the assembler\linker switches.  I'll try them forthwith.

Thanks to both of you for helping me with this blasted issue.

Markl

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #21 on: October 03, 2017, 07:22:26 AM »
Hi Fearless,

Would love to report that your link.exe switches solved my problem, but they didn't.  Still getting the cryptic message "incorrect MSPDB100.DLL version; recheck installation of this product".

Regards,
Mark

fearless

  • Member
  • ***
  • Posts: 274
    • LetTheLightIn
Re: 64 bit debuggers for masm 64
« Reply #22 on: October 03, 2017, 09:40:59 AM »
Here is my stuff im using for the linker, from one of the vs studio installations (v12.x in the file manifests):
https://www.dropbox.com/s/wozllpfru8cbttf/vs2012tools.zip?dl=0
probably will require the visual c runtime for 12.x (MSVCR120.dll) installed in your system somewhere
I have all those files in my masm\bin folder
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI, Samsung 256GB + 1TB SSD, WD Black 2TB x2 + 4TB HDD, Asus 27" LCD

www.LetTheLight.in  My Github

aw27

  • Member
  • ****
  • Posts: 697
Re: 64 bit debuggers for masm 64
« Reply #23 on: October 03, 2017, 10:57:33 AM »
OK, make sure they are the same bitness than link.exe

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #24 on: October 04, 2017, 12:34:39 AM »
aw27,

I checked for bitness and came away completely confused by what I saw.  All three of ml64.exe, link.exe, and mspdb100.dll appear to be 32-bit PE files.  I say this because that is what I got from dumpbin /HEADERS and also from looking at the symbol following PE in the binary files using notepad. 

Perhaps you can explain this.  I don't understand how ml64.exe could assemble code which uses 64 bit registers without itself being a 64-bit program. 

Mark

jj2007

  • Member
  • *****
  • Posts: 7541
  • Assembler is fun ;-)
    • MasmBasic
Re: 64 bit debuggers for masm 64
« Reply #25 on: October 04, 2017, 12:45:40 AM »
I don't understand how ml64.exe could assemble code which uses 64 bit registers without itself being a 64-bit program.

The translation of human-readable source code into machine code has nothing to do with the "bitness" of the assembler. You could generate 64-bit machine code with a 16-bit QBasic program.

aw27

  • Member
  • ****
  • Posts: 697
Re: 64 bit debuggers for masm 64
« Reply #26 on: October 04, 2017, 02:24:04 AM »
I checked for bitness and came away completely confused by what I saw.  All three of ml64.exe, link.exe, and mspdb100.dll appear to be 32-bit PE files.  I say this because that is what I got from dumpbin /HEADERS and also from looking at the symbol following PE in the binary files using notepad. 

You are correct. Probably you need to run VCVARS64.BAT (or continue investigating).
If this helps, I can advance that this works for VS 2017, but paths are a bit long:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\ml64" -c -Zp8 /Zd test64.asm
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\link" /SUBSYSTEM:console /ENTRY:Start /DEBUG:FULL test64.obj


aw27

  • Member
  • ****
  • Posts: 697
Re: 64 bit debuggers for masm 64
« Reply #27 on: October 04, 2017, 03:02:14 AM »
Alternatively, if you copy following files from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64
to your \masm32\bin directory it will work as well:
link.exe
msobj140.dll
mspdb140.dll
mspdbcore.dll

For Visual Studio 2010, probably you need to copy some more .DLLs in addition to mspdb100.dll

markallyn

  • Member
  • **
  • Posts: 63
Re: 64 bit debuggers for masm 64
« Reply #28 on: October 04, 2017, 03:48:01 AM »
JJ2007 and aw27,

Thanks for responding. 

JJ:  I understand your point, I believe, but I was surprised that ml64.exe wasn't itself (apparently) a 64 bit program.  I know JWOW is there to handle 32-bit code, but still, it seems surprising.

aw27.  At the moment, I don't have Visual Studio running.  I have tried to install Visual Studio Express, but so far I haven't been successful.

In any case, ml64.exe, link..exe, and mspdb100.dll are all in the same bit format.

I guess I'm going to have to renew my efforts to get VS Xpress working.

Regards,
Mark

aw27

  • Member
  • ****
  • Posts: 697
Re: 64 bit debuggers for masm 64
« Reply #29 on: October 04, 2017, 04:17:49 AM »
aw27.  At the moment, I don't have Visual Studio running.  I have tried to install Visual Studio Express, but so far I haven't been successful.
VS Express editions are crippled, it is better Community Editions which are almost the same as Pro.