gdb: make some variables static

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
This commit is contained in:
Simon Marchi 2021-01-20 20:55:05 -05:00
parent a6c11cbb14
commit 6bd434d6ca
43 changed files with 124 additions and 68 deletions

View 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> 2021-01-20 Joel Sherrill <joel@rtems.org>
PR gdb/27219 PR gdb/27219

View file

@ -849,7 +849,7 @@ aarch64_stap_parse_special_token (struct gdbarch *gdbarch,
/* AArch64 process record-replay constructs: syscall, signal etc. */ /* 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 /* Enum that defines the AArch64 linux specific syscall identifiers used for
process record/replay. */ process record/replay. */

View file

@ -58,7 +58,7 @@
#define HA_MAX_NUM_FLDS 4 #define HA_MAX_NUM_FLDS 4
/* All possible aarch64 target descriptors. */ /* 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. */ /* The standard register names, and all the valid aliases for them. */
static const struct static const struct
@ -1109,7 +1109,7 @@ aarch64_prologue_prev_register (struct frame_info *this_frame,
} }
/* AArch64 prologue unwinder. */ /* AArch64 prologue unwinder. */
struct frame_unwind aarch64_prologue_unwind = static frame_unwind aarch64_prologue_unwind =
{ {
NORMAL_FRAME, NORMAL_FRAME,
aarch64_prologue_frame_unwind_stop_reason, aarch64_prologue_frame_unwind_stop_reason,
@ -1203,7 +1203,7 @@ aarch64_stub_unwind_sniffer (const struct frame_unwind *self,
} }
/* AArch64 stub unwinder. */ /* AArch64 stub unwinder. */
struct frame_unwind aarch64_stub_unwind = static frame_unwind aarch64_stub_unwind =
{ {
NORMAL_FRAME, NORMAL_FRAME,
aarch64_stub_frame_unwind_stop_reason, 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. */ /* AArch64 default frame base information. */
struct frame_base aarch64_normal_base = static frame_base aarch64_normal_base =
{ {
&aarch64_prologue_unwind, &aarch64_prologue_unwind,
aarch64_normal_frame_base, aarch64_normal_frame_base,

View file

@ -1248,7 +1248,7 @@ arm_stap_parse_special_token (struct gdbarch *gdbarch,
/* ARM process record-replay constructs: syscall, signal etc. */ /* 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 /* arm_canonicalize_syscall maps from the native arm Linux set
of syscall ids into a canonical set of syscall ids used by of syscall ids into a canonical set of syscall ids used by

View file

@ -2024,7 +2024,7 @@ arm_prologue_prev_register (struct frame_info *this_frame,
prev_regnum); prev_regnum);
} }
struct frame_unwind arm_prologue_unwind = { static frame_unwind arm_prologue_unwind = {
NORMAL_FRAME, NORMAL_FRAME,
arm_prologue_unwind_stop_reason, arm_prologue_unwind_stop_reason,
arm_prologue_this_id, arm_prologue_this_id,

View file

@ -170,7 +170,7 @@ static char *auto_load_safe_path;
/* Vector of directory elements of AUTO_LOAD_SAFE_PATH with each one normalized /* 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 by tilde_expand and possibly each entries has added its gdb_realpath
counterpart. */ 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 /* Expand $datadir and $debugdir in STRING according to the rules of
substitute_path_component. */ substitute_path_component. */

View file

@ -1998,7 +1998,7 @@ csky_stub_prev_register (struct frame_info *this_frame,
prev_regnum); prev_regnum);
} }
struct frame_unwind csky_stub_unwind = { static frame_unwind csky_stub_unwind = {
NORMAL_FRAME, NORMAL_FRAME,
default_frame_unwind_stop_reason, default_frame_unwind_stop_reason,
csky_stub_this_id, csky_stub_this_id,

View file

@ -5314,7 +5314,7 @@ struct gdbarch_data_registry
struct gdbarch_data_registration *registrations; struct gdbarch_data_registration *registrations;
}; };
struct gdbarch_data_registry gdbarch_data_registry = static struct gdbarch_data_registry gdbarch_data_registry =
{ {
0, NULL, 0, NULL,
}; };

View file

@ -29,7 +29,7 @@
#include "cp-support.h" #include "cp-support.h"
#include <ctype.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 *); static int vb_match (struct type *, int, struct type *);

View file

@ -76,7 +76,7 @@ static int i386nbsd_sc_reg_offset[] =
}; };
/* From <machine/mcontext.h>. */ /* From <machine/mcontext.h>. */
int i386nbsd_mc_reg_offset[] = static int i386nbsd_mc_reg_offset[] =
{ {
11 * 4, /* %eax */ 11 * 4, /* %eax */
10 * 4, /* %ecx */ 10 * 4, /* %ecx */

View 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 yet, and only the scratch registers %eax, %ecx and %edx can be
touched. */ 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'. /* 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. */ /* 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' */ /* `movl imm32, %eax' and `movl imm32, %ecx' */
{ 5, { 0xb8 }, { 0xfe } }, { 5, { 0xb8 }, { 0xfe } },
@ -2346,7 +2346,7 @@ struct i386_insn i386_tramp_chain_in_reg_insns[] =
/* Static chain passed on stack (when regparm=3). */ /* 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' */ /* `push imm32' */
{ 5, { 0x68 }, { 0xff } }, { 5, { 0x68 }, { 0xff } },

View 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 non-stop, in which all GDB operations that might affect the
target's execution have been disabled. */ target's execution have been disabled. */
bool observer_mode = false; static bool observer_mode = false;
static bool observer_mode_1 = false; static bool observer_mode_1 = false;
static void static void

View file

@ -757,7 +757,7 @@ static sigset_t suspend_mask;
static sigset_t blocked_mask; static sigset_t blocked_mask;
/* SIGCHLD action. */ /* SIGCHLD action. */
struct sigaction sigchld_action; static struct sigaction sigchld_action;
/* Block child signals (SIGCHLD and linux threads signals), and store /* Block child signals (SIGCHLD and linux threads signals), and store
the previous mask in PREV_MASK. */ the previous mask in PREV_MASK. */

View file

@ -209,7 +209,7 @@ struct thread_db_info
/* List of known processes using thread_db, and the required /* List of known processes using thread_db, and the required
bookkeeping. */ 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_1 (thread_info *stopped);
static void thread_db_find_new_threads_2 (thread_info *stopped, static void thread_db_find_new_threads_2 (thread_info *stopped,

View file

@ -409,7 +409,7 @@ maintenance_test_options_unknown_is_operand_command_completer
} }
/* Command list for maint test-options. */ /* Command list for maint test-options. */
struct cmd_list_element *maintenance_test_options_list; static cmd_list_element *maintenance_test_options_list;
void _initialize_maint_test_options (); void _initialize_maint_test_options ();

View file

@ -661,7 +661,7 @@ struct mep_csr_register
We just list the register numbers here explicitly to help catch We just list the register numbers here explicitly to help catch
typos. */ typos. */
#define CSR(name) MEP_RAW_ ## name ## _REGNUM, MEP_ ## name ## _REGNUM #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(PC), 0xffffffff }, /* manual says r/o, but we can write it */
{ CSR(LP), 0xffffffff }, { CSR(LP), 0xffffffff },
{ CSR(SAR), 0x0000003f }, { CSR(SAR), 0x0000003f },

View file

@ -220,13 +220,12 @@ mi_lookup (const char *command)
/* Used for collecting hash hit/miss statistics. */ /* Used for collecting hash hit/miss statistics. */
struct mi_cmd_stats static struct
{ {
int hit; int hit;
int miss; int miss;
int rehash; int rehash;
}; } stats;
struct mi_cmd_stats stats;
/* Look up a command. */ /* Look up a command. */

View file

@ -1284,7 +1284,7 @@ linux_xfer_osdata_modules (struct buffer *buffer)
static void linux_xfer_osdata_info_os_types (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 *type;
const char *title; const char *title;
const char *description; const char *description;

View file

@ -33,7 +33,7 @@
#include "solib-svr4.h" #include "solib-svr4.h"
/* Register offsets from <machine/reg.h>. */ /* Register offsets from <machine/reg.h>. */
struct ppc_reg_offsets ppcnbsd_reg_offsets; static ppc_reg_offsets ppcnbsd_reg_offsets;
/* Core file support. */ /* Core file support. */

View file

@ -29,7 +29,7 @@
#include <algorithm> #include <algorithm>
/* The last program space number assigned. */ /* 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. */ /* The head of the program spaces list. */
std::vector<struct program_space *> program_spaces; std::vector<struct program_space *> program_spaces;

View file

@ -29,13 +29,10 @@
#include "arch-utils.h" #include "arch-utils.h"
/* Parameter constants and their values. */ /* Parameter constants and their values. */
struct parm_constant static struct {
{
const char *name; const char *name;
int value; int value;
}; } parm_constants[] =
struct parm_constant parm_constants[] =
{ {
{ "PARAM_BOOLEAN", var_boolean }, /* ARI: var_boolean */ { "PARAM_BOOLEAN", var_boolean }, /* ARI: var_boolean */
{ "PARAM_AUTO_BOOLEAN", var_auto_boolean }, { "PARAM_AUTO_BOOLEAN", var_auto_boolean },

View file

@ -808,7 +808,7 @@ recpy_bt_goto (PyObject *self, PyObject *args)
/* BtraceList methods. */ /* BtraceList methods. */
struct PyMethodDef btpy_list_methods[] = static PyMethodDef btpy_list_methods[] =
{ {
{ "count", btpy_list_count, METH_O, "count number of occurrences"}, { "count", btpy_list_count, METH_O, "count number of occurrences"},
{ "index", btpy_list_index, METH_O, "index of entry"}, { "index", btpy_list_index, METH_O, "index of entry"},

View file

@ -45,7 +45,7 @@ PyTypeObject recpy_func_type = {
/* Python RecordGap type. */ /* Python RecordGap type. */
PyTypeObject recpy_gap_type = { static PyTypeObject recpy_gap_type = {
PyVarObject_HEAD_INIT (NULL, 0) PyVarObject_HEAD_INIT (NULL, 0)
}; };

View file

@ -48,7 +48,7 @@ static unsigned int record_call_history_size = 10;
static unsigned int record_call_history_size_setshow_var; static unsigned int record_call_history_size_setshow_var;
struct cmd_list_element *record_cmdlist = NULL; 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 *set_record_cmdlist = NULL;
struct cmd_list_element *show_record_cmdlist = NULL; struct cmd_list_element *show_record_cmdlist = NULL;
struct cmd_list_element *info_record_cmdlist = NULL; struct cmd_list_element *info_record_cmdlist = NULL;

View file

@ -41,7 +41,7 @@
/* Per-architecture object describing the layout of a register cache. /* Per-architecture object describing the layout of a register cache.
Computed once when the architecture is created. */ Computed once when the architecture is created. */
struct gdbarch_data *regcache_descr_handle; static struct gdbarch_data *regcache_descr_handle;
struct regcache_descr struct regcache_descr
{ {

View file

@ -154,7 +154,7 @@ void *registry_data (struct registry_fields *fields,
/* Define a new registry implementation. */ /* Define a new registry implementation. */
#define DEFINE_REGISTRY(TAG, ACCESS) \ #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 * \ const struct TAG ## _data * \
register_ ## TAG ## _data_with_cleanup (void (*save) (struct TAG *, void *), \ register_ ## TAG ## _data_with_cleanup (void (*save) (struct TAG *, void *), \

View file

@ -47,9 +47,9 @@
debugging GDB with itself. Because stdin et al need not be constants, debugging GDB with itself. Because stdin et al need not be constants,
we initialize them in the _initialize_symmisc function at the bottom we initialize them in the _initialize_symmisc function at the bottom
of the file. */ of the file. */
FILE *std_in; static FILE *std_in;
FILE *std_out; static FILE *std_out;
FILE *std_err; static FILE *std_err;
/* Prototypes for local functions */ /* Prototypes for local functions */

View file

@ -161,7 +161,7 @@ static const char *repeat_arguments;
command. We need this as when a command is running, saved_command_line command. We need this as when a command is running, saved_command_line
already contains the line of the currently executing command. */ 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 /* If not NULL, the arguments that should be passed if the
previous_saved_command_line is repeated. */ previous_saved_command_line is repeated. */

View file

@ -145,15 +145,15 @@ static int trace_buffer_size = -1;
/* Textual notes applying to the current and/or future trace runs. */ /* 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. */ /* 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. */ /* Textual notes applying to the stopping of a trace. */
char *trace_stop_notes = NULL; static char *trace_stop_notes = NULL;
/* support routines */ /* support routines */

View file

@ -107,13 +107,13 @@ help_doc_invariants_tests ()
namespace command_structure_tests { namespace command_structure_tests {
/* Nr of commands in which a duplicated list is found. */ /* 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. */ /* 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. */ /* 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 /* Store each command list in lists, associated with the prefix to reach it. A
list must only be found once. list must only be found once.

View file

@ -24,7 +24,7 @@
namespace selftests { namespace selftests {
namespace observers { 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_first_observer = 0;
static int test_second_observer = 0; static int test_second_observer = 0;

View file

@ -19,7 +19,7 @@ namespace assign_1 {
struct exception {}; struct exception {};
int counter = 0; static int counter = 0;
struct mixin_counter struct mixin_counter
{ {

View file

@ -19,7 +19,7 @@ namespace assign_2 {
struct exception {}; struct exception {};
int counter = 0; static int counter = 0;
struct mixin_counter struct mixin_counter
{ {

View file

@ -19,7 +19,7 @@ namespace assign_3 {
struct exception {}; struct exception {};
int counter = 0; static int counter = 0;
struct mixin_counter struct mixin_counter
{ {

View file

@ -19,7 +19,7 @@ namespace assign_4 {
struct exception {}; struct exception {};
int counter = 0; static int counter = 0;
struct mixin_counter struct mixin_counter
{ {

View file

@ -17,7 +17,7 @@
namespace assign_5 { namespace assign_5 {
int counter = 0; static int counter = 0;
struct mixin_counter struct mixin_counter
{ {

View file

@ -17,7 +17,7 @@
namespace assign_6 { namespace assign_6 {
int counter = 0; static int counter = 0;
struct mixin_counter struct mixin_counter
{ {

View 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> 2021-01-20 Tom de Vries <tdevries@suse.de>
* linux-x86-low.cc (collect_register_i386): New function. * linux-x86-low.cc (collect_register_i386): New function.

View file

@ -146,7 +146,7 @@ CORE_ADDR current_insn_ptr;
int emit_error; int emit_error;
struct bytecode_address static struct bytecode_address
{ {
int pc; int pc;
CORE_ADDR address; CORE_ADDR address;

View file

@ -24,7 +24,7 @@ int remote_debug = 0;
#endif #endif
/* Output file for debugging. Default to standard error. */ /* Output file for debugging. Default to standard error. */
FILE *debug_file = stderr; static FILE *debug_file = stderr;
/* See debug.h. */ /* See debug.h. */
int debug_threads; int debug_threads;

View file

@ -253,7 +253,7 @@ enum stopping_threads_kind
}; };
/* This is set while stop_all_lwps is in effect. */ /* 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? */ /* FIXME make into a target method? */
int using_threads = 1; 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 /* When the event-loop is doing a step-over, this points at the thread
being stepped. */ being stepped. */
ptid_t step_over_bkpt; static ptid_t step_over_bkpt;
bool bool
linux_process_target::low_supports_breakpoints () linux_process_target::low_supports_breakpoints ()

View file

@ -2219,7 +2219,7 @@ amd64_emit_ge_goto (int *offset_p, int *size_p)
*size_p = 4; *size_p = 4;
} }
struct emit_ops amd64_emit_ops = static emit_ops amd64_emit_ops =
{ {
amd64_emit_prologue, amd64_emit_prologue,
amd64_emit_epilogue, amd64_emit_epilogue,
@ -2888,7 +2888,7 @@ i386_emit_ge_goto (int *offset_p, int *size_p)
*size_p = 4; *size_p = 4;
} }
struct emit_ops i386_emit_ops = static emit_ops i386_emit_ops =
{ {
i386_emit_prologue, i386_emit_prologue,
i386_emit_epilogue, i386_emit_epilogue,

View file

@ -402,11 +402,11 @@ tracepoint_handler (CORE_ADDR address)
} }
/* Breakpoint at "stop_tracing" in the inferior lib. */ /* 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); static int stop_tracing_handler (CORE_ADDR);
/* Breakpoint at "flush_trace_buffer" in the inferior lib. */ /* 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 int flush_trace_buffer_handler (CORE_ADDR);
static void download_trace_state_variables (void); static void download_trace_state_variables (void);
@ -912,7 +912,7 @@ struct trace_state_variable
/* Linked list of all trace state variables. */ /* Linked list of all trace state variables. */
#ifdef IN_PROCESS_AGENT #ifdef IN_PROCESS_AGENT
struct trace_state_variable *alloced_trace_state_variables; static struct trace_state_variable *alloced_trace_state_variables;
#endif #endif
IP_AGENT_EXPORT_VAR struct trace_state_variable *trace_state_variables; 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 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 that the rest of the code base doesn't need to care for the
difference. */ difference. */
struct trace_buffer_control trace_buffer_ctrl[1]; static trace_buffer_control trace_buffer_ctrl[1];
# define TRACE_BUFFER_CTRL_CURR 0 # define TRACE_BUFFER_CTRL_CURR 0
#endif #endif
@ -1264,23 +1264,23 @@ static int tracing_stop_tpnum;
/* 64-bit timestamps for the trace run's start and finish, expressed /* 64-bit timestamps for the trace run's start and finish, expressed
in microseconds from the Unix epoch. */ in microseconds from the Unix epoch. */
LONGEST tracing_start_time; static LONGEST tracing_start_time;
LONGEST tracing_stop_time; static LONGEST tracing_stop_time;
/* The (optional) user-supplied name of the user that started the run. /* The (optional) user-supplied name of the user that started the run.
This is an arbitrary string, and may be NULL. */ 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 /* Optional user-supplied text describing the run. This is
an arbitrary string, and may be NULL. */ 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 /* Optional user-supplied text explaining a tstop command. This is an
arbitrary string, and may be NULL. */ arbitrary string, and may be NULL. */
char *tracing_stop_note; static char *tracing_stop_note;
#endif #endif