aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-01-28 10:51:22 -0500
committerSimon Marchi <simon.marchi@efficios.com>2022-04-11 10:47:54 -0400
commite165fcef1e79529442d6a5d8def71681c088cd18 (patch)
tree04a54d159a5b232767bafc818c97c8d5b4dabfd8 /gdb
parent5bbfd12ddaff56898d5791241cabd1a7b781a416 (diff)
downloadgdb-e165fcef1e79529442d6a5d8def71681c088cd18.zip
gdb-e165fcef1e79529442d6a5d8def71681c088cd18.tar.gz
gdb-e165fcef1e79529442d6a5d8def71681c088cd18.tar.bz2
gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macros
Replace with equivalent getter/setter macros. Change-Id: I1042564dd47347337374762bd64ec31b5c573ee2
Diffstat (limited to 'gdb')
-rw-r--r--gdb/arm-tdep.c4
-rw-r--r--gdb/m68hc11-tdep.c8
-rw-r--r--gdb/mips-tdep.c4
-rw-r--r--gdb/mips-tdep.h13
-rw-r--r--gdb/ppc-linux-tdep.c4
-rw-r--r--gdb/symtab.h35
6 files changed, 51 insertions, 17 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 7002bca..cc77739 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -82,10 +82,10 @@ static bool arm_debug;
MSYMBOL_IS_SPECIAL Tests the "special" bit in a minimal symbol. */
#define MSYMBOL_SET_SPECIAL(msym) \
- MSYMBOL_TARGET_FLAG_1 (msym) = 1
+ (msym)->set_target_flag_1 (true)
#define MSYMBOL_IS_SPECIAL(msym) \
- MSYMBOL_TARGET_FLAG_1 (msym)
+ (msym)->target_flag_1 ()
struct arm_mapping_symbol
{
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index e82b18a..98f1367 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -58,16 +58,16 @@
MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol. */
#define MSYMBOL_SET_RTC(msym) \
- MSYMBOL_TARGET_FLAG_1 (msym) = 1
+ (msym)->set_target_flag_1 (true)
#define MSYMBOL_SET_RTI(msym) \
- MSYMBOL_TARGET_FLAG_2 (msym) = 1
+ (msym)->set_target_flag_2 (true)
#define MSYMBOL_IS_RTC(msym) \
- MSYMBOL_TARGET_FLAG_1 (msym)
+ (msym)->target_flag_1 ()
#define MSYMBOL_IS_RTI(msym) \
- MSYMBOL_TARGET_FLAG_2 (msym)
+ (msym)->target_flag_2 ()
enum insn_return_kind {
RETURN_RTS,
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index ec95d54..f31dacd 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -435,12 +435,12 @@ mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
if (ELF_ST_IS_MICROMIPS (st_other))
{
- MSYMBOL_TARGET_FLAG_MICROMIPS (msym) = 1;
+ SET_MSYMBOL_TARGET_FLAG_MICROMIPS (msym);
msym->set_value_address (msym->value_raw_address () | 1);
}
else if (ELF_ST_IS_MIPS16 (st_other))
{
- MSYMBOL_TARGET_FLAG_MIPS16 (msym) = 1;
+ SET_MSYMBOL_TARGET_FLAG_MIPS16 (msym);
msym->set_value_address (msym->value_raw_address () | 1);
}
}
diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h
index f0a7440..4d2664d 100644
--- a/gdb/mips-tdep.h
+++ b/gdb/mips-tdep.h
@@ -50,8 +50,17 @@ enum mips_isa
};
/* Corresponding MSYMBOL_TARGET_FLAG aliases. */
-#define MSYMBOL_TARGET_FLAG_MIPS16 MSYMBOL_TARGET_FLAG_1
-#define MSYMBOL_TARGET_FLAG_MICROMIPS MSYMBOL_TARGET_FLAG_2
+#define MSYMBOL_TARGET_FLAG_MIPS16(sym) \
+ (sym)->target_flag_1 ()
+
+#define SET_MSYMBOL_TARGET_FLAG_MIPS16(sym) \
+ (sym)->set_target_flag_1 (true)
+
+#define MSYMBOL_TARGET_FLAG_MICROMIPS(sym) \
+ (sym)->target_flag_2 ()
+
+#define SET_MSYMBOL_TARGET_FLAG_MICROMIPS(sym) \
+ (sym)->set_target_flag_2 (true)
/* Return the MIPS ISA's register size. Just a short cut to the BFD
architecture's word size. */
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index a11f367..4c5f8b7 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1639,7 +1639,7 @@ ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
default:
break;
case 8:
- MSYMBOL_TARGET_FLAG_1 (msym) = 1;
+ msym->set_target_flag_1 (true);
break;
}
}
@@ -1659,7 +1659,7 @@ ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc)
/* See ppc_elfv2_elf_make_msymbol_special for how local entry point
offset values are encoded. */
- if (MSYMBOL_TARGET_FLAG_1 (fun.minsym))
+ if (fun.minsym->target_flag_1 ())
local_entry_offset = 8;
if (fun.value_address () <= pc
diff --git a/gdb/symtab.h b/gdb/symtab.h
index e82572c..11e8995 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -735,6 +735,34 @@ struct minimal_symbol : public general_symbol_info
return m_has_size;
}
+ /* Return this minimal symbol's first target-specific flag. */
+
+ bool target_flag_1 () const
+ {
+ return m_target_flag_1;
+ }
+
+ /* Set this minimal symbol's first target-specific flag. */
+
+ void set_target_flag_1 (bool target_flag_1)
+ {
+ m_target_flag_1 = target_flag_1;
+ }
+
+ /* Return this minimal symbol's second target-specific flag. */
+
+ bool target_flag_2 () const
+ {
+ return m_target_flag_2;
+ }
+
+ /* Set this minimal symbol's second target-specific flag. */
+
+ void set_target_flag_2 (bool target_flag_2)
+ {
+ m_target_flag_2 = target_flag_2;
+ }
+
/* Size of this symbol. dbx_end_psymtab in dbxread.c uses this
information to calculate the end of the partial symtab based on the
address of the last symbol plus the size of the last symbol. */
@@ -753,8 +781,8 @@ struct minimal_symbol : public general_symbol_info
unsigned int created_by_gdb : 1;
/* Two flag bits provided for the use of the target. */
- unsigned int target_flag_1 : 1;
- unsigned int target_flag_2 : 1;
+ unsigned int m_target_flag_1 : 1;
+ unsigned int m_target_flag_2 : 1;
/* Nonzero iff the size of the minimal symbol has been set.
Symbol size information can sometimes not be determined, because
@@ -792,9 +820,6 @@ struct minimal_symbol : public general_symbol_info
bool text_p () const;
};
-#define MSYMBOL_TARGET_FLAG_1(msymbol) (msymbol)->target_flag_1
-#define MSYMBOL_TARGET_FLAG_2(msymbol) (msymbol)->target_flag_2
-
#include "minsyms.h"