Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Alan Modra via Gdb-patches <gdb-patches@sourceware.org>
Cc: Alan Modra <amodra@gmail.com>
Subject: Re: Don't use BFD_VMA_FMT in gdb and sim
Date: Thu, 04 Aug 2022 11:59:25 -0600	[thread overview]
Message-ID: <87zggjga9u.fsf@tromey.com> (raw)
In-Reply-To: <YutZ4b8VGvQ5vDQd@squeak.grove.modra.org> (Alan Modra via Gdb-patches's message of "Thu, 4 Aug 2022 15:02:17 +0930")

>>>>> "Alan" == Alan Modra via Gdb-patches <gdb-patches@sourceware.org> writes:

Alan> Like commit b82817674f, this replaces BFD_VMA_FMT "x" with PRIx64,
Alan> and casts to promote bfd_vma to uint64_t.

Alan> Tested with both 64-bit and 32-bit gdb builds, and 64-bit make check.
Alan> OK to install?

Alan> diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
Alan> index 2516e4ed058..c2823191b42 100644
Alan> --- a/gdb/windows-tdep.c
Alan> +++ b/gdb/windows-tdep.c
Alan> @@ -1011,10 +1011,10 @@ is_linked_with_cygwin_dll (bfd *abfd)
Alan>        || import_table_va >= idata_section_end_va)
Alan>      {
Alan>        warning (_("\
Alan> -%s: import table's virtual address (0x%" BFD_VMA_FMT "x) is outside .idata \
Alan> -section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."),
Alan> -	       bfd_get_filename (abfd), import_table_va, idata_section_va,
Alan> -	       idata_section_end_va);
Alan> +%s: import table's virtual address (0x%" PRIx64 ") is outside .idata \
Alan> +section's range [0x%" PRIx64 ", 0x%" PRIx64 "[."),
Alan> +	       bfd_get_filename (abfd), (uint64_t) import_table_va,
Alan> +	       (uint64_t) idata_section_va, (uint64_t) idata_section_end_va);

For gdb, it's more normal to use %s and 'hex_string (value)'.
hex_string will add the 0x as well.  It's fine to call it multiple times
in a single printf.

thanks,
Tom

  reply	other threads:[~2022-08-04 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  5:32 Alan Modra via Gdb-patches
2022-08-04 17:59 ` Tom Tromey [this message]
2022-08-05 11:21   ` Alan Modra via Gdb-patches
2022-08-05 15:29     ` 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=87zggjga9u.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=amodra@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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