-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[lldb] Fix crash missing MSInheritanceAttr on CXXRecordDecl with DWARF on Windows #112928
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
Changes from 3 commits
bb66f56
6f77556
a892f5e
45a211e
5444d5a
39c6e1b
644b189
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// REQUIRES: lld | ||
|
||
// Microsoft ABI: | ||
// RUN: %clang_cl --target=x86_64-windows-msvc -c -gdwarf %s -o %t_win.obj | ||
// RUN: lld-link /out:%t_win.exe %t_win.obj /nodefaultlib /entry:main /debug | ||
// RUN: %lldb -f %t_win.exe -b -o "target variable mp1 mp2 mp3 mp4 mp5 mp6 mp7 mp8 mp9" | ||
// | ||
// DWARF has no representation of MSInheritanceAttr, so we cannot determine the size | ||
// of member-pointers yet. For the moment, make sure we don't crash on such variables. | ||
|
||
// Itanium ABI: | ||
// RUN: %clang --target=x86_64-pc-linux -gdwarf -c -o %t_linux.o %s | ||
// RUN: ld.lld %t_linux.o -o %t_linux | ||
// RUN: %lldb -f %t_linux -b -o "target variable mp1 mp2 mp3 mp4 mp5 mp6 mp7 mp8 mp9" | FileCheck %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Michael137 You think that's ok as test-coverage also for non-MSVC? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, thanks! Don't think we even need to link (in either case). Also lets add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, added
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah fair enough, latest test changes LGTM |
||
// | ||
// CHECK: (char SI2::*) mp9 = 0x0000000000000000 | ||
|
||
class SI { | ||
double si; | ||
}; | ||
struct SI2 { | ||
char si2; | ||
}; | ||
class MI : SI, SI2 { | ||
int mi; | ||
}; | ||
class MI2 : MI { | ||
int mi2; | ||
}; | ||
class VI : virtual MI { | ||
int vi; | ||
}; | ||
class VI2 : virtual SI, virtual SI2 { | ||
int vi; | ||
}; | ||
class /* __unspecified_inheritance*/ UI; | ||
|
||
double SI::* mp1 = nullptr; | ||
int MI::* mp2 = nullptr; | ||
int MI2::* mp3 = nullptr; | ||
int VI::* mp4 = nullptr; | ||
int VI2::* mp5 = nullptr; | ||
int UI::* mp6 = nullptr; | ||
int MI::* mp7 = nullptr; | ||
int VI2::* mp8 = nullptr; | ||
char SI2::* mp9 = &SI2::si2; | ||
|
||
int main() { return 0; } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so for non-MS ABI
isIncompleteType
will pretty much work as before, and trivially return true. Otherwise it checks for theMSInheritanceAttr
. Seems reasonable to me