summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@ozlabs.org>2018-11-16 14:54:25 +1100
committerAlistair Popple <alistair@popple.id.au>2018-11-16 15:33:29 +1100
commita42e204094dceac64d3cb342a489f0de9af98be6 (patch)
treed2d15b232acc22c59a222d7f9f778d86af081037
parent1d60e8b8410a946353c342a293e0e3445b1acc40 (diff)
downloadpdbg-a42e204094dceac64d3cb342a489f0de9af98be6.tar.gz
pdbg-a42e204094dceac64d3cb342a489f0de9af98be6.zip
main: Ignore nodes that do not have class names
It's possible that pdbg doesn't have hw units defined for all the nodes in the device tree. So if we encounter a node without class name ignore that node while matching path. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
-rw-r--r--src/path.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/path.c b/src/path.c
index 6b4e29b..0141085 100644
--- a/src/path.c
+++ b/src/path.c
@@ -222,6 +222,7 @@ static void path_pattern_match(struct pdbg_target *target,
{
struct pdbg_target *child;
char comp_name[MAX_PATH_COMP_LEN];
+ const char *classname;
char *tok;
int next = level;
bool found = false;
@@ -236,7 +237,11 @@ static void path_pattern_match(struct pdbg_target *target,
goto end;
}
- safe_strcpy(comp_name, sizeof(comp_name), pdbg_target_class_name(target));
+ classname = pdbg_target_class_name(target);
+ if (!classname)
+ goto end;
+
+ safe_strcpy(comp_name, sizeof(comp_name), classname);
if (pats[level].match_full) {
tok = comp_name;
} else {
OpenPOWER on IntegriCloud