aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-09-14 12:09:59 -0600
committerTom Tromey <tromey@adacore.com>2020-09-14 13:31:01 -0600
commit27087b7f6ce8c6d304b149df2484436d97e6334b (patch)
tree3cb8b064565b7fa8daea7cc96eb792a76c5717c3 /gdb/i386-tdep.c
parent898066264058f68c4dd26e82e1310db305177c8e (diff)
downloadgdb-27087b7f6ce8c6d304b149df2484436d97e6334b.zip
gdb-27087b7f6ce8c6d304b149df2484436d97e6334b.tar.gz
gdb-27087b7f6ce8c6d304b149df2484436d97e6334b.tar.bz2
Apply 'const' in more places
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.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 64e42dc..14e5b31 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -69,7 +69,7 @@
/* Register names. */
-static const char *i386_register_names[] =
+static const char * const i386_register_names[] =
{
"eax", "ecx", "edx", "ebx",
"esp", "ebp", "esi", "edi",
@@ -84,56 +84,56 @@ static const char *i386_register_names[] =
"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"
@@ -141,7 +141,7 @@ static const char *i386_mmx_names[] =
/* 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"
@@ -149,7 +149,7 @@ static const char *i386_byte_names[] =
/* 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"