public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] Use field_core_addr in more places
Date: Tue, 02 Jul 2019 09:40:00 -0000	[thread overview]
Message-ID: <20190702094036.GX23204@embecosm.com> (raw)
In-Reply-To: <20190701200058.16235-2-tromey@adacore.com>

* Tom Tromey <tromey@adacore.com> [2019-07-01 14:00:56 -0600]:

> This changes a few spots that use field_fmt to use field_core_addr
> instead.
> 
> gdb/ChangeLog
> 2019-07-01  Tom Tromey  <tromey@adacore.com>
> 
> 	* 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.

Looks good to me.

Thanks,
Andrew
> ---
>  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 74f429b49af..b5c3ef2b71e 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 6f9c81c8b94..58049a544b5 100644
> --- a/gdb/symfile.c
> +++ b/gdb/symfile.c
> @@ -2081,7 +2081,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 1c04095fd63..febb3390339 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");
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-07-02  9:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01 20:01 [PATCH 0/3] replace many uses of field_fmt Tom Tromey
2019-07-01 20:01 ` [PATCH 1/3] Use field_core_addr in more places Tom Tromey
2019-07-02  9:40   ` Andrew Burgess [this message]
2019-07-01 20:01 ` [PATCH 3/3] Introduce field_unsigned Tom Tromey
2019-07-02  6:43   ` Metzger, Markus T
2019-07-02 12:23     ` Tom Tromey
2019-07-02 12:41       ` Metzger, Markus T
2019-07-02 15:01         ` Tom Tromey
2019-07-01 20:01 ` [PATCH 2/3] Use field_string in more places Tom Tromey
2019-07-02  9:39   ` Andrew Burgess
2019-07-02 12:24     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190702094036.GX23204@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).