Skip to content

Commit 8e441d4

Browse files
[SYCL][GDB] Relax xmethod script template arg handling (#3256)
Depending on namespace inlining the template argument string may end being "sycl:id<1>" or just "id<1>" rather than full "cl::sycl::id<1>" currently expected. Ideally a proper type lookup should happen, however, right now GDB does not support inline namespaces so such lookup would always fail. This patch relaxes regex matching instead as a compromise solution. It does not seem possible to test this change within this repository, unfortunately. It was manually verified at the moment of submission and will be caught eventually by the debugger tests in case of regressions.
1 parent af43149 commit 8e441d4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sycl/gdb/libsycl.so-gdb.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def get_result_type(self, *args):
176176
return self.result_type
177177

178178
def __call__(self, obj, *args):
179-
if obj['Val'].type.tag == self.result_type:
179+
if obj['Val'].type.tag.endswith(self.result_type):
180180
# On device private_memory is a simple wrapper over actual value
181181
return obj['Val']
182182
else:
@@ -196,11 +196,10 @@ def match(self, class_type, method_name):
196196
if method_name != 'operator()':
197197
return None
198198

199-
result = re.match('^cl::sycl::private_memory<(cl::sycl::id<.+>), (.+)>$', class_type.tag)
199+
result = re.match('^cl::sycl::private_memory<((cl::)?(sycl::)?id<.+>), (.+)>$', class_type.tag)
200200
if result is None:
201201
return None
202-
203-
return PrivateMemoryOpCall(result[1], result[2])
202+
return PrivateMemoryOpCall(result[1], result[4])
204203

205204

206205

0 commit comments

Comments
 (0)