Include xml-support.h to get a variable declaration

Message ID 20191007190631.47743-1-cbiesinger@google.com
State New, archived
Headers

Commit Message

Terekhov, Mikhail via Gdb-patches Oct. 7, 2019, 7:06 p.m. UTC
  Instead of declaring xml_builtin as an extern variable
in the .c file.

gdb/gdbserver/ChangeLog:

2019-10-07  Christian Biesinger  <cbiesinger@google.com>

	* server.c (get_features_xml): Remove declaration of xml_builtin
	in favor of including xml-support.h.
---
 gdb/gdbserver/server.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Tom Tromey Oct. 9, 2019, 5:47 p.m. UTC | #1
>>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:

Christian> Instead of declaring xml_builtin as an extern variable
Christian> in the .c file.

Christian> gdb/gdbserver/ChangeLog:

Christian> 2019-10-07  Christian Biesinger  <cbiesinger@google.com>

Christian> 	* server.c (get_features_xml): Remove declaration of xml_builtin
Christian> 	in favor of including xml-support.h.

I don't think we want to include xml-support.h in gdbserver.

Maybe the xml_builtin can be declared somewhere else instead.
It's only defined in generated files according to the comment.

Tom
  

Patch

diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 0bfff04fd7..da20340b7a 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -45,6 +45,10 @@ 
 #include "gdbsupport/selftest.h"
 #include "gdbsupport/scope-exit.h"
 
+#ifdef USE_XML
+#include "xml-support.h"
+#endif
+
 #define require_running_or_return(BUF)		\
   if (!target_running ())			\
     {						\
@@ -920,7 +924,6 @@  get_features_xml (const char *annex)
 
 #ifdef USE_XML
   {
-    extern const char *const xml_builtin[][2];
     int i;
 
     /* Look for the annex.  */