anza-xyz / move

Move compiler targeting llvm supported backends
https://discord.gg/wFgfjG9J
Apache License 2.0
107 stars 32 forks source link

Adding DWARF to Solana Move compiler #384

Closed jcivlin closed 9 months ago

jcivlin commented 9 months ago

This is to set foot in Dwarf generating for Solana Move compiler. DIBuilder is created and will be used to accumulate more Dwarf information.

With this patch we have something as simple as:

sol@dev-equinix-new-york-2:~/tmp/090623:$ less ~/tmp/090623/0x1__unit_test.ll.debug_info

; ModuleID = '0x1__unit_test.dbg_info'
source_filename = "/home/sol/work/git/move-090523/language/move-stdlib/sources/unit_test.move"

!llvm.dbg.cu = !{!0}

!0 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !1, producer: "move-mv-llvm-compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, sysroot: "/")
!1 = !DIFile(filename: "unit_test.move", directory: "/home/sol/work/git/move-090523/language/move-stdlib/sources")
ksolana commented 9 months ago

talked to Jan, he will add test case as a separate pr.

jcivlin commented 9 months ago

Thx for a quick review!