Skip to content

Commit

Permalink
fix dm and Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Li <[email protected]>
  • Loading branch information
richl9 committed Sep 18, 2024
1 parent 80e126e commit da9d6d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ drgn_tools/_version.py:
.PHONY: rsync
rsync: drgn_tools/_version.py
@if [ -z "$(TARGET)" ]; then echo "error: TARGET unspecified. Either set it in config.mk, or use\nmake TARGET=hostname rsync"; exit 1; fi
rsync -avz --exclude "__pycache__" --exclude ".git" --exclude ".mypy_cache" ./drgn_tools $(TARGET):drgn_tools/
rsync -avz --exclude "__pycache__" --exclude ".git" --exclude ".mypy_cache" ./drgn_tools $(TARGET)
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 da9d6d5

Please sign in to comment.