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: [RFA] fix "ptype $pc" internal-error


Joel Brobecker <brobecker@adacore.com> writes:

> Index: eval.c
> ===================================================================
> --- eval.c	(revision 65)
> +++ eval.c	(revision 66)
> @@ -512,7 +512,15 @@ evaluate_subexp_standard (struct type *e
>  					  name, strlen (name));
>  	if (regno == -1)
>  	  error (_("Register $%s not available."), name);
> -	if (noside == EVAL_AVOID_SIDE_EFFECTS)
> +
> +        /* In EVAL_AVOID_SIDE_EFFECTS mode, we only need to return
> +           a value with the appropriate register type.  Unfortunately,
> +           we don't have easy access to the type of user registers.
> +           So for these registers, we fetch the register value regardless
> +           of the evaluation mode.  */
> +	if (noside == EVAL_AVOID_SIDE_EFFECTS
> +	    && regno < gdbarch_num_regs (current_gdbarch)
> +	       + gdbarch_num_pseudo_regs (current_gdbarch))

Indentation is off here.

	if (noside == EVAL_AVOID_SIDE_EFFECTS
	    && regno < (gdbarch_num_regs (current_gdbarch)
		        + gdbarch_num_pseudo_regs (current_gdbarch)))

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"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]