Skip to content

Commit

Permalink
Walker should check canonicalized type names
Browse files Browse the repository at this point in the history
As we know, drgn type equality does not work right, so we need to
compare canonicalized type names.

When combined with openzfs/zfs#10236,
`zfs_dbgmsg` now works on ztest core dumps.
  • Loading branch information
ahrens committed Apr 21, 2020
1 parent 47debdd commit 1327a71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdb/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ def _call(self, objs: Iterable[drgn.Object]) -> Iterable[drgn.Object]:
the types as we go.
"""
assert self.input_type is not None
type_ = target.get_type(self.input_type)
expected_type = type_canonicalize_name(self.input_type)
for obj in objs:
if obj.type_ != type_:
if type_canonical_name(obj.type_) != expected_type:
raise CommandError(
self.name,
'expected input of type {}, but received {}'.format(
type_, obj.type_))
expected_type, type_canonical_name(obj.type_)))

yield from self.walk(obj)

Expand Down

0 comments on commit 1327a71

Please sign in to comment.