The MASM Forum

Projects => Rarely Used Projects => Archival JWASM postings => Topic started by: TouEnMasm on August 15, 2015, 08:26:09 PM

Title: Jwasm 13 debugging source mode in 64 bits
Post by: TouEnMasm on August 15, 2015, 08:26:09 PM
Hello,
I used those options

Quote
jwasm /c /win64 /Zi /Zd /nologo /Zp8
LINK /NOLOGO /DEBUG:FASTLINK /debugtype:cv
And i try to debug in source mode,following the source lines.
Visual studio say me there is missed informations,What happen ?.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on August 16, 2015, 06:08:07 AM
I am aware that JWasm has a problem with debugging but it works if you use small source file like this:

  option casemap : none
option win64 : 11
option frame : auto
option STACKBASE : RSP
.code
     
main PROC  FRAME
  vaddpd zmm30,zmm29,[rdx+400h]{1to8}
  vaddpd zmm21{z}{k3}, zmm23, zmm31
  vaddpd zmm21{k1}{z}, zmm23, zmm31
  vaddpd zmm21{k1}, zmm23, zmm31
  vaddpd zmm21{z}, zmm23, zmm31
ret 
main ENDP

END main

I use this for the compiler:
/OUT:"C:\JWasm.exe" /MANIFEST /NXCOMPAT /PDB:"C:\Users\Brane\Desktop\JWasm\x64\Debug\JWasm.pdb"
/DYNAMICBASE /FIXED:NO /DEBUG /MACHINE:X64/INCREMENTAL:NO /PGD:"C:\JWasm\x64\Debug\JWasm.pgd"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Debug\JWasm.exe.intermediate.manifest"
/ERRORREPORT:PROMPT /NOLOGO /ASSEMBLYDEBUG /TLBID:1


and this for the linker:
/OUT:"C:\Users\Brane\Desktop\HJWasm\x64\Debug\HJWasm.exe" /MANIFEST /NXCOMPAT /PDB:"C:JWasm\x64\Debug\JWasm.pdb"
/DYNAMICBASE /FIXED:NO /DEBUG /MACHINE:X64 /INCREMENTAL:NO /PGD:"C:\Users\Brane\Desktop\HJWasm\x64\Debug\HJWasm.pgd"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/ManifestFile:"x64\Debug\HJWasm.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /ASSEMBLYDEBUG /TLBID:1
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: TouEnMasm on May 07, 2016, 08:43:05 PM
I have downloaded  the last version,but no more progress.
Is there no hope for debugging in source mode in 64 bits ?.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: fearless on May 07, 2016, 09:34:49 PM
Seems to work fine with RadASM v2.x and x64dbg

(http://s32.postimg.org/y4na5xda9/x64dbgjwasm.jpg) (http://postimg.org/image/y4na5xda9/)

(http://s32.postimg.org/3wibq5pxd/jwasmsrcdebugging.jpg) (http://postimg.org/image/3wibq5pxd/)
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: TouEnMasm on May 08, 2016, 01:36:32 AM
With windbg,i have only jwasm who can debug in source mode for 32 bits.
I have also a problem with align 16,don't work.

Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 08, 2016, 08:22:34 AM
Hi ToutEnMasm, I am aware of that and I am investigating the cause of that,
however, it is very hard to find where is the actual problem because it works fine in 64 bit
It will take some time to fix it.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 08, 2016, 09:04:15 PM
Actually, the last version of HJWasm32.exe from Terraspace can debug on source level.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: TouEnMasm on May 08, 2016, 11:41:13 PM
Win 10 don't seem to agree with that,but there is other things who don't work as expected with win 10.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 08, 2016, 11:57:09 PM
I have Windows 8.1,
I installed Windows 10 and I realized it was a bad decision, so I reverted to Windows 8.1 while I still could
Sooner or later I will have to accept Windows 10, most probably when I get forced to upgrade my laptop.
For now I don't have possibility to experiment with Windows 10 simply because I don't have access to it.
You are left with two choices:
1) wait until I upgrade to Windows 10
2) try to figure it out yourself
People have a saying: "If you want a job done properly do it yourself"
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: nidud on May 09, 2016, 12:00:38 AM
deleted
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 06:23:25 AM
Hi nidud,
Your build is fine if you are assembling 32 bit source, but has general failure if you try to assemble 64 bit.
To be acurate:
    vgatherdpd zmm15{k1}, [r14+ymm13*8+7bh]    ;works
    but:
    vgatherdpd zmm15{k1}, [r14+ymm31*8+7bh]   ;general failure
   
    and:
    real8  2.22e-308 ;rejected by ml + jwasm ( since v2.11 )
    error A2076: Initializer magnitude too large for specified size

I think that 32 bit HJWasm should be still able to assemble 64 bit without general failure.
I am not ungrateful and I appreciate you from the start of your ASMC, I just want to make HJWasm work fine in both x68 and x64.
I have build one x68 version with the Code:Blocks and would like you and other people to test if it can assemble both
 
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: HSE on May 09, 2016, 07:11:41 AM
habran:
in your compilation echo is not working (any message to console)



          I forget to say: win 7 -32
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: jj2007 on May 09, 2016, 08:06:51 AM
Slow but messages to console are working:
*** Assemble using HJWasm /c /coff  /Fl /Sn /Fo "MasmBasic" ***
HJWasm v2.14, May  9 2016, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

*** using MasmBasic version 06.05.2016 ***
Tmp_File.asm: 761 lines, 4 passes, 796 ms, 0 warnings, 0 errors
*** Link using link with sub Console    "MasmBasic.obj" /OUT:TestMasmBasic.exe - no resources ***

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

*** Assembling and linking took 8237 milliseconds ***


AsmC does it in 2 seconds. There seems to be a considerable overhead:

\Masm32\MasmBasic\libtmpAA.asm: 15065 lines, 2 passes, 312 ms, 0 warnings, 0 errors
\Masm32\MasmBasic\libtmpAD.asm: 94 lines, 2 passes, 219 ms, 0 warnings, 0 errors
\Masm32\MasmBasic\libtmpAE.asm: 36 lines, 2 passes, 234 ms, 0 warnings, 0 errors
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 08:14:32 AM
Hi HSE,
It is built with GNU GCC compiler with Code:Blocks
I am curious if you run it on 32 bit machine.
If it works fine on 32 bit computers I can see if I can tweak Code:Blocks to force the echo.

Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 08:19:59 AM
Hi jj2007, thanks for testing :biggrin:
However, AFAIK, you have 64 bit computer.
If you have a 32 bit machine try to run it there please
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 08:25:11 AM
I think we should actually create 3 kind of HJWasm:
1) HJWasm32.exe              ;for 32 bit computers
2) HJWasmx86.exe            ;for 64 bit computers
3) HJWasmx64                  ;for 64 bit computers
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: nidud on May 09, 2016, 08:49:16 AM
deleted
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 08:53:41 AM
Hi nidud,
I know that you had to tweak HJWasm source to be able to build it with VC v6.0
Can you please upload that project to your The Doszip Commander page so that I can download that project.
I would like to keep it separated from x64 project on Terraspae and when I make change to HJWasm I would be able to do the same to that project as well. It will be there available to you so that you can build binaries for 32 bit folks.
I think that Johnsa will be glad to include you as well on Terraspae as a developer of HJWasm 
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: nidud on May 09, 2016, 09:20:30 AM
deleted
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 09:27:12 AM
That is good :t
So you will need to build for 32 bit computers because I don't have that VC v6.0
We will include your binaries to Terraspace if you agree with it.
I will see if I can find a better solution for :
      if ((opnd->type != 0x7b)&&(opnd->type != NULL)){ //this is temporary fix for VGATHER instructions in DEBUG mode

Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 09:29:05 AM
nidud, what about the version I posted, did you try it?
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: HSE on May 09, 2016, 09:39:27 AM
Yes, 32 bit machine. No evident problem (except no messages).

I post my modified compilation for ObjAsm32 in http://masm32.com/board/index.php?topic=5244.msg57297#msg57297
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 09:43:46 AM
Thanks HSE  :t
I will see if I can fix that
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: nidud on May 09, 2016, 09:44:46 AM
deleted
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 10:02:15 AM
I don't have VC 6.0
I have installed WATCOM on my machine, I will try to build with it.
For now here is one build with speed option build with C:B:
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 10:25:23 AM
OK, line : if ((opnd->type != 0x7b)&&(opnd->type != NULL)){ //this is temporary fix for VGATHER instructions in DEBUG mode
can be replaced wit
  if ( opnd->type != NULL ){

and it works fine :biggrin:
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: nidud on May 09, 2016, 10:29:15 AM
deleted
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: nidud on May 09, 2016, 10:41:20 AM
deleted
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: nidud on May 09, 2016, 10:50:40 AM
deleted
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 12:38:03 PM
OK, thanks nidud, it will be fixed in next release :t
and thanks for the batch for Open Watcom, I will try to build it now.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 01:23:56 PM
I succeeded to build 32 bit with OpenWatcom.
I used again Code:Blocks but chose  OpenWatcom 32 compiler
As far as I tested it works fine in both 32 and 64 bit
The only problem in 64 is it rejects: real8  2.22e-308 ;rejected by ml + jwasm ( since v2.11 )
I could have changed it in watcom headers but I don't want to do that because for x64 build we will still use MSVS
I really have to mention that the Code:Blocks is an excellent tool :t
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: TWell on May 09, 2016, 04:35:01 PM
Here is hjwasm.exe build with MSVC 2013 and WinDDK 7600 headers and libraries, -subsystem:console,5.1
Should run in WindowsXP too.
Can we have here some test files for testing?
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: TouEnMasm on May 09, 2016, 05:40:05 PM
:biggrin:

The Hjwasm32 posted by Habran and compiled with openWatcom mark one point on 32 bits.
Under Windows 10 he allow to debug 32 bit sources codes in source mode with windbg.
He couldn't do the same thing for 64 bits sources.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 07:28:03 PM
Hi ToutEnMasm,
Nice to see a smile ones on your face :biggrin:

Quote from: ToutEnMasm on May 09, 2016, 05:40:05 PM
He couldn't do the same thing for 64 bits sources.
Please explain ;)
Hi TWell, here is attached one 32 bit example 8)
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: TWell on May 09, 2016, 08:02:26 PM
after chancing in example source rcx to ecx in lines 124 and 125 and comment out invoke subproc1
i was able debug with source with WinDbg 6.1 and Visual Studio in Windows 10.
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 08:05:35 PM
Sorry I borrowed some example from x64
I uploaded fixed version.
But good thing is that it works fine :t
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: habran on May 09, 2016, 09:14:07 PM
TWell, I tested your HJWasm build and it works fine on my laptop, however, it is 64 bit machine,we need to test 32 bit
Title: Re: Jwasm 13 debugging source mode in 64 bits
Post by: HSE on May 09, 2016, 10:01:12 PM
Perfect now  :t