[lldb-dev] lldb10 can not hit break point on windows platform

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Mon Oct 19 16:23:41 PDT 2020

As long as the location TestFunction.cpp:1 has a valid line in the PDB line tables, this breakpoint should be hit if there is debug info and the internal PDB parser is parsing things correctly. If you have debug info in your binary, _and_ if LLDB is able to locate your PDB file, then you should end up seeing a location if it was found. We can see this isn't happening:

(lldb)br s -fE:/test/TestFunction.cpp -l1
Breakpoint 1: no locations(pending).
WARNING :  Unable to resolve breakpoint to any actual locations.

I would suggest debugging the LLDB and debugging:

uint32_t SymbolFilePDB::ResolveSymbolContext(const lldb_private::FileSpec &file_spec, uint32_t line, bool check_inlines, SymbolContextItem resolve_scope, lldb_private::SymbolContextList &sc_list);

This function is what turns the file (in "file_spec") and line (in "line") into a symbol context list (in "sc_list"). A SymbolContext is a class that defines a complete symbol file context for something. It contains a Module (executable), CompileUnit (if there is debug info for the source file), Function (if there is debug info for the function), Block (lexical block of the deepest lexical block that contains the start address for the file + line), LineEntry (source file and line number, which might have a line number greater than what you requested if there was no perfect match), and Symbol (symbol from the symbol table). We have a symbol context list, because you might have multiple matches for a given source file and line if your functions was inlined.

You might try just doing:

(lldb) b TestFunction.cpp:1

And seeing if that helps. If the debug information doesn't contain the exact same path of "E:/test/TestFunction.cpp", it might not set the breapoint if the path in the debug info contains symlinks or is a relative path.

Does anyone know if the "pdb" file shows up when doing "image list" in LLDB? On mac if we have a stand alone debug info file, we show it below the executable:

(lldb) target create "/tmp/a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) image list a.out
[  0] E76A2647-AFB4-3950-943A-CB1D701B7C07 0x0000000100000000 /tmp/a.out 

If you do a "image list" on your executable, it would be interesting to see if the pdb file shows up in this output.

Greg Clayton

> On Oct 17, 2020, at 1:51 AM, le wang via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> Hello,everyone:
>       I have a problem when download llvm10.0.1 and use lldb to debug my process on windows10 x64 platform. but with no debug point hit.
> the command is
> (lldb)target create "D:/code/MLExecuteTest.exe"
> Current executable set to 'D:/code/MLExecuteTest.exe'  (x86_64)     
> (lldb)br s -fE:/test/TestFunction.cpp -l1
> Breakpoint 1: no locations(pending).
> WARNING :  Unable to resolve breakpoint to any actual locations.
> (lldb)r
> Process 16228 launched 'D:/code/MLExecuteTest.exe'
> Process 16228 exited with status = 1(0x00000001)
> my using detail is  this below:
> MLExecuteTest.exe is my process which will first compile the script  TestFunction.cpp on debug mode  and generate binary code in its memory, of course binary code has debug information, and then  it use JIT ExecuteEngine to execute the binary code. I want to know, is llvm 10.0.1 support this using on windows platform. since before we use llvm5.0 on windows platform is OK, breakpoints can be hit. but while update version to 10.0.1, with same operation ,breakpoints can not be hit. so is llvm10.0.1 support or has any changes on this using on windows platform? 
> Thanks,
> le wang
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

More information about the lldb-dev mailing list