This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] fix "ptype $pc" internal-error
- From: Andreas Schwab <schwab at suse dot de>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 04 Jan 2008 11:36:03 +0100
- Subject: Re: [RFA] fix "ptype $pc" internal-error
- References: <20080104094316.GO2179@adacore.com>
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."