From ede74a4ed0631266bfcc1c9919cead2262b497a7 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Thu, 9 Aug 2018 15:19:27 +1000 Subject: main: Fix print_target to only print selected targets Signed-off-by: Amitay Isaacs Reviewed-by: Alistair Popple --- src/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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"); -- cgit v1.2.3