Debugging with LLDB on Windows

Siemargl inqnone at gmail.com
Wed Feb 17 20:26:54 UTC 2021


On Tuesday, 4 August 2020 at 18:44:02 UTC, kinke wrote:
> On Monday, 3 August 2020 at 20:37:49 UTC, WebFreak001 wrote:
>> is it possible to then simply target the MinGW triple?
>
> Nope, not (fully) supported by druntime and Phobos, and the 
> compiler would probably require a few adaptations too.
>
> As you're the 2nd guy asking for DWARF debuginfos and MSVC 
> targets in a month, and LLVM supports it: 
> https://github.com/ldc-developers/ldc/pull/3533

Some problems with llvm debugging.

Test log from lldb 10.0.0 - not recognized main function name 
(but other is found), not steps next line (expect goto finally 
expression) after throw exception.

Compile>ldc2 -gdwarf -gc -m64 except.d
lld-link: warning: section name .debug_abbrev is longer than 8 
characters and will use a non-standard string table
lld-link: warning: section name .debug_info is longer than 8 
characters and will use a non-standard string table
lld-link: warning: section name .debug_line is longer than 8 
characters and will use a non-standard string table
lld-link: warning: section name .debug_loc is longer than 8 
characters and will use a non-standard string table
lld-link: warning: section name .debug_pubnames is longer than 8 
characters and will use a non-standard string table
lld-link: warning: section name .debug_pubtypes is longer than 8 
characters and will use a non-standard string table
lld-link: warning: section name .debug_ranges is longer than 8 
characters and will use a non-standard string table
lld-link: warning: section name .debug_str is longer than 8 
characters and will use a non-standard string table

Used MSVC Build tools 2019 (as -v option tells), but lld-link.

-----
>E:\_bin\LLVM\bin\lldb.exe except.exe
> 
>                                                 (lldb) target
>create "except.exe"
Current executable set to 
'E:\VSProjects\testjunk\DbetterC\except.exe' (x86_64).
(lldb) b main
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) b _Dmain
Breakpoint 2: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) b except.d:3
Breakpoint 3: where = except.exe`_Dmain + 16 at except.d:9:13, 
address = 0x0000000140001010
(lldb) r
Process 90056 launched: 
'E:\VSProjects\testjunk\DbetterC\except.exe' (x86_64)
Process 90056 stopped
* thread #1, stop reason = breakpoint 3.1
     frame #0: 0x00007ff6369d1010 except.exe`_Dmain at 
except.d:9:13
    6        {
    7            try
    8            {
-> 9                throw new Exception("first");
    10           }
    11           finally
    12           {
(lldb) n
Process 90056 exited with status = 0 (0x00000000)
(lldb)
---



More information about the digitalmars-d-ldc mailing list