forked from Imagelibrary/binutils-gdb
Have DAP handle non-Value results from 'children'
A pretty-printer's 'children' method may return values other than a gdb.Value -- it may return any value that can be converted to a gdb.Value. I noticed that this case did not work for DAP. This patch fixes the problem.
This commit is contained in:
@@ -199,9 +199,14 @@ class VariableReference(BaseReference):
|
||||
if isinstance(self.printer, gdb.ValuePrinter) and hasattr(
|
||||
self.printer, "child"
|
||||
):
|
||||
return self.printer.child(idx)
|
||||
(name, val) = self.printer.child(idx)
|
||||
else:
|
||||
return self.cache_children()[idx]
|
||||
(name, val) = self.cache_children()[idx]
|
||||
# A pretty-printer can return something other than a
|
||||
# gdb.Value, but it must be convertible.
|
||||
if not isinstance(val, gdb.Value):
|
||||
val = gdb.Value(val)
|
||||
return (name, val)
|
||||
|
||||
|
||||
@in_gdb_thread
|
||||
|
||||
Reference in New Issue
Block a user