d-saoc-2021-11.md (3135B)
1 --- 2 title: 'SAOC LLDB D integration: 11th Weekly Update' 3 date: '2021-12-02T16:31:00+01:00' 4 tags: ['saoc', 'saoc2021', 'dlang', 'llvm', 'lldb', 'debug', 'debugging', 'dwarf'] 5 description: "This post describes what I've done on the 11th week of the 6 Symmetry Autumn of Code 2021, including follow up updates on the LLVM patches 7 decoupling of clang-specific code on LLDB interfaces and start implementation 8 of D basic types." 9 --- 10 11 Hi D community! 12 13 I'm here again, to describe what I've done during the eleventh week of Symmetry 14 Autumn of Code. 15 16 ## LLVM upstream follow up update 17 18 Three more patches in the D demangling patch train got merged! 19 20 - https://reviews.llvm.org/D111415 21 - https://reviews.llvm.org/D114305 22 - https://reviews.llvm.org/D114307 23 24 I joined this week on the LLVM official team to help provide maintenance on the 25 code I introduced and planning to introduce as well as general changes made for 26 D in the official tree. 27 28 I have 2 more patches already accepted about the demangling but I didn't merge 29 them yet, as I'm having some problems on running the test suite locally. 30 31 Currently, LLVM already supports special D main, simple multiple identifiers 32 and anonymous symbols. Next step is to support basic and compound types, 33 although I think this needs to be split up, as discussed in some patches. 34 35 ## Implementation of basic types and decoupling Clang-specific code 36 37 I started this week implementing basic types on the D TypeSystem, although, in 38 the meanwhile, I found that some decoupling is needed, since the current LLDB 39 architecture for parsing debug info has some entanglement with clang-specific 40 structures such as the AST Context and other TypeSystem and AST related 41 structures. I though this was something already considered, but a lot of effort 42 on this was left behind when other languages stop being supported, like Go. 43 44 I made some patches to move that forward in the upstream: 45 46 - https://reviews.llvm.org/D114668 47 - https://reviews.llvm.org/D114719 48 - https://reviews.llvm.org/D114746 49 50 Still about the decoupling, I found out that only DWARF Parser is reasonably 51 decoupled, but other debug info parsers like 52 [PDB](https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp) 53 are really entangled with the Clang TypeSystem. There is no generic interface 54 at the moment, and I plan to decouple that as well, although, it is not really 55 a priority for me, since my main development environment is Linux. That said, 56 I'm probably going to left Windows support as a second priority, for now. 57 58 I added those patches to the [PR](https://github.com/ljmf00/lldb-d/pull/1) I 59 created last week and continued working on it. 60 61 ## What is next? 62 63 I haven't finished the type wrapper to represent a D type, due to those 64 decoupling issues. I will hopefully finish the implementation next week and try 65 to have some simple output on the LLDB side. 66 67 You can also read this on the D programming language forum, 68 [here](https://forum.dlang.org/thread/hhadillhyyiwekyluotg@forum.dlang.org), 69 and discuss there! 70 71 Read about the [previous week](../d-saoc-2021-10/) and the [next 72 week](../d-saoc-2021-12/).