This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,23 @@ def update(self):
130130 def has_children (self ) -> bool :
131131 return False
132132
133+ def get_template_args (type_name : str ) -> List [str ]:
134+ params = []
135+ level = 0
136+ start = 0
137+ for i , c in enumerate (type_name ):
138+ if c == "<" :
139+ level += 1
140+ if level == 1 :
141+ start = i + 1
142+ elif c == ">" :
143+ level -= 1
144+ if level == 0 :
145+ params .append (type_name [start :i ].strip ())
146+ elif c == "," and level == 1 :
147+ params .append (type_name [start :i ].strip ())
148+ start = i + 1
149+ return params
133150
134151def SizeSummaryProvider (valobj : SBValue , _dict : LLDBOpaque ) -> str :
135152 return "size=" + str (valobj .GetNumChildren ())
@@ -1050,7 +1067,16 @@ def update(self):
10501067 ctrl = inner_table .GetChildMemberWithName ("ctrl" ).GetChildAtIndex (0 )
10511068
10521069 self .size = inner_table .GetChildMemberWithName ("items" ).GetValueAsUnsigned ()
1053- self .pair_type = table .type .template_args [0 ]
1070+
1071+ template_args = table .type .template_args
1072+
1073+ if template_args is None :
1074+ type_name = table .GetTypeName ()
1075+ args = get_template_args (type_name )
1076+ self .pair_type = self .valobj .target .FindFirstType (args [0 ])
1077+ else :
1078+ self .pair_type = template_args [0 ]
1079+
10541080 if self .pair_type .IsTypedefType ():
10551081 self .pair_type = self .pair_type .GetTypedefedType ()
10561082 self .pair_type_size = self .pair_type .GetByteSize ()
You can’t perform that action at this time.
0 commit comments