Skip to content

Include column info in debuginfo #42921

Closed
@est31

Description

@est31

I think that we should include column info in debuginfo, so that backtraces become more informative.

Often you do multiple function calls on a line, like ctr = ctr.inc().inc(); or let foo = wrap((), wrap((),())).

If one of these function calls generates a panic or something else that causes a backtrace, you can't know immediately which of the function calls actually caused the issue.

Apparently, right now we are setting the column number to zero: ae66285

The reason seems to be that GCC/Clang don't emit column numbers either and apparently GDB had issues with it. See #9641 and #10966. However, the change was from 2013, and maybe GDB support has changed since. Also, maybe if we ask kindly, GDB could consider adding support. AFAIK we already ship our copy of GDB so we might not even have to wait for a release to enable this per default.

Note that this is separate from panic locations, which doesn't use the LLVM debug info system but uses our own system instead. I'm preparing a PR to add line number info for panic's (without the RUST_BACKTRACE input) and want to file it soon. EDIT: #42938

cc @eddyb @michaelwoerister

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, 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