[Pdbg] [PATCH v2 11/22] main: Use dn_name for printing virtual nodes
Alistair Popple
alistair at popple.id.au
Mon Sep 23 13:41:47 AEST 2019
Using the class name for paths was a crutch to get around path variance due to
the different backends. This series hopefully solves that issue though so we
should go revisit how we handle paths in the library more generally but this
looks good for now.
Reviewed-by: Alistair Popple <alistair at popple.id.au>
On Friday, 20 September 2019 3:16:40 PM AEST Amitay Isaacs wrote:
> 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>
> ---
> 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");
>
More information about the Pdbg
mailing list