From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 11/14] ODR warnings for "struct insn_info"
Date: Wed, 18 May 2022 12:00:46 -0600 [thread overview]
Message-ID: <20220518180049.2337257-12-tromey@adacore.com> (raw)
In-Reply-To: <20220518180049.2337257-1-tromey@adacore.com>
"struct insn_info" is defined in multiple .c files, causing ODR
warnings. This patch renames the type in z80-tdep.c, leaving the
other one alone.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395
---
gdb/z80-tdep.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
index 0b282237c4a..d27e567c358 100644
--- a/gdb/z80-tdep.c
+++ b/gdb/z80-tdep.c
@@ -139,7 +139,7 @@ enum z80_instruction_type
insn_force_nop /* invalid opcode prefix */
};
-struct insn_info
+struct z80_insn_info
{
gdb_byte code;
gdb_byte mask;
@@ -149,7 +149,7 @@ struct insn_info
/* Constants */
-static const struct insn_info *
+static const struct z80_insn_info *
z80_get_insn_info (struct gdbarch *gdbarch, const gdb_byte *buf, int *size);
static const char *z80_reg_names[] =
@@ -776,7 +776,7 @@ z80_software_single_step (struct regcache *regcache)
ULONGEST addr;
int opcode;
int size;
- const struct insn_info *info;
+ const struct z80_insn_info *info;
std::vector<CORE_ADDR> ret (1);
struct gdbarch *gdbarch = target_gdbarch ();
@@ -1007,7 +1007,7 @@ z80_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr)
{
gdb_byte buf[8];
int size;
- const struct insn_info *info;
+ const struct z80_insn_info *info;
read_memory (addr, buf, sizeof(buf));
info = z80_get_insn_info (gdbarch, buf, &size);
if (info)
@@ -1027,7 +1027,7 @@ z80_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr)
{
gdb_byte buf[8];
int size;
- const struct insn_info *info;
+ const struct z80_insn_info *info;
read_memory (addr, buf, sizeof(buf));
info = z80_get_insn_info (gdbarch, buf, &size);
if (info)
@@ -1046,7 +1046,7 @@ z80_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr)
{
gdb_byte buf[8];
int size;
- const struct insn_info *info;
+ const struct z80_insn_info *info;
read_memory (addr, buf, sizeof(buf));
info = z80_get_insn_info (gdbarch, buf, &size);
if (info)
@@ -1190,7 +1190,7 @@ z80_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
}
/* Table to disassemble machine codes without prefix. */
-static const struct insn_info
+static const struct z80_insn_info
ez80_main_insn_table[] =
{ /* table with double prefix check */
{ 0100, 0377, 0, insn_force_nop}, //double prefix
@@ -1237,7 +1237,7 @@ ez80_main_insn_table[] =
{ 0000, 0000, 1, insn_default } //others
} ;
-static const struct insn_info
+static const struct z80_insn_info
ez80_adl_main_insn_table[] =
{ /* table with double prefix check */
{ 0100, 0377, 0, insn_force_nop}, //double prefix
@@ -1286,7 +1286,7 @@ ez80_adl_main_insn_table[] =
/* ED prefix opcodes table.
Note the instruction length does include the ED prefix (+ 1 byte)
*/
-static const struct insn_info
+static const struct z80_insn_info
ez80_ed_insn_table[] =
{
/* eZ80 only instructions */
@@ -1306,7 +1306,7 @@ ez80_ed_insn_table[] =
{ 0000, 0000, 1, insn_default }
};
-static const struct insn_info
+static const struct z80_insn_info
ez80_adl_ed_insn_table[] =
{
{ 0002, 0366, 2, insn_default }, //"lea rr,ii+d"
@@ -1324,7 +1324,7 @@ ez80_adl_ed_insn_table[] =
};
/* table for FD and DD prefixed instructions */
-static const struct insn_info
+static const struct z80_insn_info
ez80_ddfd_insn_table[] =
{
/* ez80 only instructions */
@@ -1355,7 +1355,7 @@ ez80_ddfd_insn_table[] =
{ 0000, 0000, 0, insn_default } //not an instruction, exec DD/FD as NOP
};
-static const struct insn_info
+static const struct z80_insn_info
ez80_adl_ddfd_insn_table[] =
{
{ 0007, 0307, 2, insn_default }, //"ld rr,(ii+d)"
@@ -1386,11 +1386,11 @@ ez80_adl_ddfd_insn_table[] =
/* Return pointer to instruction information structure corresponded to opcode
in buf. */
-static const struct insn_info *
+static const struct z80_insn_info *
z80_get_insn_info (struct gdbarch *gdbarch, const gdb_byte *buf, int *size)
{
int code;
- const struct insn_info *info;
+ const struct z80_insn_info *info;
unsigned long mach = gdbarch_bfd_arch_info (gdbarch)->mach;
*size = 0;
switch (mach)
--
2.34.1
next prev parent reply other threads:[~2022-05-18 18:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 18:00 [PATCH 00/14] More ODR fixes Tom Tromey
2022-05-18 18:00 ` [PATCH 01/14] Fix ODR warning in observable.h Tom Tromey
2022-05-18 18:00 ` [PATCH 02/14] ODR warnings for struct symloc Tom Tromey
2022-05-18 18:00 ` [PATCH 03/14] ODR warnings for struct nextfield Tom Tromey
2022-05-18 18:00 ` [PATCH 04/14] ODR warning for struct field_info Tom Tromey
2022-05-18 18:00 ` [PATCH 05/14] ODR warning for struct ext_link_map Tom Tromey
2022-05-18 18:00 ` [PATCH 06/14] ODR warning for "struct instruction_type" Tom Tromey
2022-05-18 18:00 ` [PATCH 07/14] ODR warning for "struct stack_item" Tom Tromey
2022-05-18 18:00 ` [PATCH 08/14] ODR warning for "struct find_targ_sec_arg" Tom Tromey
2022-05-18 18:00 ` [PATCH 09/14] ODR warning for "enum string_repr_result" Tom Tromey
2022-05-18 18:00 ` [PATCH 10/14] ODR warnings from overlay constants Tom Tromey
2022-05-18 18:00 ` Tom Tromey [this message]
2022-05-18 18:00 ` [PATCH 12/14] ODR warnings for "struct insn_decode_record_t" Tom Tromey
2022-05-18 18:00 ` [PATCH 13/14] ODR warnings for "struct coff_symbol" Tom Tromey
2022-05-18 18:00 ` [PATCH 14/14] ODR warning for "main" Tom Tromey
2022-06-02 15:28 ` [PATCH 00/14] More ODR fixes 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=20220518180049.2337257-12-tromey@adacore.com \
--to=tromey@adacore.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).