gdb: make some variables static
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 21 Jan 2021 01:55:05 +0000 (20:55 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 21 Jan 2021 01:55:05 +0000 (20:55 -0500)
I'm trying to enable clang's -Wmissing-variable-declarations warning.
This patch fixes all the obvious spots where we can simply add "static"
(at least, found when building on x86-64 Linux).

gdb/ChangeLog:

* aarch64-linux-tdep.c (aarch64_linux_record_tdep): Make static.
* aarch64-tdep.c (tdesc_aarch64_list, aarch64_prologue_unwind,
aarch64_stub_unwind, aarch64_normal_base, ): Make static.
* arm-linux-tdep.c (arm_prologue_unwind): Make static.
* arm-tdep.c (struct frame_unwind): Make static.
* auto-load.c (auto_load_safe_path_vec): Make static.
* csky-tdep.c (csky_stub_unwind): Make static.
* gdbarch.c (gdbarch_data_registry): Make static.
* gnu-v2-abi.c (gnu_v2_abi_ops): Make static.
* i386-netbsd-tdep.c (i386nbsd_mc_reg_offset): Make static.
* i386-tdep.c (i386_frame_setup_skip_insns,
i386_tramp_chain_in_reg_insns, i386_tramp_chain_on_stack_insns):
Make static.
* infrun.c (observer_mode): Make static.
* linux-nat.c (sigchld_action): Make static.
* linux-thread-db.c (thread_db_list): Make static.
* maint-test-options.c (maintenance_test_options_list):
* mep-tdep.c (mep_csr_registers): Make static.
* mi/mi-cmds.c (struct mi_cmd_stats): Remove struct type name.
(stats): Make static.
* nat/linux-osdata.c (struct osdata_type): Make static.
* ppc-netbsd-tdep.c (ppcnbsd_reg_offsets): Make static.
* progspace.c (last_program_space_num): Make static.
* python/py-param.c (struct parm_constant): Remove struct type
name.
(parm_constants): Make static.
* python/py-record-btrace.c (btpy_list_methods): Make static.
* python/py-record.c (recpy_gap_type): Make static.
* record.c (record_goto_cmdlist): Make static.
* regcache.c (regcache_descr_handle): Make static.
* registry.h (DEFINE_REGISTRY): Make definition static.
* symmisc.c (std_in, std_out, std_err): Make static.
* top.c (previous_saved_command_line): Make static.
* tracepoint.c (trace_user, trace_notes, trace_stop_notes): Make
static.
* unittests/command-def-selftests.c (nr_duplicates,
nr_invalid_prefixcmd, lists): Make static.
* unittests/observable-selftests.c (test_notification): Make
static.
* unittests/optional/assignment/1.cc (counter): Make static.
* unittests/optional/assignment/2.cc (counter): Make static.
* unittests/optional/assignment/3.cc (counter): Make static.
* unittests/optional/assignment/4.cc (counter): Make static.
* unittests/optional/assignment/5.cc (counter): Make static.
* unittests/optional/assignment/6.cc (counter): Make static.

gdbserver/ChangeLog:

* ax.cc (bytecode_address_table): Make static.
* debug.cc (debug_file): Make static.
* linux-low.cc (stopping_threads): Make static.
(step_over_bkpt): Make static.
* linux-x86-low.cc (amd64_emit_ops, i386_emit_ops): Make static.
* tracepoint.cc (stop_tracing_bkpt, flush_trace_buffer_bkpt,
alloced_trace_state_variables, trace_buffer_ctrl,
tracing_start_time, tracing_stop_time, tracing_user_name,
tracing_notes, tracing_stop_note): Make static.

Change-Id: Ic1d8034723b7802502bda23770893be2338ab020

43 files changed:
gdb/ChangeLog
gdb/aarch64-linux-tdep.c
gdb/aarch64-tdep.c
gdb/arm-linux-tdep.c
gdb/arm-tdep.c
gdb/auto-load.c
gdb/csky-tdep.c
gdb/gdbarch.c
gdb/gnu-v2-abi.c
gdb/i386-netbsd-tdep.c
gdb/i386-tdep.c
gdb/infrun.c
gdb/linux-nat.c
gdb/linux-thread-db.c
gdb/maint-test-options.c
gdb/mep-tdep.c
gdb/mi/mi-cmds.c
gdb/nat/linux-osdata.c
gdb/ppc-netbsd-tdep.c
gdb/progspace.c
gdb/python/py-param.c
gdb/python/py-record-btrace.c
gdb/python/py-record.c
gdb/record.c
gdb/regcache.c
gdb/registry.h
gdb/symmisc.c
gdb/top.c
gdb/tracepoint.c
gdb/unittests/command-def-selftests.c
gdb/unittests/observable-selftests.c
gdb/unittests/optional/assignment/1.cc
gdb/unittests/optional/assignment/2.cc
gdb/unittests/optional/assignment/3.cc
gdb/unittests/optional/assignment/4.cc
gdb/unittests/optional/assignment/5.cc
gdb/unittests/optional/assignment/6.cc
gdbserver/ChangeLog
gdbserver/ax.cc
gdbserver/debug.cc
gdbserver/linux-low.cc
gdbserver/linux-x86-low.cc
gdbserver/tracepoint.cc

index 4c686a95edaf46332923e6209da4129619c017e7..a2759ef32b3dd6c127724c2e01240993b478027e 100644 (file)
@@ -1,3 +1,51 @@
+2021-01-20  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * aarch64-linux-tdep.c (aarch64_linux_record_tdep): Make static.
+       * aarch64-tdep.c (tdesc_aarch64_list, aarch64_prologue_unwind,
+       aarch64_stub_unwind, aarch64_normal_base, ): Make static.
+       * arm-linux-tdep.c (arm_prologue_unwind): Make static.
+       * arm-tdep.c (struct frame_unwind): Make static.
+       * auto-load.c (auto_load_safe_path_vec): Make static.
+       * csky-tdep.c (csky_stub_unwind): Make static.
+       * gdbarch.c (gdbarch_data_registry): Make static.
+       * gnu-v2-abi.c (gnu_v2_abi_ops): Make static.
+       * i386-netbsd-tdep.c (i386nbsd_mc_reg_offset): Make static.
+       * i386-tdep.c (i386_frame_setup_skip_insns,
+       i386_tramp_chain_in_reg_insns, i386_tramp_chain_on_stack_insns):
+       Make static.
+       * infrun.c (observer_mode): Make static.
+       * linux-nat.c (sigchld_action): Make static.
+       * linux-thread-db.c (thread_db_list): Make static.
+       * maint-test-options.c (maintenance_test_options_list):
+       * mep-tdep.c (mep_csr_registers): Make static.
+       * mi/mi-cmds.c (struct mi_cmd_stats): Remove struct type name.
+       (stats): Make static.
+       * nat/linux-osdata.c (struct osdata_type): Make static.
+       * ppc-netbsd-tdep.c (ppcnbsd_reg_offsets): Make static.
+       * progspace.c (last_program_space_num): Make static.
+       * python/py-param.c (struct parm_constant): Remove struct type
+       name.
+       (parm_constants): Make static.
+       * python/py-record-btrace.c (btpy_list_methods): Make static.
+       * python/py-record.c (recpy_gap_type): Make static.
+       * record.c (record_goto_cmdlist): Make static.
+       * regcache.c (regcache_descr_handle): Make static.
+       * registry.h (DEFINE_REGISTRY): Make definition static.
+       * symmisc.c (std_in, std_out, std_err): Make static.
+       * top.c (previous_saved_command_line): Make static.
+       * tracepoint.c (trace_user, trace_notes, trace_stop_notes): Make
+       static.
+       * unittests/command-def-selftests.c (nr_duplicates,
+       nr_invalid_prefixcmd, lists): Make static.
+       * unittests/observable-selftests.c (test_notification): Make
+       static.
+       * unittests/optional/assignment/1.cc (counter): Make static.
+       * unittests/optional/assignment/2.cc (counter): Make static.
+       * unittests/optional/assignment/3.cc (counter): Make static.
+       * unittests/optional/assignment/4.cc (counter): Make static.
+       * unittests/optional/assignment/5.cc (counter): Make static.
+       * unittests/optional/assignment/6.cc (counter): Make static.
+
 2021-01-20  Joel Sherrill  <joel@rtems.org>
 
        PR gdb/27219
index 954b05ca74065d07a423516e9fbd6f7e4715d3b8..b1bbd55e5c328642b3bd4c369280c11c0b3b8681 100644 (file)
@@ -849,7 +849,7 @@ aarch64_stap_parse_special_token (struct gdbarch *gdbarch,
 
 /* AArch64 process record-replay constructs: syscall, signal etc.  */
 
-struct linux_record_tdep aarch64_linux_record_tdep;
+static linux_record_tdep aarch64_linux_record_tdep;
 
 /* Enum that defines the AArch64 linux specific syscall identifiers used for
    process record/replay.  */
index 3e26a95a14c73b535e023f602893ad79084d23b3..d1e15497a46ca250d606f4da77ad653fecc41e1c 100644 (file)
@@ -58,7 +58,7 @@
 #define HA_MAX_NUM_FLDS                4
 
 /* All possible aarch64 target descriptors.  */
-struct target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1][2/*pauth*/];
+static target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1][2/*pauth*/];
 
 /* The standard register names, and all the valid aliases for them.  */
 static const struct
@@ -1109,7 +1109,7 @@ aarch64_prologue_prev_register (struct frame_info *this_frame,
 }
 
 /* AArch64 prologue unwinder.  */
-struct frame_unwind aarch64_prologue_unwind =
+static frame_unwind aarch64_prologue_unwind =
 {
   NORMAL_FRAME,
   aarch64_prologue_frame_unwind_stop_reason,
@@ -1203,7 +1203,7 @@ aarch64_stub_unwind_sniffer (const struct frame_unwind *self,
 }
 
 /* AArch64 stub unwinder.  */
-struct frame_unwind aarch64_stub_unwind =
+static frame_unwind aarch64_stub_unwind =
 {
   NORMAL_FRAME,
   aarch64_stub_frame_unwind_stop_reason,
@@ -1225,7 +1225,7 @@ aarch64_normal_frame_base (struct frame_info *this_frame, void **this_cache)
 }
 
 /* AArch64 default frame base information.  */
-struct frame_base aarch64_normal_base =
+static frame_base aarch64_normal_base =
 {
   &aarch64_prologue_unwind,
   aarch64_normal_frame_base,
index ada7f1137467e2551b2d2a0347e6c43b5f0887a2..20cae5bdc91872452f54c8b3f50eb3f09eae22d2 100644 (file)
@@ -1248,7 +1248,7 @@ arm_stap_parse_special_token (struct gdbarch *gdbarch,
 
 /* ARM process record-replay constructs: syscall, signal etc.  */
 
-struct linux_record_tdep arm_linux_record_tdep;
+static linux_record_tdep arm_linux_record_tdep;
 
 /* arm_canonicalize_syscall maps from the native arm Linux set
    of syscall ids into a canonical set of syscall ids used by
index 0184c252f1068d73a00527c647498261ce26ac0e..7916c974ac016040a9d41d04ada1562c41e87929 100644 (file)
@@ -2024,7 +2024,7 @@ arm_prologue_prev_register (struct frame_info *this_frame,
                                       prev_regnum);
 }
 
-struct frame_unwind arm_prologue_unwind = {
+static frame_unwind arm_prologue_unwind = {
   NORMAL_FRAME,
   arm_prologue_unwind_stop_reason,
   arm_prologue_this_id,
index b9acb8f8609ec98c721d46afc6644c48fdeee529..522f43b704cb32027c8246b37354290b6ba78b48 100644 (file)
@@ -170,7 +170,7 @@ static char *auto_load_safe_path;
 /* Vector of directory elements of AUTO_LOAD_SAFE_PATH with each one normalized
    by tilde_expand and possibly each entries has added its gdb_realpath
    counterpart.  */
-std::vector<gdb::unique_xmalloc_ptr<char>> auto_load_safe_path_vec;
+static std::vector<gdb::unique_xmalloc_ptr<char>> auto_load_safe_path_vec;
 
 /* Expand $datadir and $debugdir in STRING according to the rules of
    substitute_path_component.  */
index 3ec18a2cf900df266fbdee0827c196fc176a9fe6..609b684265f7434e6cc8bdcb912285b5b27ffeb1 100644 (file)
@@ -1998,7 +1998,7 @@ csky_stub_prev_register (struct frame_info *this_frame,
                                       prev_regnum);
 }
 
-struct frame_unwind csky_stub_unwind = {
+static frame_unwind csky_stub_unwind = {
   NORMAL_FRAME,
   default_frame_unwind_stop_reason,
   csky_stub_this_id,
index 4bdf40685048a32b115368ed11d610e9792721b2..43d1c154a7f1e3ba1c56ee02725316436ada3790 100644 (file)
@@ -5314,7 +5314,7 @@ struct gdbarch_data_registry
   struct gdbarch_data_registration *registrations;
 };
 
-struct gdbarch_data_registry gdbarch_data_registry =
+static struct gdbarch_data_registry gdbarch_data_registry =
 {
   0, NULL,
 };
index 45b8bb642a89d61963243bf67e19deae7c517c1f..466ae6c080279869c45ee19ac16bc9e2c39f2dbf 100644 (file)
@@ -29,7 +29,7 @@
 #include "cp-support.h"
 #include <ctype.h>
 
-struct cp_abi_ops gnu_v2_abi_ops;
+static cp_abi_ops gnu_v2_abi_ops;
 
 static int vb_match (struct type *, int, struct type *);
 
index 873bbe9a3577f5af1b0006f4137bdd9d01855366..76dcc4db1501e42e206a8ca36d1936949974505e 100644 (file)
@@ -76,7 +76,7 @@ static int i386nbsd_sc_reg_offset[] =
 };
 
 /* From <machine/mcontext.h>.  */
-int i386nbsd_mc_reg_offset[] =
+static int i386nbsd_mc_reg_offset[] =
 {
   11 * 4,                      /* %eax */
   10 * 4,                      /* %ecx */
index 991218de4c4a45917e3d3d12162290b145561a1a..6386716c3b85269ab318d35d2261b0602ae3dcb6 100644 (file)
@@ -1467,7 +1467,7 @@ i386_match_insn_block (CORE_ADDR pc, struct i386_insn *insn_patterns)
    yet, and only the scratch registers %eax, %ecx and %edx can be
    touched.  */
 
-struct i386_insn i386_frame_setup_skip_insns[] =
+static i386_insn i386_frame_setup_skip_insns[] =
 {
   /* Check for `movb imm8, r' and `movl imm32, r'.
     
@@ -2333,7 +2333,7 @@ static const struct frame_unwind i386_epilogue_frame_unwind =
 
 /* Static chain passed in register.  */
 
-struct i386_insn i386_tramp_chain_in_reg_insns[] =
+static i386_insn i386_tramp_chain_in_reg_insns[] =
 {
   /* `movl imm32, %eax' and `movl imm32, %ecx' */
   { 5, { 0xb8 }, { 0xfe } },
@@ -2346,7 +2346,7 @@ struct i386_insn i386_tramp_chain_in_reg_insns[] =
 
 /* Static chain passed on stack (when regparm=3).  */
 
-struct i386_insn i386_tramp_chain_on_stack_insns[] =
+static i386_insn i386_tramp_chain_on_stack_insns[] =
 {
   /* `push imm32' */
   { 5, { 0x68 }, { 0xff } },
index 940f575e22a2ac2831d8ce2dfa1e735ace747f5c..3f143971707a7a8f8e1d6b93c6509e89d7b7f0cb 100644 (file)
@@ -221,7 +221,7 @@ show_non_stop (struct ui_file *file, int from_tty,
    non-stop, in which all GDB operations that might affect the
    target's execution have been disabled.  */
 
-bool observer_mode = false;
+static bool observer_mode = false;
 static bool observer_mode_1 = false;
 
 static void
index dc524cf10dc16cdb62814c2a346cefdb036341d4..3c7117bff6e616376201988ee77a591244329ebc 100644 (file)
@@ -757,7 +757,7 @@ static sigset_t suspend_mask;
 static sigset_t blocked_mask;
 
 /* SIGCHLD action.  */
-struct sigaction sigchld_action;
+static struct sigaction sigchld_action;
 
 /* Block child signals (SIGCHLD and linux threads signals), and store
    the previous mask in PREV_MASK.  */
index 2ce31dc02708c262a0f02958ff47fee8574a5a5f..0a32e40f4d5f17443ee9934ab8393989fdaf6830 100644 (file)
@@ -209,7 +209,7 @@ struct thread_db_info
 
 /* List of known processes using thread_db, and the required
    bookkeeping.  */
-struct thread_db_info *thread_db_list;
+static thread_db_info *thread_db_list;
 
 static void thread_db_find_new_threads_1 (thread_info *stopped);
 static void thread_db_find_new_threads_2 (thread_info *stopped,
index 9483f560dea8fd4c5d20d56a3fbc42de288d6fab..16ecd1dd7e58b711810dcc65c285295af7269298 100644 (file)
@@ -409,7 +409,7 @@ maintenance_test_options_unknown_is_operand_command_completer
 }
 
 /* Command list for maint test-options.  */
-struct cmd_list_element *maintenance_test_options_list;
+static cmd_list_element *maintenance_test_options_list;
 
 \f
 void _initialize_maint_test_options ();
index eaa713f5e44a078c74dab984385c1eb04db29624..0dcfa48d67c118a068077e51dba386259ac45401 100644 (file)
@@ -661,7 +661,7 @@ struct mep_csr_register
    We just list the register numbers here explicitly to help catch
    typos.  */
 #define CSR(name) MEP_RAW_ ## name ## _REGNUM, MEP_ ## name ## _REGNUM
-struct mep_csr_register mep_csr_registers[] = {
+static mep_csr_register mep_csr_registers[] = {
   { CSR(PC),    0xffffffff },   /* manual says r/o, but we can write it */
   { CSR(LP),    0xffffffff },
   { CSR(SAR),   0x0000003f },
index 93a826235c38d107f7e6af9052a9e393072e2f41..df4290ae5dcc05ac04763edb253b93df75e7fd5a 100644 (file)
@@ -220,13 +220,12 @@ mi_lookup (const char *command)
 
 /* Used for collecting hash hit/miss statistics.  */
 
-struct mi_cmd_stats
+static struct
 {
   int hit;
   int miss;
   int rehash;
-};
-struct mi_cmd_stats stats;
+} stats;
 
 /* Look up a command.  */
 
index ce436c1593560f8da03f9120847b729c5e884a63..7034dd8237626502e7908ac6cdb55229213de6f4 100644 (file)
@@ -1284,7 +1284,7 @@ linux_xfer_osdata_modules (struct buffer *buffer)
 
 static void linux_xfer_osdata_info_os_types (struct buffer *buffer);
 
-struct osdata_type {
+static struct osdata_type {
   const char *type;
   const char *title;
   const char *description;
index 1230014b113ecfe4e2daff83a33630a765dc1bc6..31f11993889444f5ae39c3ae47c9a893b88f2cf3 100644 (file)
@@ -33,7 +33,7 @@
 #include "solib-svr4.h"
 
 /* Register offsets from <machine/reg.h>.  */
-struct ppc_reg_offsets ppcnbsd_reg_offsets;
+static ppc_reg_offsets ppcnbsd_reg_offsets;
 \f
 
 /* Core file support.  */
index 8683970125289de35fb6b83b222d09d7fcf2d83f..ebbc784dcfbb5fb8f57aa80f1882d98ff063db82 100644 (file)
@@ -29,7 +29,7 @@
 #include <algorithm>
 
 /* The last program space number assigned.  */
-int last_program_space_num = 0;
+static int last_program_space_num = 0;
 
 /* The head of the program spaces list.  */
 std::vector<struct program_space *> program_spaces;
index d37fd301e962099bedb4d8a41c2091cdedc16861..49819ce4f109202b599a8b71949bafb988272da3 100644 (file)
 #include "arch-utils.h"
 
 /* Parameter constants and their values.  */
-struct parm_constant
-{
+static struct {
   const char *name;
   int value;
-};
-
-struct parm_constant parm_constants[] =
+} parm_constants[] =
 {
   { "PARAM_BOOLEAN", var_boolean }, /* ARI: var_boolean */
   { "PARAM_AUTO_BOOLEAN", var_auto_boolean },
index d5a3da91d198b1ce650fdda308ef1dfa07ce8a20..1c10a0598dafcc3111ceb80c82c3f85385938b4b 100644 (file)
@@ -808,7 +808,7 @@ recpy_bt_goto (PyObject *self, PyObject *args)
 
 /* BtraceList methods.  */
 
-struct PyMethodDef btpy_list_methods[] =
+static PyMethodDef btpy_list_methods[] =
 {
   { "count", btpy_list_count, METH_O, "count number of occurrences"},
   { "index", btpy_list_index, METH_O, "index of entry"},
index ddfb5d8fdacd0d7ee3479071c62c6a7e57013c85..1747f74d7e668f37f94c5ccc962bd4258299f5f7 100644 (file)
@@ -45,7 +45,7 @@ PyTypeObject recpy_func_type = {
 
 /* Python RecordGap type.  */
 
-PyTypeObject recpy_gap_type = {
+static PyTypeObject recpy_gap_type = {
   PyVarObject_HEAD_INIT (NULL, 0)
 };
 
index 9e19261f460bc40b91784e20e3e991890a492273..cd541b56f43879bf5407eabc56047407be60306f 100644 (file)
@@ -48,7 +48,7 @@ static unsigned int record_call_history_size = 10;
 static unsigned int record_call_history_size_setshow_var;
 
 struct cmd_list_element *record_cmdlist = NULL;
-struct cmd_list_element *record_goto_cmdlist = NULL;
+static struct cmd_list_element *record_goto_cmdlist = NULL;
 struct cmd_list_element *set_record_cmdlist = NULL;
 struct cmd_list_element *show_record_cmdlist = NULL;
 struct cmd_list_element *info_record_cmdlist = NULL;
index a0407c74ee9fed1d95dd039af100b00701b13fb4..27c0ae5ae2398bd4b1bbf85a5214c80baee271aa 100644 (file)
@@ -41,7 +41,7 @@
 /* Per-architecture object describing the layout of a register cache.
    Computed once when the architecture is created.  */
 
-struct gdbarch_data *regcache_descr_handle;
+static struct gdbarch_data *regcache_descr_handle;
 
 struct regcache_descr
 {
index 972ebf33c9493824600ed2f9280fdd38385edff6..7b0b284c7ae6c028b79a14899e78c4ac54218d10 100644 (file)
@@ -154,7 +154,7 @@ void *registry_data (struct registry_fields *fields,
 /* Define a new registry implementation.  */
 
 #define DEFINE_REGISTRY(TAG, ACCESS)                                   \
-struct registry_data_registry TAG ## _data_registry = { NULL, 0 };     \
+static struct registry_data_registry TAG ## _data_registry = { NULL, 0 }; \
                                                                        \
 const struct TAG ## _data *                                            \
 register_ ## TAG ## _data_with_cleanup (void (*save) (struct TAG *, void *), \
index 07631e11c5cdac5a4d21771dbd2b700459f55861..a8f8856f721891e2a8c96f71a206fe23151a114b 100644 (file)
@@ -47,9 +47,9 @@
    debugging GDB with itself.  Because stdin et al need not be constants,
    we initialize them in the _initialize_symmisc function at the bottom
    of the file.  */
-FILE *std_in;
-FILE *std_out;
-FILE *std_err;
+static FILE *std_in;
+static FILE *std_out;
+static FILE *std_err;
 
 /* Prototypes for local functions */
 
index 2c13864e120fe204b5c99e391b08ca79dd2769d0..4b0defd58fcf8b2db82be2962e717426385e5530 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -161,7 +161,7 @@ static const char *repeat_arguments;
    command.  We need this as when a command is running, saved_command_line
    already contains the line of the currently executing command.  */
 
-char *previous_saved_command_line;
+static char *previous_saved_command_line;
 
 /* If not NULL, the arguments that should be passed if the
    previous_saved_command_line is repeated.  */
index 17d70a6a8d420f038f5169d5e591d77fdf4878c3..0cbd2c68224997be66c2b215d593967846f87ec1 100644 (file)
@@ -145,15 +145,15 @@ static int trace_buffer_size = -1;
 
 /* Textual notes applying to the current and/or future trace runs.  */
 
-char *trace_user = NULL;
+static char *trace_user = NULL;
 
 /* Textual notes applying to the current and/or future trace runs.  */
 
-char *trace_notes = NULL;
+static char *trace_notes = NULL;
 
 /* Textual notes applying to the stopping of a trace.  */
 
-char *trace_stop_notes = NULL;
+static char *trace_stop_notes = NULL;
 
 /* support routines */
 
index 7b0cb2dad10cc9c6dbc3831601fbe9c3b28edb0e..e6aadf3124fabcd34b29ccc412e907987e765fea 100644 (file)
@@ -107,13 +107,13 @@ help_doc_invariants_tests ()
 namespace command_structure_tests {
 
 /* Nr of commands in which a duplicated list is found.  */
-unsigned int nr_duplicates = 0;
+static unsigned int nr_duplicates = 0;
 /* Nr of commands in a list having no valid prefix cmd.  */
-unsigned int nr_invalid_prefixcmd = 0;
+static unsigned int nr_invalid_prefixcmd = 0;
 
 /* A map associating a list with the prefix leading to it.  */
 
-std::map<cmd_list_element **, const char *> lists;
+static std::map<cmd_list_element **, const char *> lists;
 
 /* Store each command list in lists, associated with the prefix to reach it.  A
    list must only be found once.
index 1b22e86e3a9fe93f91aa77c187006404718b72c0..e19eaf810249b43dd030f596ee1ba921a23800a0 100644 (file)
@@ -24,7 +24,7 @@
 namespace selftests {
 namespace observers {
 
-gdb::observers::observable<int> test_notification ("test_notification");
+static gdb::observers::observable<int> test_notification ("test_notification");
 
 static int test_first_observer = 0;
 static int test_second_observer = 0;
index f711c4d9c1788136a516965d2de8b85c5a820afb..80eaa24a2abdf32205d9ec17bbe452093676fb38 100644 (file)
@@ -19,7 +19,7 @@ namespace assign_1 {
 
 struct exception {};
 
-int counter = 0;
+static int counter = 0;
 
 struct mixin_counter
 {
index fdc07f1e9526d655cbf542438e49038d6a10808d..85c41c555130f39fcca973ae63a8fb383eb9c438 100644 (file)
@@ -19,7 +19,7 @@ namespace assign_2 {
 
 struct exception {};
 
-int counter = 0;
+static int counter = 0;
 
 struct mixin_counter
 {
index e479f9c8a876aff970da4be7809cccf0b2c07376..03f6018c2183a71b8e0390e9a47f5aee52adffe1 100644 (file)
@@ -19,7 +19,7 @@ namespace assign_3 {
 
 struct exception {};
 
-int counter = 0;
+static int counter = 0;
 
 struct mixin_counter
 {
index 2bfe5620385632af94ae678568a044aef3953dc2..aa04292f97589ba720dbac372d38d8146f0f54d0 100644 (file)
@@ -19,7 +19,7 @@ namespace assign_4 {
 
 struct exception {};
 
-int counter = 0;
+static int counter = 0;
 
 struct mixin_counter
 {
index 4112e9f2dcfed9b2b774815d562a2e7c7f054097..8c27e7b6f2226183bc830d62be376290f158a549 100644 (file)
@@ -17,7 +17,7 @@
 
 namespace assign_5 {
 
-int counter = 0;
+static int counter = 0;
 
 struct mixin_counter
 {
index 423b3e79a89e3440303b0e10ac810bc2714cc8a5..da01fd5d924ba640930a6acb4037ea71f64e258f 100644 (file)
@@ -17,7 +17,7 @@
 
 namespace assign_6 {
 
-int counter = 0;
+static int counter = 0;
 
 struct mixin_counter
 {
index 7231d9a47b4bb5fcb3c4d932865d153f072538f5..2f883e05b5cd4ea3ad7e416539e48eb1e05a7a8a 100644 (file)
@@ -1,3 +1,15 @@
+2021-01-20  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * ax.cc (bytecode_address_table): Make static.
+       * debug.cc (debug_file): Make static.
+       * linux-low.cc (stopping_threads): Make static.
+       (step_over_bkpt): Make static.
+       * linux-x86-low.cc (amd64_emit_ops, i386_emit_ops): Make static.
+       * tracepoint.cc (stop_tracing_bkpt, flush_trace_buffer_bkpt,
+       alloced_trace_state_variables, trace_buffer_ctrl,
+       tracing_start_time, tracing_stop_time, tracing_user_name,
+       tracing_notes, tracing_stop_note): Make static.
+
 2021-01-20  Tom de Vries  <tdevries@suse.de>
 
        * linux-x86-low.cc (collect_register_i386): New function.
index 9a968c598e0e3ee22141c72a7544dd172a3015e2..a217a3d3dadd9b9858fc84fb2985784f07ceab98 100644 (file)
@@ -146,7 +146,7 @@ CORE_ADDR current_insn_ptr;
 
 int emit_error;
 
-struct bytecode_address
+static struct bytecode_address
 {
   int pc;
   CORE_ADDR address;
index b3a5fe1b15c8c79b658b4d01f836b900017592a9..12f6db0316f3f071048c06b38a2cac86318bfeed 100644 (file)
@@ -24,7 +24,7 @@ int remote_debug = 0;
 #endif
 
 /* Output file for debugging.  Default to standard error.  */
-FILE *debug_file = stderr;
+static FILE *debug_file = stderr;
 
 /* See debug.h.  */
 int debug_threads;
index 4b43d171d2d251c0794fb8781c79fd23443e285c..d167914d63eefae8b2f83293e80f8405b540ba0c 100644 (file)
@@ -253,7 +253,7 @@ enum stopping_threads_kind
   };
 
 /* This is set while stop_all_lwps is in effect.  */
-enum stopping_threads_kind stopping_threads = NOT_STOPPING_THREADS;
+static stopping_threads_kind stopping_threads = NOT_STOPPING_THREADS;
 
 /* FIXME make into a target method?  */
 int using_threads = 1;
@@ -272,7 +272,7 @@ static int check_ptrace_stopped_lwp_gone (struct lwp_info *lp);
 
 /* When the event-loop is doing a step-over, this points at the thread
    being stepped.  */
-ptid_t step_over_bkpt;
+static ptid_t step_over_bkpt;
 
 bool
 linux_process_target::low_supports_breakpoints ()
index d3273a18f47bd8d403c0363d23fe88f8c333ec4f..58ca4bab2958824682ecded01934ed111a5a5b0a 100644 (file)
@@ -2219,7 +2219,7 @@ amd64_emit_ge_goto (int *offset_p, int *size_p)
     *size_p = 4;
 }
 
-struct emit_ops amd64_emit_ops =
+static emit_ops amd64_emit_ops =
   {
     amd64_emit_prologue,
     amd64_emit_epilogue,
@@ -2888,7 +2888,7 @@ i386_emit_ge_goto (int *offset_p, int *size_p)
     *size_p = 4;
 }
 
-struct emit_ops i386_emit_ops =
+static emit_ops i386_emit_ops =
   {
     i386_emit_prologue,
     i386_emit_epilogue,
index 5c5dac0c04e8bc5705cb9cd4a65cc35071919a77..bc8fb267e90b8f9a675db6a25199cc9dae7b7636 100644 (file)
@@ -402,11 +402,11 @@ tracepoint_handler (CORE_ADDR address)
 }
 
 /* Breakpoint at "stop_tracing" in the inferior lib.  */
-struct breakpoint *stop_tracing_bkpt;
+static struct breakpoint *stop_tracing_bkpt;
 static int stop_tracing_handler (CORE_ADDR);
 
 /* Breakpoint at "flush_trace_buffer" in the inferior lib.  */
-struct breakpoint *flush_trace_buffer_bkpt;
+static struct breakpoint *flush_trace_buffer_bkpt;
 static int flush_trace_buffer_handler (CORE_ADDR);
 
 static void download_trace_state_variables (void);
@@ -912,7 +912,7 @@ struct trace_state_variable
 /* Linked list of all trace state variables.  */
 
 #ifdef IN_PROCESS_AGENT
-struct trace_state_variable *alloced_trace_state_variables;
+static struct trace_state_variable *alloced_trace_state_variables;
 #endif
 
 IP_AGENT_EXPORT_VAR struct trace_state_variable *trace_state_variables;
@@ -1170,7 +1170,7 @@ IP_AGENT_EXPORT_VAR unsigned int trace_buffer_ctrl_curr;
    it doesn't need to sync with itself.  Define it as array anyway so
    that the rest of the code base doesn't need to care for the
    difference.  */
-struct trace_buffer_control trace_buffer_ctrl[1];
+static trace_buffer_control trace_buffer_ctrl[1];
 # define TRACE_BUFFER_CTRL_CURR 0
 #endif
 
@@ -1264,23 +1264,23 @@ static int tracing_stop_tpnum;
 /* 64-bit timestamps for the trace run's start and finish, expressed
    in microseconds from the Unix epoch.  */
 
-LONGEST tracing_start_time;
-LONGEST tracing_stop_time;
+static LONGEST tracing_start_time;
+static LONGEST tracing_stop_time;
 
 /* The (optional) user-supplied name of the user that started the run.
    This is an arbitrary string, and may be NULL.  */
 
-char *tracing_user_name;
+static char *tracing_user_name;
 
 /* Optional user-supplied text describing the run.  This is
    an arbitrary string, and may be NULL.  */
 
-char *tracing_notes;
+static char *tracing_notes;
 
 /* Optional user-supplied text explaining a tstop command.  This is an
    arbitrary string, and may be NULL.  */
 
-char *tracing_stop_note;
+static char *tracing_stop_note;
 
 #endif
 
This page took 0.061298 seconds and 4 git commands to generate.