[Pdbg] [PATCH 2/3] istep: Use the first sbefifo to run isteps

Alistair Popple alistair at popple.id.au
Thu Jul 11 15:35:12 AEST 2019


Does this just affect the default sbefifo? Ie. does it prevent a user explicitly 
targeting the secondary sbefifo with -P sbefifo1 ? Seems like we should be able 
to target either (although to be honest I'm not sure how much sense that makes 
in practice as I haven't tried starting the secondary SBE yet).

- Alistair

On Thursday, 4 July 2019 6:11:32 PM AEST Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
>  src/istep.c | 27 +++++++++++++++------------
>  1 file changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/src/istep.c b/src/istep.c
> index a9acbe7..a141a31 100644
> --- a/src/istep.c
> +++ b/src/istep.c
> @@ -34,8 +34,18 @@ struct istep_data {
> 
>  static int istep(uint32_t major, uint32_t minor)
>  {
> -	struct pdbg_target *target;
> -	int count = 0, i;
> +	struct pdbg_target *sbefifo;
> +	int count = 0, i, rc;
> +
> +	for_each_path_target_class("sbefifo", sbefifo) {
> +		if (pdbg_target_status(sbefifo) == PDBG_TARGET_ENABLED)
> +			break;
> +	}
> +
> +	if (sbefifo == NULL) {
> +		fprintf(stderr, "No sbefifo found to run isteps\n");
> +		return 0;
> +	}
> 
>  	if (major < 2 || major > 5) {
>  		fprintf(stderr, "Istep major should be 2 to 5\n");
> @@ -56,16 +66,9 @@ static int istep(uint32_t major, uint32_t minor)
>  		}
>  	}
> 
> -	for_each_path_target_class("sbefifo", target) {
> -		int rc;
> -
> -		if (pdbg_target_status(target) != PDBG_TARGET_ENABLED)
> -			continue;
> -
> -		rc = sbe_istep(target, major, minor);
> -		if (!rc)
> -			count++;
> -	}
> +	rc = sbe_istep(sbefifo, major, minor);
> +	if (!rc)
> +		count++;
> 
>  	return count;
>  }






More information about the Pdbg mailing list