Author Topic: How to disable debugging information?  (Read 890 times)

Mikl__

  • Member
  • ****
  • Posts: 554
How to disable debugging information?
« on: April 04, 2017, 11:43:00 AM »
Hi!
I installed Visual Studio 14
There are ml64.exe and link.exe version 14.00.24210.0 in folder VC\bin\amd64.
I created simple "Hello, world!"
Code: [Select]
; GUI #
include win64a.inc
.code
MsgBoxText      db "Win64 Assembly is Great!",0
MsgCaption      db "Win64 Iczelion's lesson #2: MessageBox",0
WinMain proc
push rbp
mov edx,offset MsgBoxText
lea r8,[rdx+sizeof MsgBoxText]
invoke MessageBox,NULL,,,MB_OK
pop rbp
ret
WinMain endp
end
with bat-file
Code: [Select]
cls
set masm64_path=\masm64\
set filename=%~n1
call :read_settings %filename%
@echo %kind_of_file%
goto %kind_of_file%
:GUI
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%\bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed %filename%.obj %filename%.res >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed %filename%.obj >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
:: del errors.txt
exit
:DLL
if exist %filename%.dll del %filename%.dll
%masm64_path%bin\ml64 /c /Cp /I %masm64_path%include %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r  %filename%.rc >> errors.txt
if errorlevel 1 exit
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj %filename%.res /DEF:%filename%.def >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj /DEF:%filename%.def >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
del %filename%.exp
del errors.txt
exit
:read_settings
for /f "eol=# tokens=2-3" %%A in (%filename%.asm) do (
set kind_of_file=%%A
if %%B == # exit /b )
exit /b
exe-file has size 880 bytes
ml64.exe version 11.00.50727.1 and link.exe version 10.00.30319.01 made exe-file with size 640 bytes without debug information.
How to disable debugging information?

If used ml64.exe version 14.00.24210.0 and link.exe version 10.00.30319.01 made exe-file with size 640 bytes

jj2007

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: How to disable debugging information?
« Reply #1 on: April 04, 2017, 05:13:55 PM »
I installed Visual Studio 14

Call a doctor, quickly :shock:

Mikl__

  • Member
  • ****
  • Posts: 554
Re: How to disable debugging information?
« Reply #2 on: April 04, 2017, 05:31:31 PM »
Ciao, jj2007!
Assembler is funny, but not to such an extent, I wanted to get a newer version of the compiler

jj2007

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: How to disable debugging information?
« Reply #3 on: April 04, 2017, 05:39:52 PM »
Note that the latest ML64 versions are very buggy:

ml.exe scrambles output: https://connect.microsoft.com/VisualStudio/feedback/details/1263794/ml-exe-scrambles-output-and-exists-with-exit-code-1-when-giving-full-path-to-source-file

Posted by Microsoft on 20/04/2015*):
Thank you for your feedback, we are currently reviewing the issue

see also
http://masm32.com/board/index.php?topic=5678.msg60531#msg60531
http://masm32.com/board/index.php?topic=5662.msg60775#msg60775

*) M$ takes a bit longer than the HJWasm team :P

TWell

  • Member
  • ****
  • Posts: 748
Re: How to disable debugging information?
« Reply #4 on: April 04, 2017, 07:19:21 PM »
The missing option was: /nocoffgrpinfo

It took over 4 years to fix it :P
Version 14.10.25017.0

and it is difficult to them to release a small fix pack for it, all that s.. and useless c.. must come with along :(
« Last Edit: April 04, 2017, 09:24:18 PM by TWell »

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4922
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How to disable debugging information?
« Reply #5 on: April 04, 2017, 08:08:43 PM »
I chose the smaller of the two versions in VS2017 and it has not been a problem at all. The larger version had a 5 second delay in build so I gave up on it. Looks like the ML64 maintenance team left some testing/debug code in it and rendered it close to useless. The smaller version has not problems with XMM and YMM registers and the instructions I have tested so far. Seems like the Watcom versions are not the only ones in development.  :P
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

Mikl__

  • Member
  • ****
  • Posts: 554
Re: How to disable debugging information?
« Reply #6 on: April 05, 2017, 10:45:48 AM »
TWell,
many thanks for the help and for the link which you gived in the letter!
ml64.exe and link.exe version 14.00.24210.0 made exe-file with size 640 bytes