[Pdbg] [PATCH v4 08/30] libpdbg: Add a function to map virtual target to real
Alistair Popple
alistair at popple.id.au
Wed Oct 9 13:29:03 AEDT 2019
Reviewed-by: Alistair Popple <alistair at popple.id.au>
On Thursday, 3 October 2019 2:18:47 PM AEDT Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
> libpdbg/target.c | 8 ++++++++
> libpdbg/target.h | 1 +
> 2 files changed, 9 insertions(+)
>
> diff --git a/libpdbg/target.c b/libpdbg/target.c
> index 9110b81..20f292f 100644
> --- a/libpdbg/target.c
> +++ b/libpdbg/target.c
> @@ -473,3 +473,11 @@ bool target_is_virtual(struct pdbg_target *target)
> {
> return (!target->compatible);
> }
> +
> +struct pdbg_target *target_to_real(struct pdbg_target *target)
> +{
> + if (!target->compatible && target->vnode)
> + return target->vnode;
> +
> + return target;
> +}
> diff --git a/libpdbg/target.h b/libpdbg/target.h
> index f5769ea..5d04117 100644
> --- a/libpdbg/target.h
> +++ b/libpdbg/target.h
> @@ -65,5 +65,6 @@ const char *pdbg_get_backend_option(void);
>
> struct sbefifo *pib_to_sbefifo(struct pdbg_target *target);
> bool target_is_virtual(struct pdbg_target *target);
> +struct pdbg_target *target_to_real(struct pdbg_target *target);
>
> #endif
>
More information about the Pdbg
mailing list