Skip to content
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

Clang does not generate DW_TAG_label #35768

Open
JDevlieghere opened this issue Feb 17, 2018 · 6 comments
Open

Clang does not generate DW_TAG_label #35768

JDevlieghere opened this issue Feb 17, 2018 · 6 comments
Labels
bugzilla Issues migrated from bugzilla debuginfo

Comments

@JDevlieghere
Copy link
Member

Bugzilla Link 36420
Version trunk
OS All
Attachments llvm-dwarfdump output for clang binary, llvm-dwarfdump output for gcc binary
CC @adrian-prantl,@JDevlieghere

Extended Description

clang does not generate a DW_TAG_label for the example below, while gcc does:

int main(int argc, char** argv)
{
goto failure;
failure:
return 1;
}

@JDevlieghere
Copy link
Member Author

I tried bisecting this but couldn't find any passing builds. Did we ever generate this TAG?

@adrian-prantl
Copy link
Collaborator

I have only ever seen DW_TAG_label being generated for assembler sources. In assembler there is no notion of a function, only labels.

@adrian-prantl
Copy link
Collaborator

Do you think generating a DW_TAG_label for C-language labels would be useful?

@JDevlieghere
Copy link
Member Author

I'd like to say yes, assuming that it's a prerequisite to be able to break on labels in the debugger. I don't know if LLDB supports this, but I'm pretty sure GDB does.

@adrian-prantl
Copy link
Collaborator

Is it possible to distinguish user-specified labels from compiler-generated ones in LLVM IR and MIR? If yes, then this should be fairly straightforward to implement in AsmPrinter.

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

llvmbot commented Oct 8, 2023

@llvm/issue-subscribers-debuginfo

| | | | --- | --- | | Bugzilla Link | [36420](https://llvm.org/bz36420) | | Version | trunk | | OS | All | | Attachments | [llvm-dwarfdump output for clang binary](https://user-images.githubusercontent.com/712896/143757064-9522842f-deb4-4d9c-b96d-fe39eebf7d47.gz), [llvm-dwarfdump output for gcc binary](https://user-images.githubusercontent.com/712896/143757065-c75ab33c-5cd9-44d7-8a94-306f4c84bb49.gz) | | CC | @adrian-prantl,@JDevlieghere |

Extended Description

clang does not generate a DW_TAG_label for the example below, while gcc does:

int main(int argc, char** argv)
{
goto failure;
failure:
return 1;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla debuginfo
Projects
None yet
Development

No branches or pull requests

4 participants