Skip to content

Find strategy for evolving debuginfo format without breaking everything #34560

Closed
@michaelwoerister

Description

@michaelwoerister

It's a well-known fact that the Rust compiler emits debuginfo in a format that is neither very complete nor very elegant. The main reason for this is that so far we've targeted debuginfo consumers that do not know about Rust and would treat it more or less like C or C++. Going forward though, we need to make changes to the debuginfo format if we want to allow Rust-aware debuggers to provide much better support than is possible now. This raises the question how we can start evolving the format without breaking support by the current line of debuggers.

There are two scenarios here:
(1) The new debuginfo format is just a backwards compatible extension to what we have now.
(2) The new format contains constructs that current debuggers will not be able to interpret.

While scenario (1) would provide some desirable, short-term benefits, my personal opinion is that it is (a) likely not feasible to achieve, and (b) that we should strive not to set in stone some of the ugliness of the current format (e.g. enum encoding). That being said, it might make sense to identify any points where a backwards-compatible format would fall short in functionality.

If we assume scenario (2) it seems unavoidable to me that we support emitting two debuginfo encodings for at least the next few years because:

  • the GDB versions distributed with common Linux distributions will still not reliably know about Rust for a while, and
  • there is no effort to implement native Rust support in LLDB yet, at least as far as I know.

The question is: how can we implement this in a way that is ergonomic and not confusing to the user? Or in other words, how do we avoid that for part of the user-base the debugging story is worse than it could be -- either because they don't use their Rust-aware debugger to its full potential, or because their C++ debugger chokes on debuginfo it cannot handle -- without them knowing that a simple compiler flag would solve their problems, or it being too cumbersome to set that compiler flag.

cc @rust-lang/tools @tromey @Manishearth

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions