c[ode]clap » Forums » Expected Date for Windows DWARF Support
SaraPanda
Sara
12 posts
#17262 Expected Date for Windows DWARF Support
7 months, 4 weeks ago Edited by Sara on Jan. 27, 2019, 5:10 a.m.

Strange. I downloaded msys2 and performed:
1
pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-lld
and compiled with your invocation and still doesn't work.
spx
105 posts / 1 project
#17263 Expected Date for Windows DWARF Support
7 months, 3 weeks ago

SaraPanda
Strange. I downloaded msys2 and performed:
1
pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-lld
and compiled with your invocation and still doesn't work.


Same here (and the problem with the exe seems to be identical). I may have to do some further investigation in the future.
SaraPanda
Sara
12 posts
#17370 Expected Date for Windows DWARF Support
7 months, 2 weeks ago

I have found that linking against mingw import libraries from a normal mingw installation is a new feature, first present in lld 8.

Unless wanting to compile a pre-release version of lld, have to wait for binary release of llvm 8.0.0. This will hopefully be sometime in March.
spx
105 posts / 1 project
#20731 Expected Date for Windows DWARF Support
6 months, 1 week ago Edited by spx on March 14, 2019, 10:11 a.m.

I case you are not keeping up with the blog posts about new versions, here is good news. The newest version supports DWARF on Windows (earlier than planned). I didn't personally use it much but compiled all tests with DWARF on gcc and clang and everything seems to work. clang has a problem with outputting debug information for some C++ classes like std::string which seems to just be an empty struct so inspecting those values is not possible (gdb isn't able to show anything for those variables as well).
SaraPanda
Sara
12 posts
#21020 Expected Date for Windows DWARF Support
4 months, 2 weeks ago

I downloaded codeclap 0.8.43.
Working with familiar file:
1
2
3
4
5
6
7
8
#include <stdio.h>

int
main(int argc, char* argv[argc + 1])
{
  puts("oh my dwarf");
  return 0;
}

Compiled with dwarf:
1
clang.exe --target=x86_64-pc-windows-gnu -fuse-ld=lld.exe -g file.c -o file.exe

Don't get source:

Compiled with pdb:
1
clang.exe --target=x86_64-pc-windows-gnu -fuse-ld=lld.exe -g -gcodeview -Wl,-pdb,file2.pdb file.c -o file2.exe

Do get source:


I have dragged executables into codeclap to start session. Did you do something different?
Also, is it possible to show all the source, i.e. the return statement and closing bracket?
Thanks.
spx
105 posts / 1 project
#21031 Expected Date for Windows DWARF Support
4 months, 2 weeks ago

Seems like you did everything right but I indeed did something different. The "LLVM for Windows" binary release with x86_64-pc-windows-gnu wasn't tested yet since this was the one broken until the 8.0 release. I just checked this and seems that the source mapping isn't working properly with that one and I will look into this.

Included in my tests up to now was:
gcc and clang from mingw64/msys2 with DWARF
g++ and clang++ from mingw64/msys2 with DWARF
clang for Windows binary release with x86_64-pc-windows-msvc and PDB

Will add x86_64-pc-windows-gnu targets to that.

The "missing last source line" is a commonly encountered issue, it seems mostly on Windows and possibly with msvc and clang. I don't know the exact reason for this yet but it is planned to be fixed in the next update.
SaraPanda
Sara
12 posts
#21036 Expected Date for Windows DWARF Support
4 months, 1 week ago

Thank you for clearing that up. Keep up the good work.