git

My personal website source code
Log | Files | Refs | Submodules | README | LICENSE

d-saoc-2021-13.md (2128B)


      1 ---
      2 title: 'SAOC LLDB D integration: 13th Weekly Update'
      3 date: '2021-12-16T23:34:00+01:00'
      4 tags: ['saoc', 'saoc2021', 'dlang', 'llvm', 'lldb', 'debug', 'debugging', 'dwarf']
      5 description: "This post describes what I've done on the 13th week of the
      6 Symmetry Autumn of Code 2021, including some bug fixes and trivial patches."
      7 ---
      8 
      9 Hi D community!
     10 
     11 I'm here again, to describe what I've done during the thirteenth week of
     12 Symmetry Autumn of Code. This week as a bit atypical as I got infected with
     13 COVID-19 and this made me feel exhausted both physically and mentally.
     14 
     15 ## Working approach to fetch basic types
     16 
     17 After digging a bit about the problem I found out there is no problem
     18 specifically in Release builds, and a simple function called `Verify` is there
     19 to double check if the type is correct for Debug builds. After fixing that
     20 function, the LLDB can now dump some simple output about global TLS and non-TLS
     21 variables:
     22 
     23 ```
     24 (lldb) ta v
     25 Global variables for app.d in app:
     26 app.bar = <No TLS data currently exists for this thread.>
     27 
     28 app.ptr = <could not resolve type>
     29 app.foobar =
     30 ```
     31 
     32 For now it only recognizes boolean types, but it can't show up the value since
     33 LLDB doesn't know a way to dump it correctly.
     34 
     35 You can try this version yourself using
     36 [this](https://github.com/devtty63/llvm-project/tree/lldb-d/implement-typesystem-d)
     37 branch.
     38 
     39 ## Decoupling and trivial patches
     40 
     41 I pushed a patch to decouple DWARF to LLDB encoding logic from Clang DWARF AST
     42 Parser, along with a trivial fix about duplicate map assignment:
     43 
     44 - https://reviews.llvm.org/D115662
     45 - https://reviews.llvm.org/D115663
     46 
     47 ## What is next?
     48 
     49 I already started working on some helpers to fetch the LLDB Format, Encoding
     50 and BasicType, along with other information about a type to properly display
     51 them. I'm not sure how Milestone 4 is going to work, as I underestimated
     52 the support for custom expessions.
     53 
     54 You can also read this on the D programming language forum,
     55 [here](https://forum.dlang.org/thread/[email protected]),
     56 and discuss there!
     57 
     58 Read about the [previous week](../d-saoc-2021-12/) and the [next
     59 week](../d-saoc-2021-14/).