New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDB single-step problem inline __asm Windows WinDbg #91861
Comments
Demo files - code plus binaries: |
Sorry, I forgot (Win11 23H2 22635.3570): C:\> clang --version
clang version 18.1.4
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
C:\> |
@llvm/issue-subscribers-debuginfo Author: Markus M. Egger (prof79)
Hi there, I'm following exercises by https://patterndiagnostics.com which use inline assembly (`__asm`) in their book. They use VC++ but I tried `clang` as this was much easier compared to all the `vcvarsall` intricacies in build scripts and gave a quick win.
Stepping through the code in
Expected behavior:
What actually happens:
This doesn't happen with the I figured that the compiled EXE is actually fine, you can debug it without symbols and tracing will work as expected. As a result, something must be wrong with the PDB generated by I'll try to put a ZIP with the files somewhere. Compilation line: |
@zmodem perhaps you can get this to some interested folks |
@amykhuang @ZequanWu could you take a look? It sounds like there's something wrong with line info for inline asm perhaps. |
Hi there, I'm following exercises by https://patterndiagnostics.com which use inline assembly (
__asm
) in their book. They use VC++ but I triedclang
as this was much easier compared to all thevcvarsall
intricacies in build scripts and gave a quick win.Stepping through the code in
WinDbg
I encountered misbehavior and it took me like a day to figure it out doubting flags, assembler syntax and my skills as a beginner and what not. I also had a stupid bug (erroneous line) first which didn't make things easier.WinDbg
(launch executable, maybe.reload /f
).lea
instruction (bp main+0x12
).t
)Expected behavior:
mov dword ptr [eax], 1
)What actually happens:
xor eax, eax
(which is already in the prologue ofclang
-generated code (which ismain+0x36
)This doesn't happen with the
cl
tooling fromVisual Studio 2022
.I figured that the compiled EXE is actually fine, you can debug it without symbols and tracing will work as expected.
As a result, something must be wrong with the PDB generated by
clang
vs. whatcl
does as it causes wrong code steps.I'll try to put a ZIP with the files somewhere.
Compilation line:
clang -g -gcodeview -fasm-blocks --target=i386-windows-msvc -o PointersProjectCL86.exe PointersProject.cpp
The text was updated successfully, but these errors were encountered: