Skip to content

emit debug info for labels #14872

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

Closed
dwblaikie opened this issue Dec 4, 2012 · 8 comments
Closed

emit debug info for labels #14872

dwblaikie opened this issue Dec 4, 2012 · 8 comments
Labels
bugzilla Issues migrated from bugzilla c++ debuginfo

Comments

@dwblaikie
Copy link
Collaborator

Bugzilla Link 14500
Resolution FIXED
Resolved on Sep 05, 2019 15:16
Version trunk
OS Linux
Blocks #14702 llvm/llvm-bugzilla-archive#24345
CC @DougGregor,@echristo,@yuanfang-chen

Extended Description

Clang doesn't currently produce DW_TAG_labels. (see gdb.base/label.exp in the GDB 7.5 test suite)

@yuanfang-chen
Copy link
Collaborator

DW_TAG_label is supported since d6b2cdf.

We could close this after the XFAIL tests for this in GDB (they still exist in gdb trunk) are removed.

@dwblaikie
Copy link
Collaborator Author

DW_TAG_label is supported since d6b2cdf.

What subversion revision is this? (and/or could you provide a link to the llvm-commits list, github commit, etc)

@echristo
Copy link
Contributor

commit d6b2cdf
Author: Shiva Chen [email protected]
Date: Tue Jul 24 02:22:55 2018 +0000

[DebugInfo] Generate DWARF debug information for labels.

There are two forms for label debug information in DWARF format.

1. Labels in a non-inlined function:

DW_TAG_label
  DW_AT_name
  DW_AT_decl_file
  DW_AT_decl_line
  DW_AT_low_pc

2. Labels in an inlined function:

DW_TAG_label
  DW_AT_abstract_origin
  DW_AT_low_pc

We will collect label information from DBG_LABEL. Before every DBG_LABEL,
we will generate a temporary symbol to denote the location of the label.
The symbol could be used to get DW_AT_low_pc afterwards. So, we create a
mapping between 'inlined label' and DBG_LABEL MachineInstr in DebugHandlerBase.
The DBG_LABEL in the mapping is used to query the symbol before it.

The AbstractLabels in DwarfCompileUnit is used to process labels in inlined
functions.

We also keep a mapping between scope and labels in DwarfFile to help to
generate correct tree structure of DIEs.

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

Patch by Hsiangkai Wang.

llvm-svn: 337799

@dwblaikie
Copy link
Collaborator Author

SGTM then - thanks!

@yuanfang-chen
Copy link
Collaborator

Thank you all.

Hi David, do you plan to revert the test workaround on the GDB side?

@dwblaikie
Copy link
Collaborator Author

Thank you all.

Hi David, do you plan to revert the test workaround on the GDB side?

Sure - I sent a patch to the gdb list for review.

@llvmbot
Copy link
Member

llvmbot commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#24345

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@llvmbot
Copy link
Member

llvmbot commented Apr 28, 2025

@llvm/issue-subscribers-debuginfo

Author: David Blaikie (dwblaikie)

| | | | --- | --- | | Bugzilla Link | [14500](https://llvm.org/bz14500) | | Resolution | FIXED | | Resolved on | Sep 05, 2019 15:16 | | Version | trunk | | OS | Linux | | Blocks | llvm/llvm-project#14702 llvm/llvm-bugzilla-archive#24345 | | CC | @DougGregor,@echristo,@yuanfang-chen |

Extended Description

Clang doesn't currently produce DW_TAG_labels. (see gdb.base/label.exp in the GDB 7.5 test suite)

@EugeneZelenko EugeneZelenko marked this as a duplicate of #35768 Apr 28, 2025
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++ debuginfo
Projects
None yet
Development

No branches or pull requests

5 participants