This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses


On Mär 15 2018, vlad.ivanov@lab-systems.ru wrote:

> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index 454fda7684..247ec34857 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -6999,7 +6999,10 @@ adjust_breakpoint_address (struct gdbarch *gdbarch,
>  	  adjusted_bpaddr = gdbarch_adjust_breakpoint_address (gdbarch, bpaddr);
>  	}
>  
> -      adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr);
> +      /* Don't cut out "insignificant" address bits on targets with
> +	 signed PC.  */
> +      if (!gdbarch_pc_signed (gdbarch))
> +	adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr);

Shouldn't it be sign-extended instead?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]