[PATCH] D97694: [lli] Test debug support in RuntimeDyld with built-in functions

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 08:38:50 PST 2021


sgraenitz created this revision.
sgraenitz added reviewers: lhames, dblaikie.
Herald added a subscriber: mgorny.
sgraenitz requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Herald added a project: LLVM.

When lli runs the below IR, it emits in-memory debug objects and registers them with the GDB JIT interface. The tests dump and check the registered information. IR has limited ability to produce complex output in a portable way. Instead the tests rely on built-in functions implemented in lli. They use a new command line flag `-generate=function-name` to instruct the ORC JIT to expose the built-in function with the given name to the JITed program.

`debug-descriptor-elf-minimal.ll` calls `__dump_jit_debug_descriptor()` to reflect the list of debug entries issued for itself after emitting the main module. The output is textual and can be checked straight away.

`debug-objects-elf-minimal.ll` calls `__dump_jit_debug_objects()`, which instructs lli to walk through the list of debug entries and append the encountered in-memory objects to the program output. We feed this output into llvm-dwarfdump to parse the DWARF in each file and dump their structures.

We can do the same for JITLink once D97335 <https://reviews.llvm.org/D97335> has landed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97694

Files:
  llvm/test/ExecutionEngine/OrcLazy/debug-descriptor-elf-minimal.ll
  llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll
  llvm/tools/lli/CMakeLists.txt
  llvm/tools/lli/ExecutionUtils.cpp
  llvm/tools/lli/ExecutionUtils.h
  llvm/tools/lli/lli.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97694.327128.patch
Type: text/x-patch
Size: 14009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210301/782bbfe1/attachment.bin>


More information about the llvm-commits mailing list