[Pdbg] [PATCH v3 11/22] main: Use dn_name for printing virtual nodes

Amitay Isaacs amitay at ozlabs.org
Mon Sep 23 18:48:30 AEST 2019


Virtual nodes do not have a class name.  When traversing system device
tree view, virtual nodes need to be handled correctly.  So instead of
skipping the nodes if classname is not set, print dn name for virtual
nodes.

Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
Reviewed-by: Alistair Popple <alistair at popple.id.au>
---
 src/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 44d1c55..f7f891a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -529,10 +529,10 @@ static void print_target(struct pdbg_target *target, int level)
 		printf("    ");
 
 	classname = pdbg_target_class_name(target);
-	if (!classname)
-		return;
-
-	printf("%s%d: %s", classname, pdbg_target_index(target), pdbg_target_name(target));
+	if (classname)
+		printf("%s%d: %s", classname, pdbg_target_index(target), pdbg_target_name(target));
+	else
+		printf("%s:", pdbg_target_dn_name(target));
 	if (path_target_selected(target))
 		printf(" (*)");
 	printf("\n");
-- 
2.21.0



More information about the Pdbg mailing list