Skip to content
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

Generate DWARF information #2290

Open
wants to merge 1 commit into
base: trunk
from

Conversation

@mshinwell
Copy link
Contributor

commented Mar 6, 2019

The code in this pull request is the magic that generates DWARF debugging information from the output of the backend and the various debugging analysis passes. It receives information about variable availability and contents; an approximation of the lexical block structure of the program including any inlined-out frames; descriptions of statically-allocated constants; and the linearised code of the program itself. In effect, this is a compiler within a compiler.

The DWARF output generated is comprehensive and could potentially be used for purposes other than debugging (such as program analysis). Remarkably, the output is compatible with GNU toolchains on Linux as well as the LLVM-based toolchain on the latest version of macOS (Mojave), although gdb rather than lldb should be used as the debugger.

It turns out that, by virtue of the optimisations performed by the OCaml compiler and the calling conventions used at runtime, the "phantom let" support and the recent DWARF support for describing call sites both play particularly important roles in achieving a good user experience in the debugger.

This pull request is missing many dependencies at present (to be provided by other GPRs whose upstreaming is in progress) and will no doubt require a certain amount of explanation. I am posting it now so that @bschommer in particular can have a high-level overview of what is going on; this may be useful when reviewing the pull requests for the dwarf_high and dwarf_low libraries.

@mshinwell mshinwell added this to the 4.09 milestone Mar 6, 2019

@damiendoligez damiendoligez removed this from the 4.09 milestone Apr 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.