binutils-gdb/gdb/common
Pedro Alves 3c14e5a39b 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.
2015-02-27 17:27:29 +00:00
..
agent.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
agent.h Make functions and variables exported by the IPA be extern "C" 2015-02-27 17:27:29 +00:00
ax.def [gdb/ax] small "setv" fix and documentation's adjustment. 2015-02-19 19:04:16 +04:00
break-common.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
btrace-common.c btrace: add struct btrace_data 2015-02-09 09:21:44 +01:00
btrace-common.h btrace: identify cpu 2015-02-09 09:49:15 +01:00
buffer.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
buffer.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
cleanups.c C++ keyword cleanliness, mostly auto-generated 2015-02-27 16:33:07 +00:00
cleanups.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
common-debug.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
common-debug.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
common-defs.h Make functions and variables exported by the IPA be extern "C" 2015-02-27 17:27:29 +00:00
common-exceptions.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
common-exceptions.h Add max-completions parameter, and implement tab-completion limiting. 2015-01-31 15:07:22 -08:00
common-regcache.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
common-types.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
common-utils.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
common-utils.h Move safe_strerror to common/ 2015-01-15 15:09:15 -05:00
common.host Move safe_strerror to common/ 2015-01-15 15:09:15 -05:00
common.m4 Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
create-version.sh Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
errors.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
errors.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
filestuff.c C++ keyword cleanliness, mostly auto-generated 2015-02-27 16:33:07 +00:00
filestuff.h C++ keyword cleanliness, mostly auto-generated 2015-02-27 16:33:07 +00:00
format.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
format.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb_assert.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb_locale.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb_setjmp.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb_signals.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb_vecs.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb_vecs.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb_wait.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
host-defs.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mingw-strerror.c Move safe_strerror to common/ 2015-01-15 15:09:15 -05:00
posix-strerror.c Move safe_strerror to common/ 2015-01-15 15:09:15 -05:00
print-utils.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
print-utils.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
ptid.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
ptid.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
queue.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
rsp-low.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
rsp-low.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
signals.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
symbol.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
vec.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
vec.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
version.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
x86-xstate.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
xml-utils.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
xml-utils.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00