Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ondrej Oprala <ooprala@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
Subject: Re: [PATCH 17/18] fix gdbarch buglet
Date: Tue, 22 Oct 2013 06:20:00 -0000	[thread overview]
Message-ID: <52661923.4050405@redhat.com> (raw)
In-Reply-To: <52654F94.3040204@redhat.com>

On 10/21/2013 06:00 PM, Pedro Alves wrote:
> It looks like the patch is about implicit int <-> enum
> conversions, which a C++ compiler would complain about.
> But the subject talks about a buglet -- what's the bug this
> fixes?
I'm not entirely sure TBH, this is the subject Tom gave it,
so he can probably tell us more.
>
> Please always include a rationale for a change in the body
> of the email.
>
> On 10/21/2013 04:37 PM, Ondrej Oprala wrote:
>> From: Tom Tromey <tromey@redhat.com>
>>
>> gdb/ChangeLog:
>>
>> 2013-10-09  Tom Tromey  <tromey@redhat.com>
>>
>> 	* gdbarch.c: Regenerate.
>> 	(byte_order_for_code): Likewise.
> This "Likewise" doesn't make sense when you read this
> entry sequentially (as one should and will).
My bad, that line should have been omitted, as should
the others under regenerated files (fixed below).
>
>> 	(gdbarch_byte_order): Change type of the return value.
>> 	(gdbarch_byte_order_for_code): Likewise.
>> 	* gdbarch.h: Regenerate.
>> 	* gdbarch.sh (byte_order): Change the return type.
>> 	(byte_order_for_code): Likewise.

From: Tom Tromey<tromey@redhat.com>

gdb/ChangeLog

2013-10-09  Tom Tromey<tromey@redhat.com>

	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* gdbarch.sh (byte_order): Change the return type.
	(byte_order_for_code): Likewise.
---
  gdb/gdbarch.c  | 8 ++++----
  gdb/gdbarch.h  | 4 ++--
  gdb/gdbarch.sh | 4 ++--
  3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 396bb67..3b82605 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -99,8 +99,8 @@ struct gdbarch
  
    /* basic architectural information.  */
    const struct bfd_arch_info * bfd_arch_info;
-  int byte_order;
-  int byte_order_for_code;
+  enum bfd_endian byte_order;
+  enum bfd_endian byte_order_for_code;
    enum gdb_osabi osabi;
    const struct target_desc * target_desc;
  
@@ -1444,7 +1444,7 @@ gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
    return gdbarch->bfd_arch_info;
  }
  
-int
+enum bfd_endian
  gdbarch_byte_order (struct gdbarch *gdbarch)
  {
    gdb_assert (gdbarch != NULL);
@@ -1453,7 +1453,7 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
    return gdbarch->byte_order;
  }
  
-int
+enum bfd_endian
  gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
  {
    gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index b58efc8..92e3ddf 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -91,10 +91,10 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
  extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
  /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized.  */
  
-extern int gdbarch_byte_order (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order (struct gdbarch *gdbarch);
  /* set_gdbarch_byte_order() - not applicable - pre-initialized.  */
  
-extern int gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
+extern enum bfd_endian gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
  /* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized.  */
  
  extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index fa9731d..2fe535e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -340,8 +340,8 @@ function_list ()
    cat <<EOF
  i:const struct bfd_arch_info *:bfd_arch_info:::&bfd_default_arch_struct::::gdbarch_bfd_arch_info (gdbarch)->printable_name
  #
-i:int:byte_order:::BFD_ENDIAN_BIG
-i:int:byte_order_for_code:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order:::BFD_ENDIAN_BIG
+i:enum bfd_endian:byte_order_for_code:::BFD_ENDIAN_BIG
  #
  i:enum gdb_osabi:osabi:::GDB_OSABI_UNKNOWN
  #
-- 1.8.3.1


  reply	other threads:[~2013-10-22  6:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
2013-10-21 15:37 ` [PATCH 13/18] poison "typename" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 15/18] fix up vec Ondrej Oprala
2013-10-21 15:37 ` [PATCH 01/18] poison "class" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 05/18] poison "private" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
2013-10-21 16:00   ` Pedro Alves
2013-10-22  6:20     ` Ondrej Oprala [this message]
2013-10-21 15:37 ` [PATCH 03/18] poison "this" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 02/18] poison "new" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 14/18] poison "using" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 11/18] poison "template" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 12/18] poison "try" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 09/18] poison "namespace" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 07/18] poison "explicit" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 18/18] un-nest enum pvk Ondrej Oprala
2013-10-21 15:37 ` [PATCH 10/18] poison "operator" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 08/18] poison "mutable" Ondrej Oprala
2013-10-21 15:58 ` [PATCH 16/18] fix up gdbtypes.h Ondrej Oprala
2013-10-21 16:11 ` [PATCH 06/18] poison "delete" Ondrej Oprala
2013-10-21 17:00 ` [PATCH 04/18] poison "public" Ondrej Oprala
  -- strict thread matches above, loose matches on Subject: below --
2013-10-09 17:17 [PATCH 00/18] -Wc++-compat patches Ondrej Oprala
2013-10-09 17:18 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
2013-10-13 17:35   ` Jan Kratochvil

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=52661923.4050405@redhat.com \
    --to=ooprala@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.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