Many global arrays in gdb could be marked "const" but are not. This
patch changes some of them. (There may be other arrays that could
benefit from this treatment. I only examined arrays of strings.)
This lets the linker move some symbols to the readonly data section.
For example, previously:
0000000000000000 d _ZL18can_use_agent_enum
is now:
0000000000000030 r _ZL18can_use_agent_enum
2020-09-14 Tom Tromey <tromey@adacore.com>
* x86-tdep.h (x86_in_indirect_branch_thunk): Update.
* x86-tdep.c (x86_is_thunk_register_name)
(x86_in_indirect_branch_thunk): Update.
* sparc64-tdep.c (sparc64_fpu_register_names)
(sparc64_cp0_register_names, sparc64_register_names)
(sparc64_pseudo_register_names): Now const.
* sparc-tdep.h (struct gdbarch_tdep) <fpu_register_names,
cp0_registers_num>: Now const.
* sparc-tdep.c (sparc_core_register_names)
(sparc32_fpu_register_names, sparc32_cp0_register_names)
(sparc32_pseudo_register_names): Now const.
(validate_tdesc_registers): Update.
* rust-lang.c (rust_extensions): Now const.
* p-lang.c (p_extensions): Now const.
* objc-lang.c (objc_extensions): Now const.
* nto-tdep.c (nto_thread_state_str): Now const.
* moxie-tdep.c (moxie_register_names): Now const.
* mips-tdep.h (struct gdbarch_tdep) <mips_processor_reg_names>:
Now const.
* mips-tdep.c (mips_generic_reg_names, mips_tx39_reg_names)
(mips_linux_reg_names): Now const.
(mips_gdbarch_init): Update.
* microblaze-tdep.c (microblaze_register_names): Now const.
* m68k-tdep.c (m68k_register_names): Now const.
* m32r-tdep.c (m32r_register_names): Now const.
* ia64-tdep.c (ia64_register_names): Now const.
* i386-tdep.h (struct gdbarch_tdep) <register_names,
ymmh_register_names, ymm16h_regnum, mpx_register_names,
k_register_names, zmmh_register_names, xmm_avx512_register_names,
ymm_avx512_register_names, pkeys_register_names>: Now const.
* i386-tdep.c (i386_register_names, i386_zmm_names)
(i386_zmmh_names, i386_k_names, i386_ymm_names, i386_ymmh_names)
(i386_mpx_names, i386_pkeys_names, i386_bnd_names)
(i386_mmx_names, i386_byte_names, i386_word_names): Now const.
* f-lang.c (f_extensions): Now const.
* d-lang.c (d_extensions): Now const.
* csky-tdep.c (csky_register_names): Now const.
* charset.c (default_charset_names, charset_enum): Now const.
(_initialize_charset): Update.
* c-lang.c (c_extensions, cplus_extensions, asm_extensions): Now
const.
* bsd-uthread.c (bsd_uthread_solib_names): Now const.
(bsd_uthread_solib_loaded): Update.
(bsd_uthread_state): Now const.
* amd64-tdep.c (amd64_register_names, amd64_ymm_names)
(amd64_ymm_avx512_names, amd64_ymmh_names)
(amd64_ymmh_avx512_names, amd64_mpx_names, amd64_k_names)
(amd64_zmmh_names, amd64_zmm_names, amd64_xmm_avx512_names)
(amd64_pkeys_names, amd64_byte_names, amd64_word_names)
(amd64_dword_names): Now const.
* agent.c (can_use_agent_enum): Now const.
* ada-tasks.c (task_states, long_task_states): Now const.
* ada-lang.c (known_runtime_file_name_patterns)
(known_auxiliary_function_name_patterns, attribute_names)
(standard_exc, ada_extensions): Now const.
gdbserver/ChangeLog
2020-09-14 Tom Tromey <tromey@adacore.com>
* tracepoint.cc (eval_result_names): Now const.
* ax.cc (gdb_agent_op_names): Now const.
+2020-09-14 Tom Tromey <tromey@adacore.com>
+
+ * x86-tdep.h (x86_in_indirect_branch_thunk): Update.
+ * x86-tdep.c (x86_is_thunk_register_name)
+ (x86_in_indirect_branch_thunk): Update.
+ * sparc64-tdep.c (sparc64_fpu_register_names)
+ (sparc64_cp0_register_names, sparc64_register_names)
+ (sparc64_pseudo_register_names): Now const.
+ * sparc-tdep.h (struct gdbarch_tdep) <fpu_register_names,
+ cp0_registers_num>: Now const.
+ * sparc-tdep.c (sparc_core_register_names)
+ (sparc32_fpu_register_names, sparc32_cp0_register_names)
+ (sparc32_pseudo_register_names): Now const.
+ (validate_tdesc_registers): Update.
+ * rust-lang.c (rust_extensions): Now const.
+ * p-lang.c (p_extensions): Now const.
+ * objc-lang.c (objc_extensions): Now const.
+ * nto-tdep.c (nto_thread_state_str): Now const.
+ * moxie-tdep.c (moxie_register_names): Now const.
+ * mips-tdep.h (struct gdbarch_tdep) <mips_processor_reg_names>:
+ Now const.
+ * mips-tdep.c (mips_generic_reg_names, mips_tx39_reg_names)
+ (mips_linux_reg_names): Now const.
+ (mips_gdbarch_init): Update.
+ * microblaze-tdep.c (microblaze_register_names): Now const.
+ * m68k-tdep.c (m68k_register_names): Now const.
+ * m32r-tdep.c (m32r_register_names): Now const.
+ * ia64-tdep.c (ia64_register_names): Now const.
+ * i386-tdep.h (struct gdbarch_tdep) <register_names,
+ ymmh_register_names, ymm16h_regnum, mpx_register_names,
+ k_register_names, zmmh_register_names, xmm_avx512_register_names,
+ ymm_avx512_register_names, pkeys_register_names>: Now const.
+ * i386-tdep.c (i386_register_names, i386_zmm_names)
+ (i386_zmmh_names, i386_k_names, i386_ymm_names, i386_ymmh_names)
+ (i386_mpx_names, i386_pkeys_names, i386_bnd_names)
+ (i386_mmx_names, i386_byte_names, i386_word_names): Now const.
+ * f-lang.c (f_extensions): Now const.
+ * d-lang.c (d_extensions): Now const.
+ * csky-tdep.c (csky_register_names): Now const.
+ * charset.c (default_charset_names, charset_enum): Now const.
+ (_initialize_charset): Update.
+ * c-lang.c (c_extensions, cplus_extensions, asm_extensions): Now
+ const.
+ * bsd-uthread.c (bsd_uthread_solib_names): Now const.
+ (bsd_uthread_solib_loaded): Update.
+ (bsd_uthread_state): Now const.
+ * amd64-tdep.c (amd64_register_names, amd64_ymm_names)
+ (amd64_ymm_avx512_names, amd64_ymmh_names)
+ (amd64_ymmh_avx512_names, amd64_mpx_names, amd64_k_names)
+ (amd64_zmmh_names, amd64_zmm_names, amd64_xmm_avx512_names)
+ (amd64_pkeys_names, amd64_byte_names, amd64_word_names)
+ (amd64_dword_names): Now const.
+ * agent.c (can_use_agent_enum): Now const.
+ * ada-tasks.c (task_states, long_task_states): Now const.
+ * ada-lang.c (known_runtime_file_name_patterns)
+ (known_auxiliary_function_name_patterns, attribute_names)
+ (standard_exc, ada_extensions): Now const.
+
2020-09-14 Simon Marchi <simon.marchi@polymtl.ca>
* bcache.h (struct bcache) <bcache>: Remove constructor.
expression evaluation. */
static int warnings_issued = 0;
-static const char *known_runtime_file_name_patterns[] = {
+static const char * const known_runtime_file_name_patterns[] = {
ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS NULL
};
-static const char *known_auxiliary_function_name_patterns[] = {
+static const char * const known_auxiliary_function_name_patterns[] = {
ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS NULL
};
/* Table mapping attribute numbers to names.
NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h. */
-static const char *attribute_names[] = {
+static const char * const attribute_names[] = {
"<?>",
"first",
an Ada83 compiler). As such, we do not include Numeric_Error from
this list of standard exceptions. */
-static const char *standard_exc[] = {
+static const char * const standard_exc[] = {
"constraint_error",
"program_error",
"storage_error",
}
}
-static const char *ada_extensions[] =
+static const char * const ada_extensions[] =
{
".adb", ".ads", ".a", ".ada", ".dg", NULL
};
};
/* A short description corresponding to each possible task state. */
-static const char *task_states[] = {
+static const char * const task_states[] = {
N_("Unactivated"),
N_("Runnable"),
N_("Terminated"),
};
/* A longer description corresponding to each possible task state. */
-static const char *long_task_states[] = {
+static const char * const long_task_states[] = {
N_("Unactivated"),
N_("Runnable"),
N_("Terminated"),
static const char can_use_agent_on[] = "on";
static const char can_use_agent_off[] = "off";
-static const char *can_use_agent_enum[] =
+static const char * const can_use_agent_enum[] =
{
can_use_agent_on,
can_use_agent_off,
/* Register information. */
-static const char *amd64_register_names[] =
+static const char * const amd64_register_names[] =
{
"rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "rsp",
"mxcsr",
};
-static const char *amd64_ymm_names[] =
+static const char * const amd64_ymm_names[] =
{
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
"ymm12", "ymm13", "ymm14", "ymm15"
};
-static const char *amd64_ymm_avx512_names[] =
+static const char * const amd64_ymm_avx512_names[] =
{
"ymm16", "ymm17", "ymm18", "ymm19",
"ymm20", "ymm21", "ymm22", "ymm23",
"ymm28", "ymm29", "ymm30", "ymm31"
};
-static const char *amd64_ymmh_names[] =
+static const char * const amd64_ymmh_names[] =
{
"ymm0h", "ymm1h", "ymm2h", "ymm3h",
"ymm4h", "ymm5h", "ymm6h", "ymm7h",
"ymm12h", "ymm13h", "ymm14h", "ymm15h"
};
-static const char *amd64_ymmh_avx512_names[] =
+static const char * const amd64_ymmh_avx512_names[] =
{
"ymm16h", "ymm17h", "ymm18h", "ymm19h",
"ymm20h", "ymm21h", "ymm22h", "ymm23h",
"ymm28h", "ymm29h", "ymm30h", "ymm31h"
};
-static const char *amd64_mpx_names[] =
+static const char * const amd64_mpx_names[] =
{
"bnd0raw", "bnd1raw", "bnd2raw", "bnd3raw", "bndcfgu", "bndstatus"
};
-static const char *amd64_k_names[] =
+static const char * const amd64_k_names[] =
{
"k0", "k1", "k2", "k3",
"k4", "k5", "k6", "k7"
};
-static const char *amd64_zmmh_names[] =
+static const char * const amd64_zmmh_names[] =
{
"zmm0h", "zmm1h", "zmm2h", "zmm3h",
"zmm4h", "zmm5h", "zmm6h", "zmm7h",
"zmm28h", "zmm29h", "zmm30h", "zmm31h"
};
-static const char *amd64_zmm_names[] =
+static const char * const amd64_zmm_names[] =
{
"zmm0", "zmm1", "zmm2", "zmm3",
"zmm4", "zmm5", "zmm6", "zmm7",
"zmm28", "zmm29", "zmm30", "zmm31"
};
-static const char *amd64_xmm_avx512_names[] = {
+static const char * const amd64_xmm_avx512_names[] = {
"xmm16", "xmm17", "xmm18", "xmm19",
"xmm20", "xmm21", "xmm22", "xmm23",
"xmm24", "xmm25", "xmm26", "xmm27",
"xmm28", "xmm29", "xmm30", "xmm31"
};
-static const char *amd64_pkeys_names[] = {
+static const char * const amd64_pkeys_names[] = {
"pkru"
};
/* Register names for byte pseudo-registers. */
-static const char *amd64_byte_names[] =
+static const char * const amd64_byte_names[] =
{
"al", "bl", "cl", "dl", "sil", "dil", "bpl", "spl",
"r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l",
/* Register names for word pseudo-registers. */
-static const char *amd64_word_names[] =
+static const char * const amd64_word_names[] =
{
"ax", "bx", "cx", "dx", "si", "di", "bp", "",
"r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
/* Register names for dword pseudo-registers. */
-static const char *amd64_dword_names[] =
+static const char * const amd64_dword_names[] =
{
"eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp",
"r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d",
}
/* Likely candidates for the threads library. */
-static const char *bsd_uthread_solib_names[] =
+static const char * const bsd_uthread_solib_names[] =
{
"/usr/lib/libc_r.so", /* FreeBSD */
"/usr/lib/libpthread.so", /* OpenBSD */
static void
bsd_uthread_solib_loaded (struct so_list *so)
{
- const char **names = bsd_uthread_solib_names;
+ const char * const *names = bsd_uthread_solib_names;
for (names = bsd_uthread_solib_names; *names; names++)
{
}
/* Possible states a thread can be in. */
-static const char *bsd_uthread_state[] =
+static const char * const bsd_uthread_state[] =
{
"RUNNING",
"SIGTHREAD",
evaluate_subexp_c
};
-static const char *c_extensions[] =
+static const char * const c_extensions[] =
{
".c", NULL
};
nr_cplus_primitive_types
};
-static const char *cplus_extensions[] =
+static const char * const cplus_extensions[] =
{
".C", ".cc", ".cp", ".cpp", ".cxx", ".c++", NULL
};
static cplus_language cplus_language_defn;
-static const char *asm_extensions[] =
+static const char * const asm_extensions[] =
{
".s", ".sx", ".S", NULL
};
value);
}
-static const char *default_charset_names[] =
+static const char * const default_charset_names[] =
{
DEFAULT_CHARSET_NAMES
0
};
-static const char **charset_enum;
+static const char * const *charset_enum;
\f
/* If the target wide character set has big- or little-endian
find_charset_names ();
if (charsets.charsets.size () > 1)
- charset_enum = (const char **) charsets.charsets.data ();
+ charset_enum = (const char * const *) charsets.charsets.data ();
else
charset_enum = default_charset_names;
/* C-Sky ABI register names. */
-static const char *csky_register_names[] =
+static const char * const csky_register_names[] =
{
/* General registers 0 - 31. */
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
nr_d_primitive_types
};
-static const char *d_extensions[] =
+static const char * const d_extensions[] =
{
".d", NULL
};
return 0;
}
-static const char *f_extensions[] =
+static const char * const f_extensions[] =
{
".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP",
".f90", ".F90", ".f95", ".F95", ".f03", ".F03", ".f08", ".F08",
/* Register names. */
-static const char *i386_register_names[] =
+static const char * const i386_register_names[] =
{
"eax", "ecx", "edx", "ebx",
"esp", "ebp", "esi", "edi",
"mxcsr"
};
-static const char *i386_zmm_names[] =
+static const char * const i386_zmm_names[] =
{
"zmm0", "zmm1", "zmm2", "zmm3",
"zmm4", "zmm5", "zmm6", "zmm7"
};
-static const char *i386_zmmh_names[] =
+static const char * const i386_zmmh_names[] =
{
"zmm0h", "zmm1h", "zmm2h", "zmm3h",
"zmm4h", "zmm5h", "zmm6h", "zmm7h"
};
-static const char *i386_k_names[] =
+static const char * const i386_k_names[] =
{
"k0", "k1", "k2", "k3",
"k4", "k5", "k6", "k7"
};
-static const char *i386_ymm_names[] =
+static const char * const i386_ymm_names[] =
{
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
};
-static const char *i386_ymmh_names[] =
+static const char * const i386_ymmh_names[] =
{
"ymm0h", "ymm1h", "ymm2h", "ymm3h",
"ymm4h", "ymm5h", "ymm6h", "ymm7h",
};
-static const char *i386_mpx_names[] =
+static const char * const i386_mpx_names[] =
{
"bnd0raw", "bnd1raw", "bnd2raw", "bnd3raw", "bndcfgu", "bndstatus"
};
-static const char* i386_pkeys_names[] =
+static const char * const i386_pkeys_names[] =
{
"pkru"
};
/* Register names for MPX pseudo-registers. */
-static const char *i386_bnd_names[] =
+static const char * const i386_bnd_names[] =
{
"bnd0", "bnd1", "bnd2", "bnd3"
};
/* Register names for MMX pseudo-registers. */
-static const char *i386_mmx_names[] =
+static const char * const i386_mmx_names[] =
{
"mm0", "mm1", "mm2", "mm3",
"mm4", "mm5", "mm6", "mm7"
/* Register names for byte pseudo-registers. */
-static const char *i386_byte_names[] =
+static const char * const i386_byte_names[] =
{
"al", "cl", "dl", "bl",
"ah", "ch", "dh", "bh"
/* Register names for word pseudo-registers. */
-static const char *i386_word_names[] =
+static const char * const i386_word_names[] =
{
"ax", "cx", "dx", "bx",
"", "bp", "si", "di"
int xsave_xcr0_offset;
/* Register names. */
- const char **register_names;
+ const char * const *register_names;
/* Register number for %ymm0h. Set this to -1 to indicate the absence
of upper YMM register support. */
int ymm0h_regnum;
/* Upper YMM register names. Only used for tdesc_numbered_register. */
- const char **ymmh_register_names;
+ const char * const *ymmh_register_names;
/* Register number for %ymm16h. Set this to -1 to indicate the absence
of support for YMM16-31. */
int ymm16h_regnum;
/* YMM16-31 register names. Only used for tdesc_numbered_register. */
- const char **ymm16h_register_names;
+ const char * const *ymm16h_register_names;
/* Register number for %bnd0r. Set this to -1 to indicate the absence
bound registers. */
int bndcfgu_regnum;
/* MPX register names. Only used for tdesc_numbered_register. */
- const char **mpx_register_names;
+ const char * const *mpx_register_names;
/* Register number for %zmm0h. Set this to -1 to indicate the absence
of ZMM_HI256 register support. */
int zmm0h_regnum;
/* OpMask register names. */
- const char **k_register_names;
+ const char * const *k_register_names;
/* ZMM register names. Only used for tdesc_numbered_register. */
- const char **zmmh_register_names;
+ const char * const *zmmh_register_names;
/* XMM16-31 register names. Only used for tdesc_numbered_register. */
- const char **xmm_avx512_register_names;
+ const char * const *xmm_avx512_register_names;
/* YMM16-31 register names. Only used for tdesc_numbered_register. */
- const char **ymm_avx512_register_names;
+ const char * const *ymm_avx512_register_names;
/* Number of PKEYS registers. */
int num_pkeys_regs;
int pkru_regnum;
/* PKEYS register names. */
- const char **pkeys_register_names;
+ const char * const *pkeys_register_names;
/* Register number for %fsbase. Set this to -1 to indicate the
absence of segment base registers. */
/* Array of register names; There should be ia64_num_regs strings in
the initializer. */
-static const char *ia64_register_names[] =
+static const char * const ia64_register_names[] =
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
}
}
-static const char *m32r_register_names[] = {
+static const char * const m32r_register_names[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "fp", "lr", "sp",
"psw", "cbr", "spi", "spu", "bpc", "pc", "accl", "acch",
return builtin_type (gdbarch)->builtin_int32;
}
-static const char *m68k_register_names[] = {
+static const char * const m68k_register_names[] = {
"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
"a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp",
"ps", "pc",
/* The registers of the Xilinx microblaze processor. */
-static const char *microblaze_register_names[] =
+static const char * const microblaze_register_names[] =
{
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
/* Generic MIPS. */
-static const char *mips_generic_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
+static const char * const mips_generic_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
"sr", "lo", "hi", "bad", "cause", "pc",
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
/* Names of tx39 registers. */
-static const char *mips_tx39_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
+static const char * const mips_tx39_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
"sr", "lo", "hi", "bad", "cause", "pc",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
};
/* Names of registers with Linux kernels. */
-static const char *mips_linux_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
+static const char * const mips_linux_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
"sr", "lo", "hi", "bad", "cause", "pc",
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
enum mips_fpu_type fpu_type;
struct tdesc_arch_data *tdesc_data = NULL;
int elf_fpu_type = Val_GNU_MIPS_ABI_FP_ANY;
- const char **reg_names;
+ const char * const *reg_names;
struct mips_regnum mips_regnum, *regnum;
enum mips_isa mips_isa;
int dspacc;
add any that do not need to be public. */
const struct mips_regnum *regnum;
/* Register names table for the current register set. */
- const char **mips_processor_reg_names;
+ const char * const *mips_processor_reg_names;
/* The size of register data available from the target, if known.
This doesn't quite obsolete the manual
/* Moxie register names. */
-static const char *moxie_register_names[] = {
+static const char * const moxie_register_names[] = {
"$fp", "$sp", "$r0", "$r1", "$r2",
"$r3", "$r4", "$r5", "$r6", "$r7",
"$r8", "$r9", "$r10", "$r11", "$r12",
return osabi;
}
-static const char *nto_thread_state_str[] =
+static const char * const nto_thread_state_str[] =
{
"DEAD", /* 0 0x00 */
"RUNNING", /* 1 0x01 */
{NULL, OP_NULL, PREC_NULL, 0}
};
-static const char *objc_extensions[] =
+static const char * const objc_extensions[] =
{
".m", NULL
};
nr_pascal_primitive_types
};
-static const char *p_extensions[] =
+static const char * const p_extensions[] =
{
".pas", ".p", ".pp", NULL
};
rust_evaluate_subexp
};
-static const char *rust_extensions[] =
+static const char * const rust_extensions[] =
{
".rs", NULL
};
#define SPARC32_CP0_REGISTERS \
"y", "psr", "wim", "tbr", "pc", "npc", "fsr", "csr"
-static const char *sparc_core_register_names[] = { SPARC_CORE_REGISTERS };
-static const char *sparc32_fpu_register_names[] = { SPARC32_FPU_REGISTERS };
-static const char *sparc32_cp0_register_names[] = { SPARC32_CP0_REGISTERS };
+static const char * const sparc_core_register_names[] = {
+ SPARC_CORE_REGISTERS
+};
+static const char * const sparc32_fpu_register_names[] = {
+ SPARC32_FPU_REGISTERS
+};
+static const char * const sparc32_cp0_register_names[] = {
+ SPARC32_CP0_REGISTERS
+};
-static const char *sparc32_register_names[] =
+static const char * const sparc32_register_names[] =
{
SPARC_CORE_REGISTERS,
SPARC32_FPU_REGISTERS,
/* We provide the aliases %d0..%d30 for the floating registers as
"psuedo" registers. */
-static const char *sparc32_pseudo_register_names[] =
+static const char * const sparc32_pseudo_register_names[] =
{
"d0", "d2", "d4", "d6", "d8", "d10", "d12", "d14",
"d16", "d18", "d20", "d22", "d24", "d26", "d28", "d30"
validate_tdesc_registers (const struct target_desc *tdesc,
struct tdesc_arch_data *tdesc_data,
const char *feature_name,
- const char *register_names[],
+ const char * const register_names[],
unsigned int registers_num,
unsigned int reg_start)
{
int npc_regnum;
/* Register names specific for architecture (sparc32 vs. sparc64) */
- const char **fpu_register_names;
+ const char * const *fpu_register_names;
size_t fpu_registers_num;
- const char **cp0_register_names;
+ const char * const *cp0_register_names;
size_t cp0_registers_num;
/* Register sets. */
"fprs", \
"y"
-static const char *sparc64_fpu_register_names[] = { SPARC64_FPU_REGISTERS };
-static const char *sparc64_cp0_register_names[] = { SPARC64_CP0_REGISTERS };
+static const char * const sparc64_fpu_register_names[] = {
+ SPARC64_FPU_REGISTERS
+};
+static const char * const sparc64_cp0_register_names[] = {
+ SPARC64_CP0_REGISTERS
+};
-static const char *sparc64_register_names[] =
+static const char * const sparc64_register_names[] =
{
SPARC_CORE_REGISTERS,
SPARC64_FPU_REGISTERS,
/* We provide the aliases %d0..%d62 and %q0..%q60 for the floating
registers as "psuedo" registers. */
-static const char *sparc64_pseudo_register_names[] =
+static const char * const sparc64_pseudo_register_names[] =
{
"cwp", "pstate", "asi", "ccr",
(exclusive). */
static bool
-x86_is_thunk_register_name (const char *name, const char **names, int lo,
- int hi)
+x86_is_thunk_register_name (const char *name, const char * const *names,
+ int lo, int hi)
{
int reg;
for (reg = lo; reg < hi; ++reg)
/* See x86-tdep.h. */
bool
-x86_in_indirect_branch_thunk (CORE_ADDR pc, const char **register_names,
+x86_in_indirect_branch_thunk (CORE_ADDR pc, const char * const *register_names,
int lo, int hi)
{
struct bound_minimal_symbol bmfun = lookup_minimal_symbol_by_pc (pc);
REGISTER_NAMES[LO] (inclusive) to REGISTER_NAMES[HI] (exclusive). */
extern bool x86_in_indirect_branch_thunk (CORE_ADDR pc,
- const char **register_names,
+ const char * const *register_names,
int lo, int hi);
#endif /* x86-tdep.h */
+2020-09-14 Tom Tromey <tromey@adacore.com>
+
+ * tracepoint.cc (eval_result_names): Now const.
+ * ax.cc (gdb_agent_op_names): Now const.
+
2020-09-10 Kamil Rytarowski <n54@gmx.com>
* netbsd-low.cc: Add.
gdb_agent_op_last
};
-static const char *gdb_agent_op_names [gdb_agent_op_last] =
+static const char * const gdb_agent_op_names [gdb_agent_op_last] =
{
"?undef?"
#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) , # NAME
static struct tracepoint *last_tracepoint;
-static const char *eval_result_names[] =
+static const char * const eval_result_names[] =
{
"terror:in the attic", /* this should never be reported */
"terror:empty expression",