[Pdbg] [PATCH v4 07/30] libpdbg: Add a function to check if a target is virtual

Alistair Popple alistair at popple.id.au
Wed Oct 9 13:24:12 AEDT 2019


Nice. Now I feel like I know what a virtual target is :-)

Reviewed-by: Alistair Popple <alistair at popple.id.au>

On Thursday, 3 October 2019 2:18:46 PM AEDT Amitay Isaacs wrote:
> All targets without "compatible" property are treated as virtual targets.
> 
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
>  libpdbg/target.c | 6 ++++++
>  libpdbg/target.h | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/libpdbg/target.c b/libpdbg/target.c
> index f803ab2..9110b81 100644
> --- a/libpdbg/target.c
> +++ b/libpdbg/target.c
> @@ -467,3 +467,9 @@ void pdbg_target_priv_set(struct pdbg_target *target, void *priv)
>  {
>  	target->priv = priv;
>  }
> +
> +/* For virtual nodes, compatible property is not set */
> +bool target_is_virtual(struct pdbg_target *target)
> +{
> +	return (!target->compatible);
> +}
> diff --git a/libpdbg/target.h b/libpdbg/target.h
> index 71ffd2f..f5769ea 100644
> --- a/libpdbg/target.h
> +++ b/libpdbg/target.h
> @@ -64,5 +64,6 @@ extern struct list_head target_classes;
>  const char *pdbg_get_backend_option(void);
>  
>  struct sbefifo *pib_to_sbefifo(struct pdbg_target *target);
> +bool target_is_virtual(struct pdbg_target *target);
>  
>  #endif
> 






More information about the Pdbg mailing list