[Pdbg] [PATCH 05/23] libpdbg: Support paths including virutal nodes

Amitay Isaacs amitay at ozlabs.org
Thu Sep 19 12:33:15 AEST 2019


With the presence of virtual nodes, some of the nodes can be reached
from the root using different paths:

  - using virtual nodes (which provide the system device tree view)
  - using the actual hwunits present in the backend (backend device tree)

Both device tree paths should result in the same hardware unit.

Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 libpdbg/device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libpdbg/device.c b/libpdbg/device.c
index 6e2e7bb..e4dc5c7 100644
--- a/libpdbg/device.c
+++ b/libpdbg/device.c
@@ -294,7 +294,10 @@ static struct pdbg_target *dt_find_by_path(struct pdbg_target *root, const char
 			if (pal && (pal != nal || strncmp(pa, na, pal)))
 				match = false;
 			if (match) {
-				root = n;
+				if (n->vnode)
+					root = n->vnode;
+				else
+					root = n;
 				break;
 			}
 		}
-- 
2.21.0



More information about the Pdbg mailing list