-
Notifications
You must be signed in to change notification settings - Fork 12k
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++ doesnt add debuginfo about access level of typedefs in classes #57608
Comments
@llvm/issue-subscribers-debuginfo |
Yep, sounds accurate. https://godbolt.org/z/PPvo4EW3s
So probably a bug in clang to add the access level flag (& then /maybe/ a bug in LLVM to use that info ensure that flag is read/emitted into the DWARF - depending on how general the LLVM implementation already is) |
@llvm/issue-subscribers-good-first-issue |
I would like to tackle this issue. |
When you post it for review in Phabricator, please add the debug-info tag. |
|
When running gdb.cp/derivation.exp using clang, we get an unexpected failure when printing the type of a class with an internal typedef. This happens because clang doesn't add accessibility information for typedefs inside classes (see llvm/llvm-project#57608 for more info). To help with clang testing, an XFAIL was added to this test.
When running gdb.cp/ptype-flags.exp using clang, we get an unexpected failure when printing the type of a class with an internal typedef. This happens because clang doesn't add accessibility information for typedefs inside classes (see llvm/llvm-project#57608 for more info). To help with clang testing, an XFAIL was added to this test.
When running gdb.cp/ptype-flags.exp using Clang, we get an unexpected failure when printing the type of a class with an internal typedef. This happens because Clang doesn't add accessibility information for typedefs inside classes (see llvm/llvm-project#57608 for more info). To help with Clang testing, an XFAIL was added to this test.
When attempting to run the gdb.cp/classes.exp test using Clang++, the test fails to prepare with -Wnon-c-typedef-for-linkage like the previously fixed gdb.cp/class2.exp. Upon fixing this, the test shows 5 unexpected failures. One such failures is: ptype/r class class_with_public_typedef type = class class_with_public_typedef { private: int a; public: class_with_public_typedef::INT b; private: typedef int INT; } (gdb) FAIL: gdb.cp/classes.exp: ptype class class_with_public_typedef // wrong access specifier for typedef: private While g++ provided the following output: ptype/r class class_with_public_typedef type = class class_with_public_typedef { private: int a; public: class_with_public_typedef::INT b; typedef int INT; } (gdb) PASS: gdb.cp/classes.exp: ptype class class_with_public_typedef This error happens because Clang does not add DW_AT_accessibility to typedefs inside classes, and without this information GDB defaults to assuming the typedef is private. Since there is nothing that GDB can do about this, these tests have been set as xfails, and Clang bug 57608 has been filed. Bug: llvm/llvm-project#57608 Approved-by: Tom Tromey <tom@tromey.com>
When running gdb.cp/derivation.exp using Clang, we get an unexpected failure when printing the type of a class with an internal typedef. This happens because Clang doesn't add accessibility information for typedefs inside classes (see llvm/llvm-project#57608 for more info). To help with Clang testing, an XFAIL was added to this test. Approved-by: Tom Tromey <tom@tromey.com>
We may close this issue if the patch is committed? Patch seems to working fine - https://godbolt.org/z/G5nTax3ox. <2><46>: Abbrev Number: 5 (DW_TAG_typedef) |
Yeah, fixed by 0828805 |
when compiling a program such as
clang can correctly identify the access level, but when analysing the class using
readelf -w
we find the following debug information for the typedef:While g++ gives the following debuginfo:
The lack of
DW_AT_accessibility
means that GDB is unable to fully understand the class, and ptype can't inform the user about access levels of the typedef.The text was updated successfully, but these errors were encountered: