public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] ODR warning for "struct instruction_type"
@ 2022-06-02 15:29 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-06-02 15:29 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cc55e4ef62f102c4aff3b34ee2a134cdcc734897

commit cc55e4ef62f102c4aff3b34ee2a134cdcc734897
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed May 18 09:45:33 2022 -0600

    ODR warning for "struct instruction_type"
    
    "struct instruction_type" is defined in multiple .c files, causing an
    ODR warning.  This patch renames the types.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395

Diff:
---
 gdb/ia64-tdep.c | 8 ++++----
 gdb/z80-tdep.c  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index dd6d5b199b2..82456dc9c98 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -75,7 +75,7 @@ static gdb::optional<gdb::byte_vector> ktab_buf;
 
 /* An enumeration of the different IA-64 instruction types.  */
 
-enum instruction_type
+enum ia64_instruction_type
 {
   A,			/* Integer ALU ;    I-unit or M-unit */
   I,			/* Non-ALU integer; I-unit */
@@ -470,7 +470,7 @@ replace_slotN_contents (gdb_byte *bundle, long long instr, int slotnum)
   replace_bit_field (bundle, instr, 5+41*slotnum, 41);
 }
 
-static const enum instruction_type template_encoding_table[32][3] =
+static const enum ia64_instruction_type template_encoding_table[32][3] =
 {
   { M, I, I },				/* 00 */
   { M, I, I },				/* 01 */
@@ -510,7 +510,7 @@ static const enum instruction_type template_encoding_table[32][3] =
    address of the next instruction to fetch.  */
 
 static CORE_ADDR
-fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
+fetch_instruction (CORE_ADDR addr, ia64_instruction_type *it, long long *instr)
 {
   gdb_byte bundle[BUNDLE_LEN];
   int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER;
@@ -1363,7 +1363,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc,
 {
   CORE_ADDR next_pc;
   CORE_ADDR last_prologue_pc = pc;
-  instruction_type it;
+  ia64_instruction_type it;
   long long instr;
   int cfm_reg  = 0;
   int ret_reg  = 0;
diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
index c2d906d1402..196884af770 100644
--- a/gdb/z80-tdep.c
+++ b/gdb/z80-tdep.c
@@ -109,7 +109,7 @@ struct z80_unwind_cache
   struct trad_frame_saved_reg *saved_regs;
 };
 
-enum instruction_type
+enum z80_instruction_type
 {
   insn_default,
   insn_z80,
@@ -144,7 +144,7 @@ struct insn_info
   gdb_byte code;
   gdb_byte mask;
   gdb_byte size; /* without prefix(es) */
-  enum instruction_type type;
+  enum z80_instruction_type type;
 };
 
 /* Constants */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-02 15:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 15:29 [binutils-gdb] ODR warning for "struct instruction_type" Tom Tromey

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).