Skip to content

Commit

Permalink
dm: handle NULL hc.uuid
Browse files Browse the repository at this point in the history
Orabug: 37176287
Signed-off-by: Richard Li <tianqi.li@oracle.com>
  • Loading branch information
richl9 authored and brenns10 committed Oct 16, 2024
1 parent b05ecde commit fdf8f54
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drgn_tools/dm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@ def for_each_dm_hash(prog: Program) -> Iterable[Tuple[Object, str, str]]:
for hc in list_for_each_entry(
"struct hash_cell", head.address_of_(), "name_list"
):
yield hc.md, hc.name.string_().decode(), hc.uuid.string_().decode()
uuid = ""
if hc.uuid:
uuid = hc.uuid.string_().decode()

yield hc.md, hc.name.string_().decode(), uuid


def for_each_dm_rbtree(prog: Program) -> Iterable[Tuple[Object, str, str]]:
for hc in rbtree_inorder_for_each_entry(
"struct hash_cell", prog["name_rb_tree"], "name_node"
):
yield hc.md, hc.name.string_().decode(), hc.uuid.string_().decode()
uuid = ""
if hc.uuid:
uuid = hc.uuid.string_().decode()

yield hc.md, hc.name.string_().decode(), uuid


def for_each_dm(prog: Program) -> Iterable[Tuple[Object, str, str]]:
Expand Down

0 comments on commit fdf8f54

Please sign in to comment.