Create xml-builtin.h to declare xml_builtins

xml-builtin.c only has character arrays and no dependencies, so this
creates a simple header file for that purpose so that gdbserver
can include that instead of re-declaring xml_builtin.

Despite the name, feature_to_c.sh is already specific to xml_builtins
(it hardcodes the variable name), so making it always output the
include for xml-builtin.h seems fine.

gdb/ChangeLog:

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

	* Makefile.in: Add xml-builtin.h.
	* features/feature_to_c.sh: Add an include for xml-builtin.h
	to ensure that the compiler checks that the types match.
	* xml-builtin.h: New file.
	* xml-support.c (fetch_xml_builtin): Add missing const.
	* xml-support.h: Remove declaration of xml_builtins.

gdb/gdbserver/ChangeLog:

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

	* server.c: Include xml-builtin.h.
	(get_xml_features): Don't declare xml_builtins here.

Change-Id: I806ef0851c43ead90b545a11794e41f5e5178436
This commit is contained in:
Christian Biesinger 2019-10-09 20:08:13 -05:00
parent cbbbc402e0
commit fec4e896d6
8 changed files with 50 additions and 7 deletions

View file

@ -19,6 +19,7 @@
#include "defs.h"
#include "gdbcmd.h"
#include "xml-builtin.h"
#include "xml-support.h"
#include "gdbsupport/filestuff.h"
#include "safe-ctype.h"
@ -919,7 +920,7 @@ xml_process_xincludes (std::string &result,
const char *
fetch_xml_builtin (const char *filename)
{
const char *(*p)[2];
const char *const (*p)[2];
for (p = xml_builtin; (*p)[0]; p++)
if (strcmp ((*p)[0], filename) == 0)