From patchwork Wed Apr 12 18:37:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 20003 Received: (qmail 73634 invoked by alias); 12 Apr 2017 18:45:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 73424 invoked by uid 89); 12 Apr 2017 18:45:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.8 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= 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; Wed, 12 Apr 2017 18:45:55 +0000 Received: from ralph.baldwin.cx.net (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7841410A87D for ; Wed, 12 Apr 2017 14:37:43 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH 4/4] Don't throw an error in 'info registers' for unavailable MIPS GP registers. Date: Wed, 12 Apr 2017 11:37:27 -0700 Message-Id: <20170412183727.22483-5-jhb@FreeBSD.org> In-Reply-To: <20170412183727.22483-1-jhb@FreeBSD.org> References: <20170412183727.22483-1-jhb@FreeBSD.org> X-IsSubscribed: yes '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 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 f1ac925fec..96a187667d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2017-04-11 John Baldwin + * mips-tdep.c (print_gp_register_row): Don't error for unavailable + registers. + +2017-04-11 John Baldwin + * mips-tdep.c (print_gp_register_row): Replace printf_filtered with fprintf_filtered. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 674b5098b0..4ec0c31341 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -6533,8 +6533,14 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, /* OK: get the data in raw format. */ if (!deprecated_frame_register_read (frame, regnum, raw_buffer)) - error (_("can't read register %d (%s)"), - regnum, gdbarch_register_name (gdbarch, regnum)); + { + fprintf_filtered (file, "%*.*s ", + (int) mips_abi_regsize (gdbarch) * 2, + (int) mips_abi_regsize (gdbarch) * 2, + ""); + col++; + continue; + } /* pad small registers */ for (byte = 0; byte < (mips_abi_regsize (gdbarch)