File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
source/Plugins/SymbolFile/DWARF
test/Shell/SymbolFile/DWARF Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,14 @@ static lldb::ModuleSP GetContainingClangModule(const DWARFDIE &die) {
133
133
return lldb::ModuleSP ();
134
134
}
135
135
136
+ // Returns true if the given artificial field name should be ignored when
137
+ // parsing the DWARF.
138
+ static bool ShouldIgnoreArtificialField (llvm::StringRef FieldName) {
139
+ return FieldName.starts_with (" _vptr$" )
140
+ // gdb emit vtable pointer as "_vptr.classname"
141
+ || FieldName.starts_with (" _vptr." );
142
+ }
143
+
136
144
TypeSP DWARFASTParserClang::ParseTypeFromClangModule (const SymbolContext &sc,
137
145
const DWARFDIE &die,
138
146
Log *log) {
@@ -3059,9 +3067,7 @@ void DWARFASTParserClang::ParseSingleMember(
3059
3067
// This needs to be done after updating FieldInfo which keeps track of where
3060
3068
// field start/end so we don't later try to fill the space of this
3061
3069
// artificial member with (unnamed bitfield) padding.
3062
- // FIXME: This check should verify that this is indeed an artificial member
3063
- // we are supposed to ignore.
3064
- if (attrs.is_artificial ) {
3070
+ if (attrs.is_artificial && ShouldIgnoreArtificialField (attrs.name )) {
3065
3071
last_field_info.SetIsArtificial (true );
3066
3072
return ;
3067
3073
}
Original file line number Diff line number Diff line change
1
+ # UNSUPPORTED: system-darwin, system-windows
2
+
3
+ # Make sure the artifical field `vptr.ClassName` from gcc debug info is ignored.
4
+ # RUN: %build --compiler=gcc %S/Inputs/debug-types-expressions.cpp -o %t
5
+ # RUN: %lldb %t -s %s -o exit | FileCheck %s
6
+
7
+ breakpoint set -n foo
8
+ process launch
9
+
10
+ # CHECK: Process {{.*}} stopped
11
+
12
+ frame variable *a
13
+ # CHECK-LABEL: frame variable *a
14
+ # CHECK: (B) *a = {
15
+ # CHECK-NEXT: A = (i = 47)
16
+ # CHECK-NEXT: j = 42
17
+ # CHECK-NEXT: }
You can’t perform that action at this time.
0 commit comments