summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@ozlabs.org>2018-08-09 15:19:27 +1000
committerAlistair Popple <alistair@popple.id.au>2018-08-13 15:38:28 +1000
commitede74a4ed0631266bfcc1c9919cead2262b497a7 (patch)
tree724088751220ee8209410f77349a4f414ac512c1 /src
parentbc92bf17a34bc364f477fd82722da97d29a6fc57 (diff)
downloadpdbg-ede74a4ed0631266bfcc1c9919cead2262b497a7.tar.gz
pdbg-ede74a4ed0631266bfcc1c9919cead2262b497a7.zip
main: Fix print_target to only print selected targets
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'src')
-rw-r--r--src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 1ab0cff..b446b5b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -769,6 +769,9 @@ void print_target(struct pdbg_target *target, int level)
}
pdbg_for_each_child_target(target, next) {
+ if (!target_selected(next))
+ continue;
+
print_target(next, level + 1);
}
}
@@ -777,8 +780,12 @@ static int probe(void)
{
struct pdbg_target *target;
- pdbg_for_each_class_target("pib", target)
+ pdbg_for_each_class_target("pib", target) {
+ if (!target_selected(target))
+ continue;
+
print_target(target, 0);
+ }
printf("\nNote that only selected targets will be shown above. If none are shown\n"
"try adding '-a' to select all targets\n");
OpenPOWER on IntegriCloud