This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Don't throw an error in 'info registers' for unavailable MIPS registers.
- From: "Maciej W. Rozycki" <macro at imgtec dot com>
- To: John Baldwin <jhb at FreeBSD dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 16 Jun 2017 21:08:46 +0100
- Subject: Re: [PATCH v2] Don't throw an error in 'info registers' for unavailable MIPS registers.
- Authentication-results: sourceware.org; auth=none
- References: <20170616170944.99055-1-jhb@FreeBSD.org>
On Fri, 16 Jun 2017, John Baldwin wrote:
> index 3ff2dab491..adc843a5be 100644
> --- a/gdb/mips-tdep.c
> +++ b/gdb/mips-tdep.c
> @@ -6542,8 +6542,14 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
> value = get_frame_register_value (frame, regnum);
> if (value_optimized_out (value)
> || !value_entirely_available (value))
> - error (_("can't read register %d (%s)"),
> - regnum, gdbarch_register_name (gdbarch, regnum));
> + {
> + fprintf_filtered (file, "%*s ",
> + (int) mips_abi_regsize (gdbarch) * 2,
> + mips_abi_regsize (gdbarch) == 4 ? "<unavl>"
> + : "<unavailable>");
Formatting nit here -- you need to wrap an expression in parentheses when
splitting between lines and indent accordingly, i.e. either:
+ (mips_abi_regsize (gdbarch) == 4 ? "<unavl>"
+ : "<unavailable>"));
or:
+ (mips_abi_regsize (gdbarch) == 4
+ ? "<unavl>" : "<unavailable>"));
> + col++;
> + continue;
> + }
Otherwise LGTM, so please consider your patch with such a change applied
preapproved.
I think that duplicate `col++' could be avoided, as could be the repeated
calls to `mips_abi_regsize' and `register_size'. That can be a separate
clean-up though.
Thanks for your work on this problem.
Maciej