mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 13:50:11 +00:00
[LLDB] Ignore actual-needed artificial members in DWARFASTParserClang::ParseSingleMember (#70779)
Address the FIXME, this will allow lldb to print all fields of the generated coroutine frame structure. Fixes #69309.
This commit is contained in:
parent
c4e57b11f4
commit
66acd1e4dc
@ -133,6 +133,14 @@ static lldb::ModuleSP GetContainingClangModule(const DWARFDIE &die) {
|
||||
return lldb::ModuleSP();
|
||||
}
|
||||
|
||||
// Returns true if the given artificial field name should be ignored when
|
||||
// parsing the DWARF.
|
||||
static bool ShouldIgnoreArtificialField(llvm::StringRef FieldName) {
|
||||
return FieldName.starts_with("_vptr$")
|
||||
// gdb emit vtable pointer as "_vptr.classname"
|
||||
|| FieldName.starts_with("_vptr.");
|
||||
}
|
||||
|
||||
TypeSP DWARFASTParserClang::ParseTypeFromClangModule(const SymbolContext &sc,
|
||||
const DWARFDIE &die,
|
||||
Log *log) {
|
||||
@ -3059,9 +3067,7 @@ void DWARFASTParserClang::ParseSingleMember(
|
||||
// This needs to be done after updating FieldInfo which keeps track of where
|
||||
// field start/end so we don't later try to fill the space of this
|
||||
// artificial member with (unnamed bitfield) padding.
|
||||
// FIXME: This check should verify that this is indeed an artificial member
|
||||
// we are supposed to ignore.
|
||||
if (attrs.is_artificial) {
|
||||
if (attrs.is_artificial && ShouldIgnoreArtificialField(attrs.name)) {
|
||||
last_field_info.SetIsArtificial(true);
|
||||
return;
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
# UNSUPPORTED: system-darwin, system-windows
|
||||
|
||||
# Make sure the artifical field `vptr.ClassName` from gcc debug info is ignored.
|
||||
# RUN: %build --compiler=gcc %S/Inputs/debug-types-expressions.cpp -o %t
|
||||
# RUN: %lldb %t -s %s -o exit | FileCheck %s
|
||||
|
||||
breakpoint set -n foo
|
||||
process launch
|
||||
|
||||
# CHECK: Process {{.*}} stopped
|
||||
|
||||
frame variable *a
|
||||
# CHECK-LABEL: frame variable *a
|
||||
# CHECK: (B) *a = {
|
||||
# CHECK-NEXT: A = (i = 47)
|
||||
# CHECK-NEXT: j = 42
|
||||
# CHECK-NEXT: }
|
Loading…
Reference in New Issue
Block a user