How to update Win32 C + MASM "solution" from Visual Studio 2015 to VS 2017/2019

Description: VS2015 solution with mixed C and Assembler does not display characters in assembler code when debugging after upgrading to VS2017 or VS2019). [October 2109: issue resolved, see note at end].

Long Details:

I have VS 2015 xxx.sln with 32-bit C code compiled by VS 2015 compiler, with big 32-bit assembler code parlanse0.asm compiled using the user command line:

Property pages parlanse0.asm

Item Type:   Custom Build Tool

Command Line: ml /D SANITYCHECKS="1" /D EVENTBUFFERENABLE="1" /D TESTING="1" /D PROFILE="0"  /Sg /Sl132 /Sx /Zd /Zi /c /Cx /coff /Zd /Fl "%(FullPath)"
Outputs: parlanse0.obj;%(Outputs)
Additional Dependencies:  <list of MASM include file>
Link Objects:  Yes
Treat Output As Content: No

I'm not sure if this is relevant, but here are the linker options:

/OUT:"Debug\run.exe" /MANIFEST /PROFILE /NXCOMPAT:NO /PDB:"Debug/erun.pdb" /DYNAMICBASE:NO "odbc32.lib" "odbccp32.lib" "netapi32.lib" "iphlpapi.lib" "psapi.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" /LARGEADDRESSAWARE /MACHINE:X86 /SAFESEH:NO /INCREMENTAL:NO /PGD:".\Debug\run.pgd" /SUBSYSTEM:CONSOLE",5.01" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:".\Debug\run.exe.intermediate.manifest" /MAP":.\Debug/run.map" /ORDER:@"RTSCFunctionOrder.txt" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Program Files\Microsoft Platform SDK\Lib" /DELAYLOAD:"iphlpapi.dll" /DELAYLOAD:"comdlg32.dll" /TLBID:1 

[If this is the linker command line, where does it get the names of the .obj files that it processes?]

This solution compiles / builds / works fine under VS 2015.

VS 2017 (: 2019 ., , VS 2019... ).

: VS 2017 VS 2015. , , ( MS, .sln, ). , : // .

, , " ", . " Goto" VS 2015. , " ", " ... , ", . , VS 2015.

? - , - ?

[: , .C. , .sbr , .sbr C. .sbr ; .sbr C, . . , , .sbr VisualStudio, , , . ? ?]

[: , , /DEBUG /DEBUG: FULL, .]

[ PDB , C++ "" , .cpp(.c?). MASM PDB? ... MASM PDB ?]

... 2- ...

:

00480107 CC                   int         3  
00480108 CC                   int         3  
RTSAllocate11D_end:
00480109 8D A4 24 00 00 00 00 lea         esp,[esp]  
00480110 8D A4 24 00 00 00 00 lea         esp,[esp]  
00480117 8D A4 24 00 00 00 00 lea         esp,[esp]  
0048011E 8D A4 24 00 00 00 00 lea         esp,[esp]  
00480125 8D A4 24 00 00 00 00 lea         esp,[esp]  
0048012C 8D A4 24 00 00 00 00 lea         esp,[esp]  
00480133 8D A4 24 00 00 00 00 lea         esp,[esp]  
0048013A 8D 9B 00 00 00 00    lea         ebx,[ebx]  
allocate_2to1E_bytes:

, . , ... . , , , . ?

: 9 2019 : . Microsoft , . , VS 2015 Update 1 , ; VS 2015, 2 , VS 2017 VS 2019 . MS , , VS 2019 v16.4 Public Release 2019 .

+4
2

( pdb) 2 :

  • obj ml [64] /Zd
  • linker /DEBUG . ( .debug$S obj/lib) pdb

, ( ), :

  • .obj / - asm asource . PARLANSE0.ASM ( ) ( , ansi) - ? - ( , )
  • pdb - ?
  • exe - .pdb - ( ) pdb exe ? ansi
  • - windbg - . build - , asm- ( - asm ) exe. "" - - pdb asm

windbg asm - vs2017. windbg - pdb

+2

P.asm parlanse0.asm /Fo parlanse0.obj script.

parlanse0.obj (parlanse0.iobj, parlanse0.ipdb) . - , .

+1

Source: https://habr.com/ru/post/1680838/


All Articles