move icon indicating copy to clipboard operation
move copied to clipboard

Support source-level debugging of Move programs

Open ksolana opened this issue 1 year ago • 3 comments

ksolana avatar Jul 06 '23 23:07 ksolana

As per: @nvjle

As mentioned above, the move-mv-llvm-compiler would need to generate DI metadata + intrinsics into the LLVM IR. We do not do that today, and it has never been mentioned as a TODO yet.

It does appear that the Move bytecode we receive has some rudimentary location and partial symbol information, so it is certainly possible to generate some DI from that. Then GDB or LLDB would have to be taught a little bit about the language, but being similar to Rust, that probably isn't too difficult (details).

I don't recall, either, seeing any debugger in the Move Project itself. I don't know if/how they do source level debugging. The Move Language does not yet even have a DWARF Language Code in the standard (https://dwarfstd.org/languages.html). The various "official" Move projects (upstream Move, Aptos, Sui) do not seem to have source debugging as a priority-- possibly because the language is still not mature-- or just bigger fish to fry.

ksolana avatar Jul 06 '23 23:07 ksolana

cc: @jcivlin

ksolana avatar Jul 06 '23 23:07 ksolana

llvm tutorial on how to add debugging support: https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.html

ksolana avatar Jul 07 '23 00:07 ksolana