From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89498 invoked by alias); 16 Jun 2017 17:10:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 89484 invoked by uid 89); 16 Jun 2017 17:10:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=displaying, H*Ad:U*macro X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jun 2017 17:10:44 +0000 Received: from ralph.baldwin.cx.com (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D713410AF07; Fri, 16 Jun 2017 13:10:46 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Cc: macro@imgtec.com Subject: [PATCH v2] Don't throw an error in 'info registers' for unavailable MIPS registers. Date: Fri, 16 Jun 2017 17:10:00 -0000 Message-Id: <20170616170944.99055-1-jhb@FreeBSD.org> X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00464.txt.bz2 'info registers' for MIPS throws an error and when it first encounters an unavailable register. This does not match other architectures which annotate unavailable registers and continue to print out the values of subsequent registers. Replace the error by displaying an aligned "". This string is truncated to "" when displaying a 32-bit register. gdb/ChangeLog: * mips-tdep.c (print_gp_register_row): Don't error for unavailable registers. --- gdb/ChangeLog | 5 +++++ gdb/mips-tdep.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9062067bcf..26ea6fb8c7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-06-16 John Baldwin + + * mips-tdep.c (print_gp_register_row): Don't error for unavailable + registers. + 2017-06-16 Alan Hayward Pedro Alves Yao Qi diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c 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 ? "" + : ""); + col++; + continue; + } raw_buffer = value_contents_all (value); /* pad small registers */ for (byte = 0; -- 2.11.0