[cfe-dev] Debugging Clang with Visual Studio

Shachaf Co via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 14 09:04:00 PDT 2020


It seems right - the VS debugger doesn't attach to the new process created
by the original one.

Invoking `clang -cc1` directly works, and is good enough for my purpose.

Thank you very much!
Shachaf

בתאריך יום ג׳, 14 ביולי 2020, 18:43, מאת Michael Kruse ‏<llvm at meinersbur.de
>:

> This would be an issue of the Visual Studio debugger, not of the
> program you are debugging.
>
> Like this is because when you launch clang, you are launching just the
> driver which invokes itself as `clang -cc1` (although under some
> conditions it invokes itself directly). Visual Studio does not debug
> processes the
>
> To see what happens, I suggest to start debugging using "step into"
> (or set a breakpoint in main of driver.cpp) and continue from there.
>
> Michael
>
>
> Am Di., 14. Juli 2020 um 02:00 Uhr schrieb Shachaf Co via cfe-dev
> <cfe-dev at lists.llvm.org>:
> >
> > Hi all,
> >
> > I Built Clang from source using Visual Studio in debug mode, and I'm
> trying to debug it.
> > However, the debugger doesn't break on any breakpoint that I put.
> > When I put breakpoints directly using __debugbreak(), clang just crashes
> with the even though the debugger is attached.
> >
> > (I'm sure that this code flow actually happens, as I added some
> llvm::errs to prove it)
> >
> > The original Cmake command was:
> > cmake.exe -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=X86
> -DLLVM_ENABLE_IDE=ON -G "Visual Studio 15 2017" -A x64 -Thost=x64
> <path_to_llvm>
> >
> > Am I doing something wrong?
> > Is there some other step that I'm missing?
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200714/ac3b262a/attachment.html>


More information about the cfe-dev mailing list