Skip to content

Conversation

@llvmbot
Copy link
Member

@llvmbot llvmbot commented Aug 12, 2022

@tru
Copy link
Contributor

tru commented Aug 15, 2022

@kraj @MaskRay does this look fine to merge to 15.x?

@kraj
Copy link
Contributor

kraj commented Aug 15, 2022

@kraj @MaskRay does this look fine to merge to 15.x?

this is good but we also need to backport llvm/llvm-project@d797c2f

to fully complete the fix.

…fo (DWARF v5)

For generated assembly debug info, MCDwarfLineTableHeader::CompilationDir is an
unmapped path set in MCContext::setGenDwarfRootFile. Remap it.

A relative destination path of -fdebug-prefix-map= exposes a llvm-dwarfdump bug
which joins relative DW_AT_comp_dir and directories[0].

Fix llvm/llvm-project#56609

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D131749

(cherry picked from commit f62e60f)
… line tables

DWARF v5 6.2.4 The Line Number Program Header says:

> The first entry is the current directory of the compilation. Each additional
> path entry is either a full path name or is relative to the current directory of
> the compilation.

When forming a path, relative DW_AT_comp_dir and directories[0] are not supposed
to be joined together. Fix getFileNameByIndex to special case DWARF v5 DirIdx == 0.

Reviewed By: #debug-info, dblaikie

Differential Revision: https://reviews.llvm.org/D131804

(cherry picked from commit 3329cec)
`getContext().setMCLineTableRootFile` (from D62074) sets `RootFile.Name` to
`FirstCppHashFilename`. `RootFile.Name` is not processed by -fdebug-prefix-map
and will go to DW_TAG_compile_unit's DT_AT_name and DW_TAG_label's
DW_AT_decl_file. Remap `RootFile.Name`.

Fix another issue reported by llvm/llvm-project#56609

Reviewed By: #debug-info, dblaikie, raj.khem

Differential Revision: https://reviews.llvm.org/D131848

(cherry picked from commit d797c2f)
@tru
Copy link
Contributor

tru commented Aug 15, 2022

@kraj @MaskRay does this look fine to merge to 15.x?

this is good but we also need to backport llvm/llvm-project@d797c2f

to fully complete the fix.

Good now?

@MaskRay
Copy link
Member

MaskRay commented Aug 15, 2022

LGTM

@tru tru merged commit e4aa104 into release/15.x Aug 16, 2022
@tru tru deleted the llvm-issue57125 branch August 16, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge -fdebug-prefix-map fixes (MC,llvm-dwarfdump) into release/15.x

5 participants