-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[GR-54697] Implement debuginfo generation at image-runtime. #10522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6dfef33
to
a6101eb
Compare
Even if we don't get the GDB changes upstream in time this PR should be merged soon. The Debuginfo generation speedup due to parallelization plus the fix to make our DWARF5 work with GDB 16 or later justifies having this on master. |
704775a
to
b05b63f
Compare
8866afc
to
3e9f02a
Compare
040181d
to
ac8e19c
Compare
f6cb0b8
to
da7b49d
Compare
@adinn this PR will likely be merged mid or end of next week. If you have any questions or comments, this would be a good time. cc @dominikmascherbauer |
4006038
to
b3e78d8
Compare
This is not required anymore as we now use GDB opaque types to refer to already at-build-time-defined types from the run-time debuginfo generator. |
dddcdb2
to
3234927
Compare
20dd01d
to
c2ad2f0
Compare
…g information generation Implement the GDB JIT compilation interface Split off a shared debug information generator for use at image build-time and run-time Rework debug entries Parallelize debug information generation Add LocalVariableTable to SubstrateMethod Add tests for run-time debug information generation Refactor and rework gdb-debughelpers Make BFDNameProvider usable at image run-time Update Line section to DWARF5, fix bug when loading debug info in recent GDB versions (>= GDB 16) Add support for lazy deoptimization for frame unwinder and frame filter Implement opaque type resolution for runtime debug information in GDB Updates to CV debug information to be compatible with reworked debug information generation
c2ad2f0
to
0a847fd
Compare
On Linux native-image supports generating images with dwarf-debuginfo. This allows advanced users to debug image execution with GDB.
Since debuginfo is generated as part of the image build process it is only providing debug support for the AOT compiled methods in an image. For methods that get compiled at image run-time (as part of truffle runtime compilation) there is currently no debuginfo available.
To fix this problem the process of generating debuginfo must also happen at image runtime whenever a new method gets compiled and is about to be registered in the run-time code-cache. This requires code that is currently only used at build-time (hosted) to be made usable also for inclusion in the image itself. The relevant parts of the hosted code need to be refactored as needed.
Once runtime-debuginfo is generated GDB needs to be notified about it. This needs to happen via the GDB JIT Interface. Note that it also required that GDB needs to be notified that run-time debuginfo is no more valid in case a run-time compiled method gets removed from the run-time code-cache (e.g. due to deoptimization).
The existing debuginfo testing needs to be extended to also test the run-time debuginfo generation.
Caveat: For GDB to be able to resolve type references from run-time debuginfo to AOT debuginfo, currently a modified version of GDB is required. https://github.com/dominikmascherbauer/binutils-gdb
We are working on getting the required changes upstream.