Where can i look lldb status for native debug at Windows?
Hi, I guess I should make a new blog post at some point, or post status on the website. Here’s my best estimate at what you can expect.
- Most common debugging scenarios should work. Run under debugger, attach to process, interrupt, continue, print variable values, evaluate expressions, etc.
- Step-over might be unstable in certain scenarios
- Conditional breakpoints don’t work
- Hardware watchpoints don’t work
- Expression evaluation might not work in some advanced cases.
The main big feature that has been added since the original blog post is support for windows minidump files. So you can create a minidump of a stopped process from inside LLDB, and you can load up a minidump and do post-mortem debugging.
Feel free to file bugs or post your feedback here after you use about what worked, what didn’t work, what’s missing, etc. Anything that doesn’t work is a bug that I would like to fix.
Nice to hear. I should answer after some time of using
Look like I miss something , but i cant debug simple program program compiled with clang from trunk (258016), msvc 2015 stdlib, from vs2015 x86 developer console .
i use lldb from trunk
#include “stdio.h”
int main(int argc, char **argv)
{
printf(“hello1\n”);
printf(“hello2\n”);
return 0;
}
d:\code\tests\test2>lldb a.exe
(lldb) target create “a.exe”
Current executable set to ‘a.exe’ (i686).
(lldb) run
Process 6264 launching
When you compile, you need to use -fuse-ld=lld. Most people miss this step.
That said, it’s not supposed to hang, but it is supposed to not work.
What’s the command line you used with clang?
yes, i miss it. but anyway dont work
d:\code\Unity_Unpacker\tests\test2>clang -v -fuse-ld=lld main.cpp
clang version 3.9.0 (trunk 258509)
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: d:\code\llvm\build\bin
“d:\code\llvm\build\bin\clang.exe” -cc1 -triple i686-pc-windows-msvc18.0.0
-emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-ll
vm-verifier -main-file-name main.cpp -mrelocation-model static -mthread-model po
six -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-c
pu pentium4 -v -dwarf-column-info -debugger-tuning=gdb -resource-dir “d:\code\
llvm\build\bin\…\lib\clang\3.9.0” -internal-isystem “d:\code\llvm\buil
d\bin\…\lib\clang\3.9.0\include” -internal-isystem “C:\Program Files (x8
6)\Microsoft Visual Studio 14.0\VC\INCLUDE” -internal-isystem “C:\Program Fi
les (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE” -internal-isystem
“C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt” -intern
al-isystem “C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um”
-internal-isystem “C:\Program Files (x86)\Windows Kits\8.1\include\\share
d” -internal-isystem “C:\Program Files (x86)\Windows Kits\8.1\include\\um”
-internal-isystem "C:\Program Files (x86)\Windows Kits\8.1\include\\winrt
" -fdeprecated-macro -fdebug-compilation-dir “d:\code\Unity_Unpacker\tests\t
est2” -ferror-limit 19 -fmessage-length 80 -fms-extensions -fms-compatibility -f
ms-compatibility-version=18 -std=c++11 -fno-threadsafe-statics -fdelayed-templat
e-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o “C
:\Users\Red\AppData\Local\Temp\main-71fc84.o” -x c++ main.cpp
clang -cc1 version 3.9.0 based upon LLVM 3.9.0svn default target i686-pc-windows
-msvc
#include “…” search starts here:
#include <…> search starts here:
d:\code\llvm\build\bin..\lib\clang\3.9.0\include
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um
C:\Program Files (x86)\Windows Kits\8.1\include\shared
C:\Program Files (x86)\Windows Kits\8.1\include\um
C:\Program Files (x86)\Windows Kits\8.1\include\winrt
End of search list.
“d:\code\llvm\build\bin\lld-link.exe” -out:a.exe -defaultlib:libcmt -nolog
o “C:\Users\Red\AppData\Local\Temp\main-71fc84.o”
d:\code\Unity_Unpacker\tests\test2>lldb a.exe
(lldb) target create “a.exe”
Current executable set to ‘a.exe’ (i686).
(lldb) run
Process 6448 launching
Under llvm/tools also checkout lld. So your directories should look like this:
llvm
-- tools
-- clang
-- lldb
-- lld
Then re-run cmake to generate build files again, recompile, and then it should work. Right now the problem is that lld-link.exe hasn’t been compiled yet.
Under llvm/tools also checkout lld. So your directories should look like
this:llvm
\-- tools
\-- clang
\-- lldb
\-- lldThen re-run cmake to generate build files again, recompile, and then it
should work. Right now the problem is that lld-link.exe hasn't been
compiled yet.
(Note that in my experience, cmake won't discover when new subprojects are
checked out unless you use a new build directory -- it seems to cache too
aggressively.)
yes. i doing it. you can see what clang use d:\code\llvm\build\bin\lld-link.exe
but anyway it is hang
Ahh you probably need to add -g to clang, otherwise it’s not generating debug info. I’ve never tried debugging a binary with no debug info. Obviously it shouldn’t hang, but either way it’s just not something we’ve tested on Windows.
same.
d:\code\Unity_Unpacker\tests\test2>clang -g -fuse-ld=lld main.cpp
d:\code\Unity_Unpacker\tests\test2>lldb a.exe
(lldb) target create “a.exe”
Current executable set to ‘a.exe’ (i686).
(lldb) run
Process 6984 launching
I’m out of office until Monday, but I’ll try to reproduce this then and update. Never seen a hang before, so I wonder if there’s something different about your machine that we haven’t thought of or taken into account. Either way I’ll update Monday.
thanks. i will wait
im rebuild lldb as x64 application and reabuild my test application with x64 llvm.
at first look same.
But when my internet was breaked at some moment application under lldb run and finish correct.
It is like some magic with my pc.
When i have acces to internet lldb hangs, when i disable my internet - it is correct finished.
I try examine this behavior and determine finite conditions for hangs.
i found reson of hang. im used https://github.com/adoxa/ansicon for color console.
after uninstall it is now work as expected.