Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c
Date: Thu, 12 Mar 2020 11:58:55 -0600	[thread overview]
Message-ID: <87lfo5jvz4.fsf@tromey.com> (raw)
In-Reply-To: <a5f18235-6969-d756-a3e7-ecb3f562f8d8@simark.ca> (Simon Marchi's message of "Tue, 10 Mar 2020 23:38:06 -0400")

Simon> Did you consider changing arm_mapping_symbol::value to be a
Simon> CORE_ADDR?  It would seem even simpler and safe to me.

For some reason I thought this was harder, but I tried it and it is
fine.  Here's the updated patch.

Tom

commit a01a37e95dc6927020783184eff1c82660b1cbf5
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Mar 10 16:09:37 2020 -0600

    Cast to bfd_vma in arm-tdep.c
    
    Some arm-tdep.c data structures use a bfd_vma.  A couple of spots will
    warn about an implicit narrowing cast when building a gdb where
    CORE_ADDR is 64-bit but bfd_vma is 32-bit.
    
    This patch silences these warnings by changing the types in question
    to CORE_ADDR.
    
    gdb/ChangeLog
    2020-03-10  Tom Tromey  <tom@tromey.com>
    
            * arm-tdep.c (struct arm_mapping_symbol) <value>: Now a
            CORE_ADDR.
            (struct arm_exidx_entry) <addr>: Now a CORE_ADDR.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 86bbcaaa39f..280cf03a6a6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-10  Tom Tromey  <tom@tromey.com>
+
+	* arm-tdep.c (struct arm_mapping_symbol) <value>: Now a
+	CORE_ADDR.
+	(struct arm_exidx_entry) <addr>: Now a CORE_ADDR.
+
 2020-03-10  Tom Tromey  <tom@tromey.com>
 
 	* remote.c (remote_target::download_tracepoint)
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 175c5b956e7..44c439a85f5 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -81,7 +81,7 @@ static bool arm_debug;
 
 struct arm_mapping_symbol
 {
-  bfd_vma value;
+  CORE_ADDR value;
   char type;
 
   bool operator< (const arm_mapping_symbol &other) const
@@ -1986,7 +1986,7 @@ struct frame_unwind arm_prologue_unwind = {
 
 struct arm_exidx_entry
 {
-  bfd_vma addr;
+  CORE_ADDR addr;
   gdb_byte *entry;
 
   bool operator< (const arm_exidx_entry &other) const


  reply	other threads:[~2020-03-12 17:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
2020-02-25 22:22 ` [PATCH v2 6/6] " Tom Tromey
2020-02-25 22:22 ` [PATCH v2 1/6] Fix CORE_ADDR size assertion in symfile-mem.c Tom Tromey
2020-02-25 22:22 ` [PATCH v2 5/6] Change gdbsupport not to rely on BFD Tom Tromey
2020-02-25 22:22 ` [PATCH v2 4/6] Fix gdbserver build when intl already built Tom Tromey
2020-02-25 22:22 ` [PATCH v2 2/6] Don't use sprintf_vma for CORE_ADDR Tom Tromey
2020-02-25 22:22 ` [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c Tom Tromey
2020-03-11  3:38   ` Simon Marchi
2020-03-12 17:58     ` Tom Tromey [this message]
2020-03-12 18:05       ` Simon Marchi
2020-03-12 19:35         ` Tom Tromey
2020-03-11  0:30 ` [PATCH v2 0/6] Change gdbserver to use existing gdbsupport 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=87lfo5jvz4.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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