aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-02-09 14:59:08 +0000
committerPedro Alves <palves@redhat.com>2015-02-27 17:27:29 +0000
commit3c14e5a39bb4fddd911ba49483c44a12294ae6ef (patch)
tree6f65bbf44c73352fba1c550e807c52e730bdc295 /gdb/common/agent.h
parentAdd extern "C" to declarations of C symbols (diff)
downloadbinutils-gdb-3c14e5a39bb4fddd911ba49483c44a12294ae6ef.tar.gz
binutils-gdb-3c14e5a39bb4fddd911ba49483c44a12294ae6ef.tar.bz2
binutils-gdb-3c14e5a39bb4fddd911ba49483c44a12294ae6ef.zip
Make functions and variables exported by the IPA be extern "C"
Functions and variables that are exported by the IPA DSO (that GDBserver needs to look up) should have "C" mangling, thus be declared with extern "C". Function and variable declarations need the extern "C" marker, but variable definitions can't be marked extern, so the patch splits IP_AGENT_EXPORT into three. Building in C++ mode revealed that a few variables were missing IP_AGENT_EXPORT, thus the IPA has been broken when stripped, even in C mode... So this ends being a bug fix as well. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * common/agent.h (IPA_SYM_EXPORTED_NAME): New. (IPA_SYM): Use it. * common/common-defs.h (EXTERN_C_PUSH, EXTERN_C_POP): New macros. gdb/gdbserver/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use IP_AGENT_EXPORT_FUNC. * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use IP_AGENT_EXPORT_FUNC. * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR) (IP_AGENT_EXPORT): Delete. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (gdb_trampoline_buffer, gdb_trampoline_buffer_end) (gdb_trampoline_buffer_error, collecting, gdb_collect) (stop_tracing, flush_trace_buffer, about_to_request_buffer_space) (trace_buffer_is_full, stopping_tracepoint, expr_eval_result) (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl) (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi) (traceframe_read_count, traceframe_write_count) (traceframes_created, trace_state_variables, get_raw_reg) (get_trace_state_variable_value, set_trace_state_variable_value) (ust_loaded, helper_thread_id, cmd_buf): Use IPA_SYM_EXPORTED_NAME. (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC. (tracepoints) Use IP_AGENT_EXPORT_VAR. (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (last_tracepoint): Move into !IN_PROCESS_AGENT block. (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (trace_state_variables): Use IP_AGENT_EXPORT_VAR. (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (trace_buffer_ctrl, trace_buffer_ctrl_curr) (traceframe_write_count, traceframe_read_count) (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR. (about_to_request_buffer_space, get_trace_state_variable_value) (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC. (collecting): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (gdb_collect): Use IP_AGENT_EXPORT_FUNC. (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR. (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (gdb_trampoline_buffer, gdb_trampoline_buffer_end) (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR. * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL): Define. (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR) (IP_AGENT_EXPORT_VAR_DECL): Define. (tracing): Declare. (gdb_agent_get_raw_reg): Declare.
Diffstat (limited to 'gdb/common/agent.h')
-rw-r--r--gdb/common/agent.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/common/agent.h b/gdb/common/agent.h
index e01b0ad2d55..a004c2e6b6f 100644
--- a/gdb/common/agent.h
+++ b/gdb/common/agent.h
@@ -23,9 +23,10 @@ int agent_look_up_symbols (void *);
#define STRINGIZE_1(STR) #STR
#define STRINGIZE(STR) STRINGIZE_1(STR)
+#define IPA_SYM_EXPORTED_NAME(SYM) gdb_agent_ ## SYM
#define IPA_SYM(SYM) \
{ \
- STRINGIZE (gdb_agent_ ## SYM), \
+ STRINGIZE (IPA_SYM_EXPORTED_NAME (SYM)), \
offsetof (struct ipa_sym_addresses, addr_ ## SYM) \
}