Patchwork [01/15] Add back declarations for _initialize functions

login
register
mail settings
Submitter Tom Tromey
Date Jan. 10, 2020, 6:43 p.m.
Message ID <87zhevtao5.fsf@tromey.com>
Download mbox | patch
Permalink /patch/37288/
State New
Headers show

Comments

Tom Tromey - Jan. 10, 2020, 6:43 p.m.
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> I have just uploaded it to the "missing-declarations" branch on my github:
Simon>   https://github.com/simark/binutils-gdb/tree/missing-declarations

Thanks.

Simon> I have updated the patches slightly to account for the new unittests.  So if you
Simon> try to build, you'll stumble directly on the build error that made me give up:

I think just adding a few seemingly-redundant declarations is enough.
At least, the appended made it compile for me.

"IP_AGENT_EXPORT_FUNC" takes care of the static/extern distinction already.

Tom
Simon Marchi - Jan. 10, 2020, 9:46 p.m.
On 2020-01-10 1:43 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> I have just uploaded it to the "missing-declarations" branch on my github:
> Simon>   https://github.com/simark/binutils-gdb/tree/missing-declarations
> 
> Thanks.
> 
> Simon> I have updated the patches slightly to account for the new unittests.  So if you
> Simon> try to build, you'll stumble directly on the build error that made me give up:
> 
> I think just adding a few seemingly-redundant declarations is enough.
> At least, the appended made it compile for me.
> 
> "IP_AGENT_EXPORT_FUNC" takes care of the static/extern distinction already.

Thanks, that's really not bad indeed.  I've integrated your suggestion, and will send
a v2 right now.

Simon

Patch

diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 2ef94e6998d..bbca48b2efd 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -370,6 +370,9 @@  read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 #  define UNKNOWN_SIDE_EFFECTS() do {} while (0)
 #endif
 
+/* This is needed for -Wmissing-declarations.  */
+IP_AGENT_EXPORT_FUNC void stop_tracing (void);
+
 IP_AGENT_EXPORT_FUNC void
 stop_tracing (void)
 {
@@ -377,6 +380,9 @@  stop_tracing (void)
   UNKNOWN_SIDE_EFFECTS();
 }
 
+/* This is needed for -Wmissing-declarations.  */
+IP_AGENT_EXPORT_FUNC void flush_trace_buffer (void);
+
 IP_AGENT_EXPORT_FUNC void
 flush_trace_buffer (void)
 {
@@ -1496,6 +1502,9 @@  init_trace_buffer (LONGEST bufsize)
 
 #ifdef IN_PROCESS_AGENT
 
+/* This is needed for -Wmissing-declarations.  */
+IP_AGENT_EXPORT_FUNC void about_to_request_buffer_space (void);
+
 IP_AGENT_EXPORT_FUNC void
 about_to_request_buffer_space (void)
 {
@@ -2091,6 +2100,9 @@  create_trace_state_variable (int num, int gdb)
   return tsv;
 }
 
+/* This is needed for -Wmissing-declarations.  */
+IP_AGENT_EXPORT_FUNC LONGEST get_trace_state_variable_value (int num);
+
 IP_AGENT_EXPORT_FUNC LONGEST
 get_trace_state_variable_value (int num)
 {
@@ -2117,6 +2129,10 @@  get_trace_state_variable_value (int num)
   return tsv->value;
 }
 
+/* This is needed for -Wmissing-declarations.  */
+IP_AGENT_EXPORT_FUNC void set_trace_state_variable_value (int num,
+							  LONGEST val);
+
 IP_AGENT_EXPORT_FUNC void
 set_trace_state_variable_value (int num, LONGEST val)
 {
@@ -5786,6 +5802,10 @@  EXTERN_C_PUSH
 IP_AGENT_EXPORT_VAR collecting_t *collecting;
 EXTERN_C_POP
 
+/* This is needed for -Wmissing-declarations.  */
+IP_AGENT_EXPORT_FUNC void gdb_collect (struct tracepoint *tpoint,
+				       unsigned char *regs);
+
 /* This routine, called from the jump pad (in asm) is designed to be
    called from the jump pads of fast tracepoints, thus it is on the
    critical path.  */