From patchwork Tue Jul 9 15:24:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33631 Received: (qmail 82465 invoked by alias); 9 Jul 2019 15:24:42 -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 82438 invoked by uid 89); 9 Jul 2019 15:24:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:3880, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Jul 2019 15:24:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 65879561B1; Tue, 9 Jul 2019 11:24:38 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 98WH3ySIiTRy; Tue, 9 Jul 2019 11:24:38 -0400 (EDT) Received: from murgatroyd.Home (174-29-36-25.hlrn.qwest.net [174.29.36.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 1009C561B0; Tue, 9 Jul 2019 11:24:37 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v3 1/4] Use field_core_addr in more places Date: Tue, 9 Jul 2019 09:24:33 -0600 Message-Id: <20190709152436.14078-2-tromey@adacore.com> In-Reply-To: <20190709152436.14078-1-tromey@adacore.com> References: <20190709152436.14078-1-tromey@adacore.com> MIME-Version: 1.0 This changes a few spots that use field_fmt to use field_core_addr instead. gdb/ChangeLog 2019-07-09 Tom Tromey * target.c (flash_erase_command): Use field_core_addr. * symfile.c (generic_load): Use field_core_addr. * sparc64-linux-tdep.c (sparc64_linux_handle_segmentation_fault): Use field_core_addr. * i386-linux-tdep.c (i386_linux_handle_segmentation_fault): Use field_core_addr. --- gdb/ChangeLog | 9 +++++++++ gdb/i386-linux-tdep.c | 6 +++--- gdb/sparc64-linux-tdep.c | 6 +++--- gdb/symfile.c | 2 +- gdb/target.c | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index d0d339d7dcb..760d00008f4 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -432,13 +432,13 @@ i386_linux_handle_segmentation_fault (struct gdbarch *gdbarch, uiout->field_string ("sigcode-meaning", _("Lower bound violation")); uiout->text (_(" while accessing address ")); - uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, access)); + uiout->field_core_addr ("bound-access", gdbarch, access); uiout->text (_("\nBounds: [lower = ")); - uiout->field_fmt ("lower-bound", "%s", paddress (gdbarch, lower_bound)); + uiout->field_core_addr ("lower-bound", gdbarch, lower_bound); uiout->text (_(", upper = ")); - uiout->field_fmt ("upper-bound", "%s", paddress (gdbarch, upper_bound)); + uiout->field_core_addr ("upper-bound", gdbarch, upper_bound); uiout->text (_("]")); } diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c index 158db97ec61..563d21e4b4c 100644 --- a/gdb/sparc64-linux-tdep.c +++ b/gdb/sparc64-linux-tdep.c @@ -150,19 +150,19 @@ sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch, uiout->text ("\n"); uiout->field_string ("sigcode-meaning", _("ADI disabled")); uiout->text (_(" while accessing address ")); - uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr)); + uiout->field_core_addr ("bound-access", gdbarch, addr); break; case SEGV_ADIDERR: /* disrupting mismatch */ uiout->text ("\n"); uiout->field_string ("sigcode-meaning", _("ADI deferred mismatch")); uiout->text (_(" while accessing address ")); - uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr)); + uiout->field_core_addr ("bound-access", gdbarch, addr); break; case SEGV_ADIPERR: /* precise mismatch */ uiout->text ("\n"); uiout->field_string ("sigcode-meaning", _("ADI precise mismatch")); uiout->text (_(" while accessing address ")); - uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr)); + uiout->field_core_addr ("bound-access", gdbarch, addr); break; default: break; diff --git a/gdb/symfile.c b/gdb/symfile.c index 13a07e4dc0e..caa0e79bd9a 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2095,7 +2095,7 @@ generic_load (const char *args, int from_tty) CORE_ADDR entry = bfd_get_start_address (loadfile_bfd.get ()); entry = gdbarch_addr_bits_remove (target_gdbarch (), entry); uiout->text ("Start address "); - uiout->field_fmt ("address", "%s", paddress (target_gdbarch (), entry)); + uiout->field_core_addr ("address", target_gdbarch (), entry); uiout->text (", load size "); uiout->field_fmt ("load-size", "%lu", total_progress.data_count); uiout->text ("\n"); diff --git a/gdb/target.c b/gdb/target.c index de3706d75dc..b3cfc53cca1 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3793,7 +3793,7 @@ flash_erase_command (const char *cmd, int from_tty) ui_out_emit_tuple tuple_emitter (current_uiout, "erased-regions"); current_uiout->message (_("Erasing flash memory region at address ")); - current_uiout->field_fmt ("address", "%s", paddress (gdbarch, m.lo)); + current_uiout->field_core_addr ("address", gdbarch, m.lo); current_uiout->message (", size = "); current_uiout->field_fmt ("size", "%s", hex_string (m.hi - m.lo)); current_uiout->message ("\n");