Missing debug information for Windows

Hello:

I am facing a critic problem with the compiler, which I hope will have an easy solution. I am using it on Windows and use Visual Studio to debug the applications. The information of which source lines correspond to which machine instructions is right and I can break into the code, execute one instruction at a time, etc. But all the information regarding the variables is missing, so I cannot know the values they store if not by guessing upon the assembly code where is stored each variable and asking VS to show me the value of, say, **(double**)(esp+01Ch).

I have tried both clang and clang-cl, and both -O0 and -O1, and both VS 2010 and VS 2015. I use clang with the -c option (do not link), and then call the VS linker, which is what clang does if the -c option is not used.

The Microsoft compiler generates an intermediate .pdb file when compiling and assemblying, named vc100.pdb (the name is of course irrelevant), and afterwards, when linking, the definite pdb file, foo.pdb for instance. When using clang the intermediate file is not generated. May that be the reason or has it nothing to do with my problem?

Lest's hope you can help me, otherwise I will have to stop using clang just when I was beginning with it.

-- Javier

Hello:

I am facing a critic problem with the compiler, which I hope will have an
easy solution. I am using it on Windows and use Visual Studio to debug the
applications. The information of which source lines correspond to which
machine instructions is right and I can break into the code, execute one
instruction at a time, etc. But all the information regarding the variables
is missing, so I cannot know the values they store if not by guessing upon
the assembly code where is stored each variable and asking VS to show me
the value of, say, **(double**)(esp+01Ch).

I have tried both clang and clang-cl, and both -O0 and -O1, and both VS
2010 and VS 2015. I use clang with the -c option (do not link), and then
call the VS linker, which is what clang does if the -c option is not used.

The Microsoft compiler generates an intermediate .pdb file when compiling
and assemblying, named vc100.pdb (the name is of course irrelevant), and
afterwards, when linking, the definite pdb file, foo.pdb for instance. When
using clang the intermediate file is not generated. May that be the reason
or has it nothing to do with my problem?

That's the reason, but there is no easy solution - Clang does not generate
PDB files at the moment. The debug story on windows is still uncertain and
a fair way out - it may entail integrating something like LLDB into MSVC to
use the existing DWARF debug info Clang can produce.

For now you could use LLDB directly on windows, though I think support
there is still work-in-progress too.

Sorry,

- David

Thank you for your information. It seems there are still many open issues for me to be able to use Clang on a daily basis on Windows.

I suspect there aren't many Clang users targeting the Visual Sutio libraries. You cannot currently successfully compile a project in Clang if you include tgmaht.h, not even with VS2015 (because of a pitfall in VS, no in Clang) and my propossed patch to that file sent to cfe-commits dind't raise any reply. I don't care about it since it is easy to work around. I'm just pointing out that I seem to have no "collegues" around there, working like me, trying to use C11, VS and Clang.

Regards,

Javier A. Múgica

I'm just pointing out that I seem to
have no "collegues" around there,
working like me

not 100% true :slight_smile:

my pros:
-found serveral small bugs with cl-clang diagnostics
-helped porting Windows sources to Linux
-nearly out of the box compilation

my cons:
-no proper VS-Debug support
-not-working exceptions
-partialy compilation problems with throw/catch using code
-compilation speed is slower then cl - even with disabled multi-thread compile and /MP
-sometimes headers are not found

beside my cons im very suprised about the quality of cl-clang working and results