gdbserver: set IP_AGENT_EXPORT_FUNC to static when not building IPA, add declarations
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 13 Jan 2020 19:05:32 +0000 (14:05 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 13 Jan 2020 19:05:32 +0000 (14:05 -0500)
commit6e37c371af4a25d28623b618e30f93b040b4d4ae
tree13b5d5b60eadbbeeb69fb9b7c5dbda6791a2d80d
parentdf4a0200dc896abe32bef4172ca047465caaedfe
gdbserver: set IP_AGENT_EXPORT_FUNC to static when not building IPA, add declarations

Fixing the -Wmissing-declarations errors in gdbserver's tracepoint.c is
a bit tricky, because some functions are compiled for both gdbserver, in
which case they should be static, since they are only used in that file,
and for libinproctrace.so, in which case they should be externally
visible, since they need to be looked up.  In the case where they are
externally visible, -Wmissing-declarations requires that a declaration
exists (that's the point of the warning).

I've reused the IP_AGENT_EXPORT_FUNC macro to mark the functions as
static when compiled for gdbserver.  Some seemingly unnecessary
declarations are added for when compiling libinproctrace.so (thanks to
Tom for the suggestion).

gdb/gdbserver/ChangeLog:

* tracepoint.h (IP_AGENT_EXPORT_FUNC) [!IN_PROCESS_AGENT]:
Define to static.
* tracepoint.c (stop_tracing, flush_trace_buffer,
about_to_request_buffer_space, get_trace_state_variable_value,
set_trace_state_variable_value, gdb_collect): Add declaration.

Change-Id: If9c66151bd00c3b9c5caa27a7c21c5a3a952de2a
gdb/gdbserver/ChangeLog
gdb/gdbserver/tracepoint.c
gdb/gdbserver/tracepoint.h