-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)O-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Cland and MSVC support adding special debug info that can be recognized by the MSVC debugging tools for performing heap profiling. Right now all of the allocations from Rust code are put into an "Unresolved allocations" bucket with no stack frames attached to them, which makes them quite useless. Since LLVM 9 the backend supports generating the appropriate codeview information if the frontend creates the right metadata, so it would be great to allow rustc to generate that metadata.
Based on:
- https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html#windows-support
- https://clang.llvm.org/docs/AttributeReference.html#allocator
- https://bugs.llvm.org/show_bug.cgi?id=38491
- https://reviews.llvm.org/rL368230
Clang frontend work:
- https://github.com/llvm-mirror/clang/blob/e3b053c27cfd74468e946437526d061c7d88bd27/lib/Sema/SemaDeclAttr.cpp#L6395-L6407
- https://github.com/llvm-mirror/clang/blob/8b10d16729147455fc92b35d180968be9792b880/lib/CodeGen/CGCall.cpp#L4402-L4405
- https://github.com/llvm-mirror/clang/blob/05441b0db7bf23d206dfc865b5c5bde17da1dab0/lib/CodeGen/CGExprScalar.cpp#L2029-L2033
- https://github.com/llvm-mirror/clang/blob/14947e8df1c27d3babf2c01b53c0c2bf2bfb9bd1/lib/CodeGen/CGDebugInfo.cpp#L2050-L2062
We might be able to tie this into the existing GlobalAllocator support. This work may need to wait until #67759 has merged, however.
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)O-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.