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

Debug info not generated correctly for function static variables #19612

Open
llvmbot opened this issue Mar 25, 2014 · 7 comments
Open

Debug info not generated correctly for function static variables #19612

llvmbot opened this issue Mar 25, 2014 · 7 comments
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 25, 2014

Bugzilla Link 19238
Version 3.4
OS Linux
Reporter LLVM Bugzilla Contributor
CC @chbessonova,@dwblaikie,@echristo,@pogo59

Extended Description

#include<stdio.h>
int main() {
static int X = 10;
{
static bool X = false;
printf("...");
}
printf("...");
}

If you compile the code above with clang 3.4 and break at the printf() statements (gdb or lldb) then p X will always show X to be 10. The same code compiled with GCC shows X to be false in the first case and 10 in the second as expected.

@echristo
Copy link
Contributor

Looks like we're missing the lexical block for the inner range.

@llvmbot
Copy link
Collaborator Author

llvmbot commented May 13, 2015

Same issue is true for typedef and records (struct, union, and class).
I have a fix for all these cases, in both Clang and LLVM.
I will upload it for review ASAP.

@pogo59
Copy link
Collaborator

pogo59 commented May 22, 2015

*** Bug llvm/llvm-bugzilla-archive#23164 has been marked as a duplicate of this bug. ***

@chbessonova
Copy link
Contributor

*** Bug llvm/llvm-bugzilla-archive#44695 has been marked as a duplicate of this bug. ***

@chbessonova
Copy link
Contributor

Another attempt to fix this

@pogo59
Copy link
Collaborator

pogo59 commented Nov 26, 2021

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

@chbessonova
Copy link
Contributor

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

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

4 participants