Skip to content

Commit 638a839

Browse files
authored
Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (#71780)
This patch relands #70639 It was reverted because under certain conditions we triggered an assertion in `DIBuilder`. Specifically, in the original patch we called `EmitGlobalVariable` at the end of `CGDebugInfo::finalize`, after all the temporary `DIType`s have been uniqued. With limited debug-info such temporary nodes would be created more frequently, leaving us with non-uniqued nodes by the time we got to `DIBuilder::finalize`; this violated its pre-condition and caused assertions to trigger. To fix this, the latest iteration of the patch moves `EmitGlobalVariable` to the beginning of `CGDebugInfo::finalize`. Now, when we create a temporary `DIType` node as a result of emitting a variable definition, it will get uniqued in time. A test-case was added for this scenario. We also now don't emit a linkage name for non-locationed constants since LLDB doesn't make use of it anyway. Original commit message: """ When an LLDB user asks for the value of a static data member, LLDB starts by searching the Names accelerator table for the corresponding variable definition DIE. For static data members with out-of-class definitions that works fine, because those get represented as global variables with a location and making them eligible to be added to the Names table. However, in-class definitions won’t get indexed because we usually don't emit global variables for them. So in DWARF we end up with a single `DW_TAG_member` that usually holds the constant initializer. But we don't get a corresponding CU-level `DW_TAG_variable` like we do for out-of-class definitions. To make it more convenient for debuggers to get to the value of inline static data members, this patch makes sure we emit definitions for static variables with constant initializers the same way we do for other static variables. This also aligns Clang closer to GCC, which produces CU-level definitions for inline statics and also emits these into `.debug_pubnames`. The implementation keeps track of newly created static data members. Then in `CGDebugInfo::finalize`, we emit a global `DW_TAG_variable` with a `DW_AT_const_value` for any of those declarations that didn't end up with a definition in the `DeclCache`. The newly emitted `DW_TAG_variable` will look as follows: ``` 0x0000007b: DW_TAG_structure_type DW_AT_calling_convention (DW_CC_pass_by_value) DW_AT_name ("Foo") ... 0x0000008d: DW_TAG_member DW_AT_name ("i") DW_AT_type (0x00000062 "const int") DW_AT_external (true) DW_AT_declaration (true) DW_AT_const_value (4) Newly added vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 0x0000009a: DW_TAG_variable DW_AT_specification (0x0000008d "i") DW_AT_const_value (4) DW_AT_linkage_name ("_ZN2t2IiE1iIfEE") ``` This patch also drops the `DW_AT_const_value` off of the declaration since we now always have it on the definition. This ensures that the `DWARFParallelLinker` can type-merge class with static members where we couldn't attach the constant on the declaration in some CUs. """ Dependent changes: * #71800
1 parent 9a3d3c7 commit 638a839

File tree

7 files changed

+219
-42
lines changed

7 files changed

+219
-42
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,22 +1677,13 @@ CGDebugInfo::CreateRecordStaticField(const VarDecl *Var, llvm::DIType *RecordTy,
16771677

16781678
unsigned LineNumber = getLineNumber(Var->getLocation());
16791679
StringRef VName = Var->getName();
1680-
llvm::Constant *C = nullptr;
1681-
if (Var->getInit()) {
1682-
const APValue *Value = Var->evaluateValue();
1683-
if (Value) {
1684-
if (Value->isInt())
1685-
C = llvm::ConstantInt::get(CGM.getLLVMContext(), Value->getInt());
1686-
if (Value->isFloat())
1687-
C = llvm::ConstantFP::get(CGM.getLLVMContext(), Value->getFloat());
1688-
}
1689-
}
16901680

16911681
llvm::DINode::DIFlags Flags = getAccessFlag(Var->getAccess(), RD);
16921682
auto Align = getDeclAlignIfRequired(Var, CGM.getContext());
16931683
llvm::DIDerivedType *GV = DBuilder.createStaticMemberType(
1694-
RecordTy, VName, VUnit, LineNumber, VTy, Flags, C, Align);
1684+
RecordTy, VName, VUnit, LineNumber, VTy, Flags, /* Val */ nullptr, Align);
16951685
StaticDataMemberCache[Var->getCanonicalDecl()].reset(GV);
1686+
StaticDataMemberDefinitionsToEmit.push_back(Var->getCanonicalDecl());
16961687
return GV;
16971688
}
16981689

@@ -5596,6 +5587,44 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
55965587
TemplateParameters, Align));
55975588
}
55985589

5590+
void CGDebugInfo::EmitGlobalVariable(const VarDecl *VD) {
5591+
assert(CGM.getCodeGenOpts().hasReducedDebugInfo());
5592+
if (VD->hasAttr<NoDebugAttr>())
5593+
return;
5594+
5595+
if (!VD->hasInit())
5596+
return;
5597+
5598+
const auto CacheIt = DeclCache.find(VD);
5599+
if (CacheIt != DeclCache.end())
5600+
return;
5601+
5602+
auto const *InitVal = VD->evaluateValue();
5603+
if (!InitVal)
5604+
return;
5605+
5606+
llvm::DIFile *Unit = nullptr;
5607+
llvm::DIScope *DContext = nullptr;
5608+
unsigned LineNo;
5609+
StringRef DeclName, LinkageName;
5610+
QualType T;
5611+
llvm::MDTuple *TemplateParameters = nullptr;
5612+
collectVarDeclProps(VD, Unit, LineNo, T, DeclName, LinkageName,
5613+
TemplateParameters, DContext);
5614+
5615+
auto Align = getDeclAlignIfRequired(VD, CGM.getContext());
5616+
llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(VD);
5617+
llvm::DIExpression *InitExpr = createConstantValueExpression(VD, *InitVal);
5618+
5619+
// Omit linkage name for variable definitions that represent constants.
5620+
// There hasn't been a need from consumers yet to have it attached.
5621+
DeclCache[VD].reset(DBuilder.createGlobalVariableExpression(
5622+
TheCU, DeclName, /* LinkageName */ {}, Unit, LineNo,
5623+
getOrCreateType(T, Unit), true, true, InitExpr,
5624+
getOrCreateStaticDataMemberDeclarationOrNull(VD), TemplateParameters,
5625+
Align, Annotations));
5626+
}
5627+
55995628
void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var,
56005629
const VarDecl *D) {
56015630
assert(CGM.getCodeGenOpts().hasReducedDebugInfo());
@@ -5800,6 +5829,15 @@ void CGDebugInfo::setDwoId(uint64_t Signature) {
58005829
}
58015830

58025831
void CGDebugInfo::finalize() {
5832+
for (auto const *VD : StaticDataMemberDefinitionsToEmit) {
5833+
assert(VD->isStaticDataMember());
5834+
5835+
if (DeclCache.contains(VD))
5836+
continue;
5837+
5838+
EmitGlobalVariable(VD);
5839+
}
5840+
58035841
// Creating types might create further types - invalidating the current
58045842
// element and the size(), so don't cache/reference them.
58055843
for (size_t i = 0; i != ObjCInterfaceCache.size(); ++i) {

clang/lib/CodeGen/CGDebugInfo.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ class CGDebugInfo {
161161
llvm::DenseMap<const Decl *, llvm::TypedTrackingMDRef<llvm::DIDerivedType>>
162162
StaticDataMemberCache;
163163

164+
/// Keeps track of static data members for which we should emit a definition.
165+
std::vector<const VarDecl *> StaticDataMemberDefinitionsToEmit;
166+
164167
using ParamDecl2StmtTy = llvm::DenseMap<const ParmVarDecl *, const Stmt *>;
165168
using Param2DILocTy =
166169
llvm::DenseMap<const ParmVarDecl *, llvm::DILocalVariable *>;
@@ -526,6 +529,9 @@ class CGDebugInfo {
526529
/// Emit a constant global variable's debug info.
527530
void EmitGlobalVariable(const ValueDecl *VD, const APValue &Init);
528531

532+
/// Emit debug-info for a variable with a constant initializer.
533+
void EmitGlobalVariable(const VarDecl *VD);
534+
529535
/// Emit information about an external variable.
530536
void EmitExternalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl);
531537

clang/test/CodeGenCXX/debug-info-class.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,19 @@ int main(int argc, char **argv) {
116116
// CHECK-SAME: DIFlagFwdDecl
117117
// CHECK-NOT: identifier:
118118
// CHECK-SAME: ){{$}}
119+
120+
// CHECK: !DIGlobalVariableExpression(var: ![[HDR_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 52, DW_OP_stack_value))
121+
// CHECK: ![[HDR_VAR]] = distinct !DIGlobalVariable(name: "HdrSize",
122+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[HDR_VAR_DECL:[0-9]+]])
123+
// CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"
124+
// CHECK: ![[HDR_VAR_DECL]] = !DIDerivedType(tag: DW_TAG_member, name: "HdrSize"
125+
126+
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
127+
119128
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "I"
120129
// CHECK-NOT: DIFlagFwdDecl
121130
// CHECK-SAME: ){{$}}
122131

123-
// CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"
124132
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
125133
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "bar"
126134
// CHECK: !DICompositeType(tag: DW_TAG_union_type, name: "baz"
@@ -186,8 +194,5 @@ int main(int argc, char **argv) {
186194
// CHECK: [[G_INNER_I]] = !DIDerivedType(tag: DW_TAG_member, name: "j"
187195
// CHECK-SAME: baseType: ![[INT]]
188196

189-
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
190-
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "HdrSize"
191-
//
192197
// CHECK: ![[EXCEPTLOC]] = !DILocation(line: 100,
193198
// CHECK: ![[RETLOC]] = !DILocation(line: 99,
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// RUN: %clangxx -target arm64-apple-macosx11.0.0 -g -debug-info-kind=standalone %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK %s
2+
// RUN: %clangxx -target arm64-apple-macosx11.0.0 -g -debug-info-kind=limited %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK %s
3+
4+
enum class Enum : int {
5+
VAL = -1
6+
};
7+
8+
struct Empty {};
9+
struct Fwd;
10+
11+
constexpr auto func() { return 25; }
12+
13+
struct Foo {
14+
static constexpr int cexpr_int_with_addr = func();
15+
static constexpr int cexpr_int2 = func() + 1;
16+
static constexpr float cexpr_float = 2.0 + 1.0;
17+
static constexpr Enum cexpr_enum = Enum::VAL;
18+
static constexpr Empty cexpr_struct_with_addr{};
19+
static inline Enum inline_enum = Enum::VAL;
20+
21+
template<typename T, unsigned V>
22+
static constexpr auto cexpr_template = V;
23+
24+
static const auto empty_templated = cexpr_template<Fwd, 1>;
25+
};
26+
27+
int main() {
28+
Foo f;
29+
//Bar b;
30+
31+
// Force global variable definitions to be emitted.
32+
(void)&Foo::cexpr_int_with_addr;
33+
(void)&Foo::cexpr_struct_with_addr;
34+
35+
return Foo::cexpr_int_with_addr + Foo::cexpr_float
36+
+ (int)Foo::cexpr_enum + Foo::cexpr_template<short, 5>
37+
+ Foo::empty_templated;
38+
}
39+
40+
// CHECK: @{{.*}}cexpr_int_with_addr{{.*}} =
41+
// CHECK-SAME: !dbg ![[INT_GLOBAL:[0-9]+]]
42+
43+
// CHECK: @{{.*}}cexpr_struct_with_addr{{.*}} =
44+
// CHECK-SAME !dbg ![[EMPTY_GLOBAL:[0-9]+]]
45+
46+
// CHECK: !DIGlobalVariableExpression(var: ![[INT_VAR:[0-9]+]], expr: !DIExpression())
47+
// CHECK: ![[INT_VAR]] = distinct !DIGlobalVariable(name: "cexpr_int_with_addr", linkageName:
48+
// CHECK-SAME: isLocal: false, isDefinition: true, declaration: ![[INT_DECL:[0-9]+]])
49+
50+
// CHECK: ![[INT_DECL]] = !DIDerivedType(tag: DW_TAG_member, name: "cexpr_int_with_addr",
51+
// CHECK-SAME: flags: DIFlagStaticMember
52+
// CHECK-NOT: extraData:
53+
54+
// CHECK: ![[INT_DECL2:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "cexpr_int2",
55+
// CHECK-SAME: flags: DIFlagStaticMember
56+
// CHECK-NOT: extraData:
57+
58+
// CHECK: ![[FLOAT_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "cexpr_float",
59+
// CHECK-SAME: flags: DIFlagStaticMember
60+
// CHECK-NOT: extraData:
61+
62+
// CHECK: ![[ENUM_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "cexpr_enum",
63+
// CHECK-SAME: flags: DIFlagStaticMember
64+
// CHECK-NOT: extraData:
65+
66+
// CHECK: ![[EMPTY_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "cexpr_struct_with_addr",
67+
// CHECK-SAME: flags: DIFlagStaticMember
68+
// CHECK-NOT: extraData:
69+
70+
// CHECK: ![[IENUM_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "inline_enum",
71+
// CHECK-SAME: flags: DIFlagStaticMember
72+
// CHECK-NOT: extraData:
73+
74+
// CHECK: ![[EMPTY_TEMPLATED_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "empty_templated",
75+
// CHECK-SAME: flags: DIFlagStaticMember
76+
// CHECK-NOT: extraData:
77+
78+
// CHECK: ![[TEMPLATE_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "cexpr_template",
79+
// CHECK-SAME: flags: DIFlagStaticMember
80+
// CHECK-NOT: extraData:
81+
82+
// CHECK: !DIGlobalVariableExpression(var: ![[EMPTY_VAR:[0-9]+]], expr: !DIExpression())
83+
// CHECK: ![[EMPTY_VAR]] = distinct !DIGlobalVariable(name: "cexpr_struct_with_addr", linkageName:
84+
// CHECK-SAME: isLocal: false, isDefinition: true, declaration: ![[EMPTY_DECL]])
85+
86+
// CHECK: !DIGlobalVariableExpression(var: ![[INT_VAR2:[0-9]+]], expr: !DIExpression(DW_OP_constu, 26, DW_OP_stack_value))
87+
// CHECK: ![[INT_VAR2]] = distinct !DIGlobalVariable(name: "cexpr_int2"
88+
// CHECK-NOT: linkageName:
89+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[INT_DECL2]])
90+
91+
// CHECK: !DIGlobalVariableExpression(var: ![[FLOAT_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, {{.*}}, DW_OP_stack_value))
92+
// CHECK: ![[FLOAT_VAR]] = distinct !DIGlobalVariable(name: "cexpr_float"
93+
// CHECK-NOT: linkageName:
94+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[FLOAT_DECL]])
95+
96+
// CHECK: !DIGlobalVariableExpression(var: ![[ENUM_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, {{.*}}, DW_OP_stack_value))
97+
// CHECK: ![[ENUM_VAR]] = distinct !DIGlobalVariable(name: "cexpr_enum"
98+
// CHECK-NOT: linkageName:
99+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[ENUM_DECL]])
100+
101+
// CHECK: !DIGlobalVariableExpression(var: ![[IENUM_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, {{.*}}, DW_OP_stack_value))
102+
// CHECK: ![[IENUM_VAR]] = distinct !DIGlobalVariable(name: "inline_enum"
103+
// CHECK-NOT: linkageName:
104+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[IENUM_DECL]])
105+
106+
// CHECK: !DIGlobalVariableExpression(var: ![[EMPTY_TEMPLATED_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))
107+
// CHECK: ![[EMPTY_TEMPLATED_VAR]] = distinct !DIGlobalVariable(name: "empty_templated"
108+
// CHECK-NOT: linkageName:
109+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[EMPTY_TEMPLATED_DECL]])
110+
111+
// CHECK: !DIGlobalVariableExpression(var: ![[TEMPLATE_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 5, DW_OP_stack_value))
112+
// CHECK: ![[TEMPLATE_VAR]] = distinct !DIGlobalVariable(name: "cexpr_template"
113+
// CHECK-NOT: linkageName:
114+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[TEMPLATE_DECL]], templateParams: ![[TEMPLATE_PARMS_2:[0-9]+]])

clang/test/CodeGenCXX/debug-info-static-member.cpp

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,32 +63,32 @@ int C::a = 4;
6363
// CHECK-NOT: offset:
6464
// CHECK-SAME: flags: DIFlagStaticMember)
6565
//
66-
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "const_a"
67-
// CHECK-NOT: size:
68-
// CHECK-NOT: align:
69-
// CHECK-NOT: offset:
70-
// CHECK-SAME: flags: DIFlagStaticMember,
71-
// CHECK-SAME: extraData: i1 true)
72-
73-
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "const_b"
74-
// CHECK-NOT: size:
75-
// CHECK-NOT: align:
76-
// CHECK-NOT: offset:
77-
// CHECK-SAME: flags: DIFlagProtected | DIFlagStaticMember,
78-
// CHECK-SAME: extraData: float 0x{{.*}})
66+
// CHECK: ![[CONST_A_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "const_a"
67+
// CHECK-NOT: size:
68+
// CHECK-NOT: align:
69+
// CHECK-NOT: offset:
70+
// CHECK-SAME: flags: DIFlagStaticMember
71+
// CHECK-NOT: extraData:
72+
73+
// CHECK: ![[CONST_B_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "const_b"
74+
// CHECK-NOT: size:
75+
// CHECK-NOT: align:
76+
// CHECK-NOT: offset:
77+
// CHECK-SAME: flags: DIFlagProtected | DIFlagStaticMember
78+
// CHECK-NOT: extraData:
7979

8080
// CHECK: ![[DECL_C:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "c"
8181
// CHECK-NOT: size:
8282
// CHECK-NOT: align:
8383
// CHECK-NOT: offset:
8484
// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember)
8585
//
86-
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "const_c"
87-
// CHECK-NOT: size:
88-
// CHECK-NOT: align:
89-
// CHECK-NOT: offset:
90-
// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember,
91-
// CHECK-SAME: extraData: i32 18)
86+
// CHECK: ![[CONST_C_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "const_c"
87+
// CHECK-NOT: size:
88+
// CHECK-NOT: align:
89+
// CHECK-NOT: offset:
90+
// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember
91+
// CHECK-NOT: extraData:
9292
//
9393
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "x_a"
9494
// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember)
@@ -144,7 +144,7 @@ struct V {
144144
// const_va is not emitted for MS targets.
145145
// NOT-MS: !DIDerivedType(tag: DW_TAG_member, name: "const_va",
146146
// NOT-MS-SAME: line: [[@LINE-5]]
147-
// NOT-MS-SAME: extraData: i32 42
147+
// NOT-MS-NOT: extraData:
148148
const int V::const_va;
149149

150150
namespace x {
@@ -156,3 +156,15 @@ struct y {
156156
};
157157
int y::z;
158158
}
159+
160+
// CHECK: !DIGlobalVariableExpression(var: ![[CONST_A_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))
161+
// CHECK: ![[CONST_A_VAR]] = distinct !DIGlobalVariable(name: "const_a"
162+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[CONST_A_DECL]])
163+
164+
// CHECK: !DIGlobalVariableExpression(var: ![[CONST_B_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, {{.*}}, DW_OP_stack_value))
165+
// CHECK: ![[CONST_B_VAR]] = distinct !DIGlobalVariable(name: "const_b"
166+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[CONST_B_DECL]])
167+
168+
// CHECK: !DIGlobalVariableExpression(var: ![[CONST_C_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 18, DW_OP_stack_value))
169+
// CHECK: ![[CONST_C_VAR]] = distinct !DIGlobalVariable(name: "const_c"
170+
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[CONST_C_DECL]])

lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ def test(self):
102102
# it does not crash.
103103
self.expect("image lookup -t A")
104104

105-
# dsymutil strips the debug info for classes that only have const static
106-
# data members without a definition namespace scope.
107-
@expectedFailureAll(debug_info=["dsym"])
105+
# For debug-info produced by older versions of clang, dsymutil strips the
106+
# debug info for classes that only have const static data members without
107+
# definitions.
108+
@expectedFailureAll(compiler=["clang"], compiler_version=["<", "18.0"])
108109
def test_class_with_only_const_static(self):
109110
self.build()
110111
lldbutil.run_to_source_breakpoint(

lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ def verify_values(self, verify_dict, actual, varref_dict=None, expression=None):
8787
def verify_variables(self, verify_dict, variables, varref_dict=None):
8888
for variable in variables:
8989
name = variable["name"]
90-
self.assertIn(
91-
name, verify_dict, 'variable "%s" in verify dictionary' % (name)
92-
)
93-
self.verify_values(verify_dict[name], variable, varref_dict)
90+
if not name.startswith("std::"):
91+
self.assertIn(
92+
name, verify_dict, 'variable "%s" in verify dictionary' % (name)
93+
)
94+
self.verify_values(verify_dict[name], variable, varref_dict)
9495

9596
def darwin_dwarf_missing_obj(self, initCommands):
9697
self.build(debug_info="dwarf")

0 commit comments

Comments
 (0)