From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20595 invoked by alias); 8 Feb 2007 13:06:29 -0000 Received: (qmail 20573 invoked by uid 22791); 8 Feb 2007 13:06:27 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 08 Feb 2007 13:06:19 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0) with ESMTP id l18D62jK015511; Thu, 8 Feb 2007 14:06:02 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0/Submit) id l18D62PH028549; Thu, 8 Feb 2007 14:06:02 +0100 (CET) Date: Thu, 08 Feb 2007 13:06:00 -0000 Message-Id: <200702081306.l18D62PH028549@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org, eliz@gnu.org In-reply-to: <20070207224910.GA26062@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 7 Feb 2007 17:49:10 -0500) Subject: Re: XML XInclude support References: <20070129213229.GA17422@nevyn.them.org> <20070206130330.GB31162@nevyn.them.org> <20070129213229.GA17422@nevyn.them.org> <20070206124910.GA31162@nevyn.them.org> <20070207183656.GA14189@nevyn.them.org> <20070207184458.GA15589@nevyn.them.org> <20070207224910.GA26062@nevyn.them.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00069.txt.bz2 > Date: Wed, 7 Feb 2007 17:49:10 -0500 > From: Daniel Jacobowitz > > 2007-02-07 Daniel Jacobowitz > > * Makefile.in (XMLFILES): New. > (COMMON_OBS): Add xml-builtin.o. > (xml-builtin.c, stamp-xml): New rules. > (xml-tdesc.o): Update. > * features/feature_to_c.sh: New file. > * xml-support.c (MAX_XINCLUDE_DEPTH): Define. > (struct gdb_xml_parser): Add dtd_name and is_xinclude. > (gdb_xml_start_element): Initialize scope after possibly reallocating > scopes. Move cleanup later. Handle the XInclude description > specially. > (gdb_xml_end_element): Only parse the body if there is a current element. > Call XML_DefaultCurrent if there is no element. > (gdb_xml_fetch_external_entity, gdb_xml_use_dtd): New. > (struct xinclude_parsing_data, xinclude_start_include) > (xinclude_end_include, xml_xinclude_default) > (xml_xinclude_start_doctype, xml_xinclude_end_doctype) > (xml_xinclude_xml_decl, xml_xinclude_cleanup, xinclude_attributes) > (xinclude_elements, xml_process_xincludes, fetch_xml_builtin): New. > * xml-support.h (xml_fetch_another, xml_process_xincludes) > (fetch_xml_builtin, xml_builtin, gdb_xml_use_dtd): New declarations. > * xml-tdesc.c (tdesc_parse_xml): Add fetcher_baton argument. Expand > XInclude directives. Use the compiled in DTD. > (fetch_xml_from_file): Add baton argument. Treat it as a containing > directory name. Do not warn here. > (file_read_description_xml): Update call. Warn here instead. Pass > a dirname as baton. > (fetch_available_features_from_target): New. > (target_read_description_xml): Use it. > * features/gdb-target.dtd: Add copyright notice. Use xinclude.dtd > to handle XInclude. > * features/xinclude.dtd: New file. > > 2007-02-07 Daniel Jacobowitz > > * gdb.xml/bad-include.xml, gdb.xml/inc-2.xml, gdb.xml/inc-body.xml, > gdb.xml/includes.xml, gdb.xml/tdesc-xinclude.exp: New files. > > 2007-02-07 Daniel Jacobowitz > > * gdb.texinfo (Target Description Format): Add section on XInclude. Hi Daniel, This broke my builds on OpenBSD :(. Here's the make output. --- rm -f xml-builtin.tmp AWK="nawk" /bin/sh ../../../src/gdb/gdb/features/feature_to_c.sh xml-builtin.tmp ../../../src/gdb/gdb/features/gdb-target.dtd ../../../src/gdb/gdb/features/xinclude.dtd nawk: weird printf conversion %', input record number 13, file source line number 15 nawk: not enough args in printf('%', ) input record number 13, file source line number 15 /bin/sh ../../../src/gdb/gdb/../move-if-change xml-builtin.tmp xml-builtin.c echo stamp > stamp-xml gcc -c -g -O2 -I. -I../../../src/gdb/gdb -I../../../src/gdb/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../../src/gdb/gdb/../include/opcode -I../../../src/gdb/gdb/../readline/.. -I../bfd -I../../../src/gdb/gdb/../bfd -I../../../src/gdb/gdb/../include -DMI_OUT=1 -DTUI=1 -I/usr/local/include -Wall -Wpointer-arith -Wformat-nonliteral -Wno-unused -Wno-switch -Werror xml-builtin.c xml-builtin.c:49: syntax error before `static' xml-builtin.c:110: `xml_feature_xinclude_dtd' undeclared here (not in a function) xml-builtin.c:110: initializer element is not constant xml-builtin.c:110: (near initialization for `xml_builtin[1][1]') *** Error code 1 Stop in /home/kettenis/obj/gdb/gdb. *** Error code 1 Stop in /home/kettenis/obj/gdb (line 8486 of Makefile). --- And here's the generated xml-builtin.c --- static const char xml_feature_gdb_target_dtd[] = { '<', '!', '-', '-', ' ', 'C', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', ' ', '(', 'C', ')', ' ', '2', '0', '0', '7', ' ', 'F', 'r', 'e', 'e', ' ', 'S', 'o', 'f', 't', 'w', 'a', 'r', 'e', ' ', 'F', 'o', 'u', 'n', 'd', 'a', 't', 'i', 'o', 'n', ',', ' ', 'I', 'n', 'c', '.', '\n', '\n', ' ', ' ', ' ', ' ', ' ', 'C', 'o', 'p', 'y', 'i', 'n', 'g', ' ', 'a', 'n', 'd', ' ', 'd', 'i', 's', 't', 'r', 'i', 'b', 'u', 't', 'i', 'o', 'n', ' ', 'o', 'f', ' ', 't', 'h', 'i', 's', ' ', 'f', 'i', 'l', 'e', ',', ' ', 'w', 'i', 't', 'h', ' ', 'o', 'r', ' ', 'w', 'i', 't', 'h', 'o', 'u', 't', ' ', 'm', 'o', 'd', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', ',', '\n', ' ', ' ', ' ', ' ', ' ', 'a', 'r', 'e', ' ', 'p', 'e', 'r', 'm', 'i', 't', 't', 'e', 'd', ' ', 'i', 'n', ' ', 'a', 'n', 'y', ' ', 'm', 'e', 'd', 'i', 'u', 'm', ' ', 'w', 'i', 't', 'h', 'o', 'u', 't', ' ', 'r', 'o', 'y', 'a', 'l', 't', 'y', ' ', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'd', ' ', 't', 'h', 'e', ' ', 'c', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', '\n', ' ', ' ', ' ', ' ', ' ', 'n', 'o', 't', 'i', 'c', 'e', ' ', 'a', 'n', 'd', ' ', 't', 'h', 'i', 's', ' ', 'n', 'o', 't', 'i', 'c', 'e', ' ', 'a', 'r', 'e', ' ', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '.', ' ', ' ', '-', '-', '>', '\n', '\n', '<', '!', '-', '-', ' ', 'T', 'h', 'e', ' ', 'r', 'o', 'o', 't', ' ', 'e', 'l', 'e', 'm', 'e', 'n', 't', ' ', 'o', 'f', ' ', 'a', ' ', 'G', 'D', 'B', ' ', 't', 'a', 'r', 'g', 'e', 't', ' ', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', ' ', 'i', 's', ' ', '<', 't', 'a', 'r', 'g', 'e', 't', '>', '.', ' ', ' ', '-', '-', '>', '\n', '\n', '<', '!', 'E', 'L', 'E', 'M', 'E', 'N', 'T', ' ', 't', 'a', 'r', 'g', 'e', 't', '\011', '(', 'a', 'r', 'c', 'h', 'i', 't', 'e', 'c', 't', 'u', 'r', 'e', '?', ')', '>', '\n', '\n', '<', '!', 'E', 'L', 'E', 'M', 'E', 'N', 'T', ' ', 'a', 'r', 'c', 'h', 'i', 't', 'e', 'c', 't', 'u', 'r', 'e', '\011', '(', '#', 'P', 'C', 'D', 'A', 'T', 'A', ')', '>', '\n', '\n', '<', '!', 'E', 'N', 'T', 'I', 'T', 'Y', ' ', static const char xml_feature_xinclude_dtd[] = { '<', '!', '-', '-', ' ', 'C', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', ' ', '(', 'C', ')', ' ', '2', '0', '0', '7', ' ', 'F', 'r', 'e', 'e', ' ', 'S', 'o', 'f', 't', 'w', 'a', 'r', 'e', ' ', 'F', 'o', 'u', 'n', 'd', 'a', 't', 'i', 'o', 'n', ',', ' ', 'I', 'n', 'c', '.', '\n', '\n', ' ', ' ', ' ', ' ', ' ', 'C', 'o', 'p', 'y', 'i', 'n', 'g', ' ', 'a', 'n', 'd', ' ', 'd', 'i', 's', 't', 'r', 'i', 'b', 'u', 't', 'i', 'o', 'n', ' ', 'o', 'f', ' ', 't', 'h', 'i', 's', ' ', 'f', 'i', 'l', 'e', ',', ' ', 'w', 'i', 't', 'h', ' ', 'o', 'r', ' ', 'w', 'i', 't', 'h', 'o', 'u', 't', ' ', 'm', 'o', 'd', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', ',', '\n', ' ', ' ', ' ', ' ', ' ', 'a', 'r', 'e', ' ', 'p', 'e', 'r', 'm', 'i', 't', 't', 'e', 'd', ' ', 'i', 'n', ' ', 'a', 'n', 'y', ' ', 'm', 'e', 'd', 'i', 'u', 'm', ' ', 'w', 'i', 't', 'h', 'o', 'u', 't', ' ', 'r', 'o', 'y', 'a', 'l', 't', 'y', ' ', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'd', ' ', 't', 'h', 'e', ' ', 'c', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', '\n', ' ', ' ', ' ', ' ', ' ', 'n', 'o', 't', 'i', 'c', 'e', ' ', 'a', 'n', 'd', ' ', 't', 'h', 'i', 's', ' ', 'n', 'o', 't', 'i', 'c', 'e', ' ', 'a', 'r', 'e', ' ', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '.', ' ', ' ', '-', '-', '>', '\n', '\n', '<', '!', '-', '-', ' ', 'G', 'D', 'B', ' ', 's', 'u', 'p', 'p', 'o', 'r', 't', 's', ' ', 'a', ' ', 's', 'u', 'b', 's', 'e', 't', ' ', 'o', 'f', ' ', 'X', 'I', 'n', 'c', 'l', 'u', 'd', 'e', '.', ' ', ' ', 'O', 'n', 'l', 'y', ' ', 'w', 'h', 'o', 'l', 'e', ' ', 'd', 'o', 'c', 'u', 'm', 'e', 'n', 't', 's', ' ', 'c', 'a', 'n', '\n', ' ', ' ', ' ', ' ', ' ', 'b', 'e', ' ', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'd', ',', ' ', 'a', 'n', 'd', ' ', 'o', 'n', 'l', 'y', ' ', 'a', 's', ' ', 'X', 'M', 'L', '.', ' ', ' ', '-', '-', '>', '\n', '\n', '<', '!', 'E', 'L', 'E', 'M', 'E', 'N', 'T', ' ', 'x', 'i', ':', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '\011', '(', 'E', 'M', 'P', 'T', 'Y', ')', '>', '\n', '<', '!', 'A', 'T', 'T', 'L', 'I', 'S', 'T', ' ', 'x', 'i', ':', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '\n', '\011', 'x', 'm', 'l', 'n', 's', ':', 'x', 'i', '\011', 'C', 'D', 'A', 'T', 'A', '\011', '#', 'F', 'I', 'X', 'E', 'D', ' ', '"', 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/', '2', '0', '0', '1', '/', 'X', 'I', 'n', 'c', 'l', 'u', 'd', 'e', '"', '\n', '\011', 'h', 'r', 'e', 'f', '\011', '\011', 'C', 'D', 'A', 'T', 'A', '\011', '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D', '>', '\n', 0 }; const char *const xml_builtin[][2] = { { "gdb-target.dtd", xml_feature_gdb_target_dtd }, { "xinclude.dtd", xml_feature_xinclude_dtd }, { 0, 0 } }; --- which indeed isn't valid C code. Did yoy use some GNU-isms in the bits of awk that are used to generate this code? Mark