Skip to content

Commit e74494c

Browse files
committed
Handle the vptr gdb case, and add test.
and remove the change in CPPLanguageRuntim.cpp.
1 parent ac813b4 commit e74494c

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
4141
: LanguageRuntime(process) {}
4242

4343
bool CPPLanguageRuntime::IsAllowedRuntimeValue(ConstString name) {
44-
// FIXME: use a list when the list grows more.
45-
return name == g_this ||
46-
name == ConstString("__promise") ||
47-
name == ConstString("__coro_frame");
44+
return name == g_this;
4845
}
4946

5047
bool CPPLanguageRuntime::GetObjectDescription(Stream &str,

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,9 @@ TypeSystemClang *TypeSystemClang::GetASTContext(clang::ASTContext *ast) {
772772
}
773773

774774
bool TypeSystemClang::ShouldIgnoreArtificialField(llvm::StringRef Name) {
775-
return Name.starts_with("_vptr$");
775+
return Name.starts_with("_vptr$")
776+
// gdb emit vtable pointer as "_vptr.classname"
777+
|| Name.starts_with("_vptr.");
776778
}
777779

778780
clang::MangleContext *TypeSystemClang::getMangleContext() {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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: }

0 commit comments

Comments
 (0)