From patchwork Sun Jun 19 20:42:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 13229 Received: (qmail 42278 invoked by alias); 19 Jun 2016 20:43:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 42246 invoked by uid 89); 19 Jun 2016 20:43:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, UNPARSEABLE_RELAY autolearn=no version=3.3.2 spammy=ipc, recv, statfs, U*$ X-HELO: layla.krisman.be Received: from Unknown (HELO layla.krisman.be) (176.31.208.35) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 19 Jun 2016 20:42:55 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (envelope-from ) id 1bEj6M-0005Df-4a; Sun, 19 Jun 2016 22:13:51 +0200 From: Gabriel Krisman Bertazi To: gdb-patches@sourceware.org Cc: palves@redhat.com, sergiodj@redhat.com, dje@google.com, Gabriel Krisman Bertazi Subject: [RESEND PATCH v7 4/5] Include group information to xml syscall files. Date: Sun, 19 Jun 2016 17:42:33 -0300 Message-Id: <1466368953-27063-1-git-send-email-gabriel@krisman.be> In-Reply-To: <1466368449-26477-1-git-send-email-gabriel@krisman.be> References: <1466368449-26477-1-git-send-email-gabriel@krisman.be> X-IsSubscribed: yes And... I forgot to reduce the patch size again by checking renames. Sorry, resending again, and I"ll make sure to add -M to my .gitconfig. We maintain linux-defaults.xml.in, a template file to hold generic group information. It is used by the XSL script that parses the architecture specific files to generate the final xml files, which are actually installed and loaded by GDB. The script is not run during the normal build process, only when building in maintainer mode. gdb/ * data-directory/Makefile.in: Generate syscall xml when building in maintainer mode. * configure.ac: Include dependency for xsltproc when building in maintainer-mode. * syscalls/apply-defaults.xsl: New file. * syscalls/linux-defaults.xml.in: New file. * syscalls/aarch64-linux.xml: Rename to aarch64-linux.xml.in. * syscalls/amd64-linux.xml: Rename to amd64-linux.xml.in. * syscalls/arm-linux.xml: Rename to arm-linux.xml.in. * syscalls/bfin-linux.xml: Rename to bfin-linux.xml.in. * syscalls/i386-linux.xml: Rename to i386-linux.xml.in. * syscalls/mips-n32-linux.xml: Rename to mips-n32-linux.xml.in. * syscalls/mips-n64-linux.xml: Rename to mips-n64-linux.xml.in. * syscalls/mips-o32-linux.xml: Rename to mips-o32-linux.xml.in. * syscalls/ppc-linux.xml: Rename to ppc-linux.xml.in. * syscalls/ppc64-linux.xml: Rename to ppc64-linux.xml.in. * syscalls/s390-linux.xml: Rename to s390-linux.xml.in. * syscalls/s390x-linux.xml: Rename to s390x-linux.xml.in. * syscalls/sparc-linux.xml: Rename to sparc-linux.xml.in. * syscalls/sparc64-linux.xml: Rename to sparc64-linux.xml.in. --- gdb/configure.ac | 9 + gdb/data-directory/Makefile.in | 21 +- .../{aarch64-linux.xml => aarch64-linux.xml.in} | 0 .../{amd64-linux.xml => amd64-linux.xml.in} | 0 gdb/syscalls/apply-defaults.xsl | 43 ++++ gdb/syscalls/{arm-linux.xml => arm-linux.xml.in} | 0 gdb/syscalls/{bfin-linux.xml => bfin-linux.xml.in} | 0 gdb/syscalls/{i386-linux.xml => i386-linux.xml.in} | 0 gdb/syscalls/linux-defaults.xml.in | 243 +++++++++++++++++++++ .../{mips-n32-linux.xml => mips-n32-linux.xml.in} | 0 .../{mips-n64-linux.xml => mips-n64-linux.xml.in} | 0 .../{mips-o32-linux.xml => mips-o32-linux.xml.in} | 0 gdb/syscalls/{ppc-linux.xml => ppc-linux.xml.in} | 0 .../{ppc64-linux.xml => ppc64-linux.xml.in} | 0 gdb/syscalls/{s390-linux.xml => s390-linux.xml.in} | 0 .../{s390x-linux.xml => s390x-linux.xml.in} | 0 .../{sparc-linux.xml => sparc-linux.xml.in} | 0 .../{sparc64-linux.xml => sparc64-linux.xml.in} | 0 18 files changed, 313 insertions(+), 3 deletions(-) rename gdb/syscalls/{aarch64-linux.xml => aarch64-linux.xml.in} (100%) rename gdb/syscalls/{amd64-linux.xml => amd64-linux.xml.in} (100%) create mode 100644 gdb/syscalls/apply-defaults.xsl rename gdb/syscalls/{arm-linux.xml => arm-linux.xml.in} (100%) rename gdb/syscalls/{bfin-linux.xml => bfin-linux.xml.in} (100%) rename gdb/syscalls/{i386-linux.xml => i386-linux.xml.in} (100%) create mode 100644 gdb/syscalls/linux-defaults.xml.in rename gdb/syscalls/{mips-n32-linux.xml => mips-n32-linux.xml.in} (100%) rename gdb/syscalls/{mips-n64-linux.xml => mips-n64-linux.xml.in} (100%) rename gdb/syscalls/{mips-o32-linux.xml => mips-o32-linux.xml.in} (100%) rename gdb/syscalls/{ppc-linux.xml => ppc-linux.xml.in} (100%) rename gdb/syscalls/{ppc64-linux.xml => ppc64-linux.xml.in} (100%) rename gdb/syscalls/{s390-linux.xml => s390-linux.xml.in} (100%) rename gdb/syscalls/{s390x-linux.xml => s390x-linux.xml.in} (100%) rename gdb/syscalls/{sparc-linux.xml => sparc-linux.xml.in} (100%) rename gdb/syscalls/{sparc64-linux.xml => sparc64-linux.xml.in} (100%) diff --git a/gdb/configure.ac b/gdb/configure.ac index 6a72f72..9c038ff 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2339,6 +2339,15 @@ if test "${nativefile}" != ""; then fi AC_SUBST(GDB_NM_FILE) +dnl Add dependency for xsltproc if building with maintainer-mode enabled. +AC_PATH_PROGS(XSLTPROC, xsltproc, missing) +if test "x$USE_MAINTAINER_MODE" = xyes; then + if test "${XSLTPROC}" = missing; then + AC_ERROR(unable to find xsltproc. maintainer-mode requires xsltproc.) + fi +fi +AC_SUBST(XSLTPROC) + AC_LINK_FILES($files, $links) dnl Check for exe extension set on certain hosts (e.g. Win32) diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in index c05f379..6d501bf 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in @@ -22,6 +22,7 @@ PYTHON_SRCDIR = $(srcdir)/../python/lib GUILE_SRCDIR = $(srcdir)/../guile/lib SYSTEM_GDBINIT_SRCDIR = $(srcdir)/../system-gdbinit VPATH = $(srcdir):$(SYSCALLS_SRCDIR):$(PYTHON_SRCDIR):$(GUILE_SRCDIR):$(SYSTEM_GDBINIT_SRCDIR) +XSLTPROC = @XSLTPROC@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ @@ -44,14 +45,13 @@ GDB_DATADIR = @GDB_DATADIR@ SYSCALLS_DIR = syscalls SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR) -SYSCALLS_FILES = \ - gdb-syscalls.dtd \ - arm-linux.xml aarch64-linux.xml \ +GEN_SYSCALLS_FILES = arm-linux.xml aarch64-linux.xml \ ppc-linux.xml ppc64-linux.xml \ i386-linux.xml amd64-linux.xml \ sparc-linux.xml sparc64-linux.xml \ mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \ s390-linux.xml s390x-linux.xml +SYSCALLS_FILES = gdb-syscalls.dtd $(GEN_SYSCALLS_FILES) PYTHON_DIR = python PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR) @@ -162,6 +162,21 @@ FLAGS_TO_PASS = \ .PHONY: all all: stamp-syscalls stamp-python stamp-guile stamp-system-gdbinit +%.xml: @MAINTAINER_MODE_TRUE@ %.xml.in apply-defaults.xsl linux-defaults.xml.in + $(XSLTPROC) -o $(SYSCALLS_SRCDIR)/$@ $(SYSCALLS_SRCDIR)/apply-defaults.xsl\ + $(SYSCALLS_SRCDIR)/$@.in + +.PHONY: syscall-xml +syscall-xml: $(GEN_SYSCALLS_FILES) + +.PHONY: clean-syscall-xml +# Only clean files generated XML files. +clean-syscall-xml: + files='$(GEN_SYSCALLS_FILES)' ; \ + for file in $$files; do \ + rm -f "$(SYSCALLS_SRCDIR)/$$file"; \ + done + # For portability's sake, we need to handle systems that don't have # symbolic links. stamp-syscalls: Makefile $(SYSCALLS_FILES) diff --git a/gdb/syscalls/aarch64-linux.xml b/gdb/syscalls/aarch64-linux.xml.in similarity index 100% rename from gdb/syscalls/aarch64-linux.xml rename to gdb/syscalls/aarch64-linux.xml.in diff --git a/gdb/syscalls/amd64-linux.xml b/gdb/syscalls/amd64-linux.xml.in similarity index 100% rename from gdb/syscalls/amd64-linux.xml rename to gdb/syscalls/amd64-linux.xml.in diff --git a/gdb/syscalls/apply-defaults.xsl b/gdb/syscalls/apply-defaults.xsl new file mode 100644 index 0000000..5ab2b67 --- /dev/null +++ b/gdb/syscalls/apply-defaults.xsl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + , + + + + + + diff --git a/gdb/syscalls/arm-linux.xml b/gdb/syscalls/arm-linux.xml.in similarity index 100% rename from gdb/syscalls/arm-linux.xml rename to gdb/syscalls/arm-linux.xml.in diff --git a/gdb/syscalls/bfin-linux.xml b/gdb/syscalls/bfin-linux.xml.in similarity index 100% rename from gdb/syscalls/bfin-linux.xml rename to gdb/syscalls/bfin-linux.xml.in diff --git a/gdb/syscalls/i386-linux.xml b/gdb/syscalls/i386-linux.xml.in similarity index 100% rename from gdb/syscalls/i386-linux.xml rename to gdb/syscalls/i386-linux.xml.in diff --git a/gdb/syscalls/linux-defaults.xml.in b/gdb/syscalls/linux-defaults.xml.in new file mode 100644 index 0000000..1c4e187 --- /dev/null +++ b/gdb/syscalls/linux-defaults.xml.in @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/syscalls/mips-n32-linux.xml b/gdb/syscalls/mips-n32-linux.xml.in similarity index 100% rename from gdb/syscalls/mips-n32-linux.xml rename to gdb/syscalls/mips-n32-linux.xml.in diff --git a/gdb/syscalls/mips-n64-linux.xml b/gdb/syscalls/mips-n64-linux.xml.in similarity index 100% rename from gdb/syscalls/mips-n64-linux.xml rename to gdb/syscalls/mips-n64-linux.xml.in diff --git a/gdb/syscalls/mips-o32-linux.xml b/gdb/syscalls/mips-o32-linux.xml.in similarity index 100% rename from gdb/syscalls/mips-o32-linux.xml rename to gdb/syscalls/mips-o32-linux.xml.in diff --git a/gdb/syscalls/ppc-linux.xml b/gdb/syscalls/ppc-linux.xml.in similarity index 100% rename from gdb/syscalls/ppc-linux.xml rename to gdb/syscalls/ppc-linux.xml.in diff --git a/gdb/syscalls/ppc64-linux.xml b/gdb/syscalls/ppc64-linux.xml.in similarity index 100% rename from gdb/syscalls/ppc64-linux.xml rename to gdb/syscalls/ppc64-linux.xml.in diff --git a/gdb/syscalls/s390-linux.xml b/gdb/syscalls/s390-linux.xml.in similarity index 100% rename from gdb/syscalls/s390-linux.xml rename to gdb/syscalls/s390-linux.xml.in diff --git a/gdb/syscalls/s390x-linux.xml b/gdb/syscalls/s390x-linux.xml.in similarity index 100% rename from gdb/syscalls/s390x-linux.xml rename to gdb/syscalls/s390x-linux.xml.in diff --git a/gdb/syscalls/sparc-linux.xml b/gdb/syscalls/sparc-linux.xml.in similarity index 100% rename from gdb/syscalls/sparc-linux.xml rename to gdb/syscalls/sparc-linux.xml.in diff --git a/gdb/syscalls/sparc64-linux.xml b/gdb/syscalls/sparc64-linux.xml.in similarity index 100% rename from gdb/syscalls/sparc64-linux.xml rename to gdb/syscalls/sparc64-linux.xml.in