public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 10/14] ODR warnings from overlay constants
Date: Wed, 18 May 2022 12:00:45 -0600	[thread overview]
Message-ID: <20220518180049.2337257-11-tromey@adacore.com> (raw)
In-Reply-To: <20220518180049.2337257-1-tromey@adacore.com>

Some overlay-related constants are duplicated in z80-tdep.c, causing
ODR warnings.  This patch renames just the z80-specific ones.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395
---
 gdb/z80-tdep.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
index 196884af770..0b282237c4a 100644
--- a/gdb/z80-tdep.c
+++ b/gdb/z80-tdep.c
@@ -860,9 +860,9 @@ z80_software_single_step (struct regcache *regcache)
 static unsigned (*cache_ovly_region_table)[3] = 0;
 static unsigned cache_novly_regions;
 static CORE_ADDR cache_ovly_region_table_base = 0;
-enum ovly_index
+enum z80_ovly_index
   {
-    VMA, OSIZE, MAPPED_TO_LMA
+    Z80_VMA, Z80_OSIZE, Z80_MAPPED_TO_LMA
   };
 
 static void
@@ -952,12 +952,12 @@ z80_overlay_update_1 (struct obj_section *osect)
 
   /* find region corresponding to the section VMA */
   for (i = 0; i < cache_novly_regions; i++)
-    if (cache_ovly_region_table[i][VMA] == vma)
+    if (cache_ovly_region_table[i][Z80_VMA] == vma)
 	break;
   if (i == cache_novly_regions)
     return 0; /* no such region */
 
-  lma = cache_ovly_region_table[i][MAPPED_TO_LMA];
+  lma = cache_ovly_region_table[i][Z80_MAPPED_TO_LMA];
   i = 0;
 
   /* we have interest for sections with same VMA */
@@ -995,9 +995,9 @@ z80_overlay_update (struct obj_section *osect)
 	bfd_vma vma = bfd_section_vma (bsect);
 
 	for (int i = 0; i < cache_novly_regions; ++i)
-	  if (cache_ovly_region_table[i][VMA] == vma)
+	  if (cache_ovly_region_table[i][Z80_VMA] == vma)
 	    osect->ovly_mapped =
-	      (cache_ovly_region_table[i][MAPPED_TO_LMA] == lma);
+	      (cache_ovly_region_table[i][Z80_MAPPED_TO_LMA] == lma);
       }
 }
 
-- 
2.34.1


  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 ` Tom Tromey [this message]
2022-05-18 18:00 ` [PATCH 11/14] ODR warnings for "struct insn_info" Tom Tromey
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-11-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).