xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/syscalls/apply-defaults.xsl (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
1<!-- Generate syscall XML files based on defaults template.
2     Copyright (C) 2016-2020 Free Software Foundation, Inc.
3
4     This file is part of GDB.
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 3 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program.  If not, see <http://www.gnu.org/licenses/>. -->
18
19<xsl:stylesheet version="1.0"
20		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
21  <xsl:output method="xml" doctype-system="gdb-syscalls.dtd"/>
22
23  <xsl:template match="node()|@*" name="identity">
24    <xsl:copy>
25      <xsl:apply-templates select="node()|@*"/>
26    </xsl:copy>
27  </xsl:template>
28
29  <xsl:template match="/syscalls_info/syscall">
30    <xsl:copy>
31      <xsl:apply-templates select="@*|node()"/>
32      <xsl:variable name="syscall"><xsl:value-of select="@name"/></xsl:variable>
33      <xsl:variable name="tgroups"><xsl:value-of select="@groups"/></xsl:variable>
34      <xsl:for-each select="document('linux-defaults.xml.in')/syscalls_defaults/child::*[@name=$syscall]">
35	<xsl:attribute name="groups">
36	  <xsl:value-of select="@groups"/>
37	  <xsl:if test="$tgroups != '' ">,<xsl:value-of select="$tgroups"/></xsl:if>
38	</xsl:attribute>
39      </xsl:for-each>
40    </xsl:copy>
41  </xsl:template>
42
43</xsl:stylesheet>
44