VirtualBox

Changeset 53878 in vbox


Ignore:
Timestamp:
Jan 21, 2015 12:55:21 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97718
Message:

apiwrap-server.xsl: Generate headers and VBoxAPI.d in separate runs from the source files so kmk can start working on other source files while the wrapper C++ source files are being generated (slow).

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r53876 r53878  
    197197        $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
    198198        $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
    199         $(VBoxAPIWrap_VBOX_RAWSRC)
     199        $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
     200        $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources
    200201
    201202# Two VBox variables used here and/or in the rules generating wrappers.
    202 VBoxAPIWrap_VBOX_RAWSRC     = \
    203         $(VBoxAPIWrap_0_OUTDIR)/apiwrappers
    204203VBoxAPIWrap_VBOX_XSLT       = \
    205204        $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server.xsl
     
    11561155
    11571156# Moved those rules to the end so that VBoxAPIWrap_0_OUTDIR can be expanded without $$ trickery.
    1158 $(VBoxAPIWrap_VBOX_RAWSRC) \
    1159 +| $(VBOX_MAIN_APIWRAPPER_GEN_FILES): \
     1157$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
     1158+| $(VBOX_MAIN_APIWRAPPER_GEN_HDRS): \
     1159                $(VBOX_XIDL_FILE) \
     1160               $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
     1161                $(VBoxAPIWrap_VBOX_XSLT) \
     1162                $(VBOX_FILESPLIT) \
     1163                | $$(dir $$@)
     1164        $(call MSG_L1,Generating C++ Server API wrapper header files from XIDL)
     1165        $(QUIET)$(RM) -f $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_FILES),$(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
     1166        $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
     1167                --stringparam generating "headers" \
     1168                --stringparam filelistonly "" \
     1169                -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
     1170        $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
     1171
     1172$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources \
     1173+| $(filter %.cpp,$(VBOX_MAIN_APIWRAPPER_GEN_FILES)): \
    11601174                $(VBOX_XIDL_FILE) \
    11611175               $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
     
    11661180        $(QUIET)$(RM) -f $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_FILES),$(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
    11671181        $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
     1182                --stringparam generating "sources" \
    11681183                --stringparam filelistonly "" \
    11691184                -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
     
    11751190        $(QUIET)$(MKDIR) -p $(@D)
    11761191        $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
    1177                 --stringparam filelistonly VBOX_MAIN_APIWRAPPER_GEN_FILES \
     1192                --stringparam generating "filelist" \
     1193                --stringparam filelistonly "VBOX_MAIN_APIWRAPPER_GEN_FILES" \
    11781194                -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
    11791195        $(QUIET)$(APPEND) -n "$@" "" "" \
     
    11841200$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
    11851201+| $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d: \
    1186                 $(VBOX_MAIN_APIWRAPPER_GEN_FILES) \
    1187                 $(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start.d \
    1188                 $(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end.d
    1189         $(call MSG_L1,Collecting automatically generated dtrace probes)
    1190         $(RM) -f -- $@
    1191         $(CP) -f -- $(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start.d $@
    1192         $(SED) -ne 's/^ *\/\* dtrace \(probe .*;\) \*\//    \1/p' --append $@ \
    1193                 -- $(filter %.cpp, $(VBOX_MAIN_APIWRAPPER_GEN_FILES))
    1194         $(SED) -e "" --append $@ $(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end.d
    1195         $(QUIET)$(CP) --changed -fv -- $@ $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d
    1196 
     1202                $(VBOX_XIDL_FILE) \
     1203               $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
     1204                $(VBoxAPIWrap_VBOX_XSLT) \
     1205                $(VBOX_FILESPLIT) \
     1206                | $$(dir $$@)
     1207        $(call MSG_L1,Generating DTrace Provider for the VBox API (from XIDL))
     1208        $(QUIET)$(RM) -f -- "$@" "[email protected]"
     1209        $(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
     1210                --stringparam generating "dtrace-probes" \
     1211                --stringparam filelistonly "" \
     1212                -o "$@" $(VBoxAPIWrap_VBOX_XSLT) $<
     1213        $(QUIET)$(SED) -e '' -o [email protected] \
     1214                "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start.d" \
     1215                "[email protected]" \
     1216                "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end.d"
     1217        $(QUIET)$(MV) -- "[email protected]" "$@"
     1218        $(QUIET)$(CP) --changed -fv -- "$@" "$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d"
    11971219
    11981220
  • trunk/src/VBox/Main/idl/apiwrap-server.xsl

    r53875 r53878  
    509509    </xsl:variable>
    510510
    511     <xsl:call-template name="emitHeader">
    512         <xsl:with-param name="iface" select="$iface"/>
    513         <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
    514     </xsl:call-template>
    515 
    516     <xsl:call-template name="emitCode">
    517         <xsl:with-param name="iface" select="$iface"/>
    518         <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
    519     </xsl:call-template>
     511    <xsl:if test="$generating = 'headers' or $generating = 'filelist'">
     512        <xsl:call-template name="emitHeader">
     513            <xsl:with-param name="iface" select="$iface"/>
     514            <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
     515        </xsl:call-template>
     516    </xsl:if>
     517
     518    <xsl:if test="$generating = 'sources' or $generating = 'filelist'">
     519        <xsl:call-template name="emitCode">
     520            <xsl:with-param name="iface" select="$iface"/>
     521            <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
     522        </xsl:call-template>
     523    </xsl:if>
     524
     525    <xsl:if test="$generating = 'dtrace-probes'">
     526        <xsl:call-template name="emitDTraceProbes">
     527            <xsl:with-param name="iface" select="$iface"/>
     528            <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
     529        </xsl:call-template>
     530    </xsl:if>
     531
    520532</xsl:template>
    521533
     
    11701182        <xsl:text>
    11711183#ifdef VBOX_WITH_DTRACE_R3_MAIN
    1172         /* dtrace probe </xsl:text>
    1173         <!-- <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__enter(struct ', $topclass)"/> -->
    1174         <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__enter(void')"/>
    1175         <xsl:text> *a_pThis); */
    11761184        </xsl:text>
    11771185        <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_ENTER('), $G_lowerCase, $G_upperCase)"/>
     
    12131221        <xsl:text>
    12141222#ifdef VBOX_WITH_DTRACE_R3_MAIN
    1215         /* dtrace probe </xsl:text>
    1216         <!-- <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__return(struct ', $topclass, ' *a_pThis')"/> -->
    1217         <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__return(void *a_pThis')"/>
    1218         <xsl:text>, uint32_t a_hrc, int32_t enmWhy, </xsl:text>
    1219         <xsl:apply-templates select="@type" mode="dtraceparamdecl">
    1220             <xsl:with-param name="dir">out</xsl:with-param>
    1221         </xsl:apply-templates>
    1222         <xsl:text>); */
    1223             </xsl:text>
     1223        </xsl:text>
    12241224        <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
    12251225        <xsl:text>this, hrc, 0 /*normal*/,</xsl:text>
     
    13211321
    13221322#ifdef VBOX_WITH_DTRACE_R3_MAIN
    1323         /* dtrace probe </xsl:text>
    1324         <!-- <xsl:value-of select="concat($topclass, '__set__', $dtraceattrname, '__enter(struct ', $topclass, ' *a_pThis, ')"/>-->
    1325         <xsl:value-of select="concat($topclass, '__set__', $dtraceattrname, '__enter(void *a_pThis, ')"/>
    1326         <xsl:apply-templates select="@type" mode="dtraceparamdecl">
    1327             <xsl:with-param name="dir" select="'in'"/>
    1328         </xsl:apply-templates>
    1329         <xsl:text>); */
    13301323        </xsl:text>
    13311324        <xsl:value-of select="translate(concat('VBOXAPI_', $topclass, '_SET_', $dtraceattrname, '_ENTER('), $G_lowerCase, $G_upperCase)"/>
     
    13611354
    13621355#ifdef VBOX_WITH_DTRACE_R3_MAIN
    1363         /* dtrace probe </xsl:text>
    1364         <!-- <xsl:value-of select="concat($dtracetopclass, '__set__', $dtraceattrname, '__return(struct ', $topclass, ' *a_pThis')"/> -->
    1365         <xsl:value-of select="concat($dtracetopclass, '__set__', $dtraceattrname, '__return(void *a_pThis')"/>
    1366         <xsl:text>, uint32_t a_hrc, int32_t enmWhy, </xsl:text>
    1367         <xsl:apply-templates select="@type" mode="dtraceparamdecl">
    1368             <xsl:with-param name="dir">in</xsl:with-param>
    1369         </xsl:apply-templates>
    1370         <xsl:text>); */
    1371             </xsl:text>
     1356        </xsl:text>
    13721357        <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_SET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
    13731358        <xsl:text>this, hrc, 0 /*normal*/,</xsl:text>
     
    14221407
    14231408<!-- - - - - - - - - - - - - - - - - - - - - - -
     1409   Emit DTrace probes for the given attribute.
     1410  - - - - - - - - - - - - - - - - - - - - - - -->
     1411<xsl:template match="attribute" mode="dtrace-probes">
     1412    <xsl:param name="topclass"/>
     1413    <xsl:param name="dtracetopclass"/>
     1414    <xsl:param name="target"/>
     1415
     1416    <xsl:variable name="dtraceattrname">
     1417        <xsl:choose>
     1418            <xsl:when test="@dtracename">
     1419                <xsl:value-of select="@dtracename"/>
     1420            </xsl:when>
     1421            <xsl:otherwise>
     1422                <!-- attrbasename -->
     1423                <xsl:call-template name="capitalize">
     1424                    <xsl:with-param name="str" select="@name"/>
     1425                </xsl:call-template>
     1426            </xsl:otherwise>
     1427        </xsl:choose>
     1428    </xsl:variable>
     1429
     1430    <xsl:if test="@name != 'midlDoesNotLikEmptyInterfaces'">
     1431        <xsl:text>    probe </xsl:text>
     1432        <!-- <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__enter(struct ', $topclass)"/> -->
     1433        <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__enter(void')"/>
     1434        <xsl:text> *a_pThis);
     1435    probe </xsl:text>
     1436        <!-- <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__return(struct ', $topclass, ' *a_pThis')"/> -->
     1437        <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__return(void *a_pThis')"/>
     1438        <xsl:text>, uint32_t a_hrc, int32_t enmWhy, </xsl:text>
     1439        <xsl:apply-templates select="@type" mode="dtraceparamdecl">
     1440            <xsl:with-param name="dir">out</xsl:with-param>
     1441        </xsl:apply-templates>
     1442        <xsl:text>);
     1443</xsl:text>
     1444    </xsl:if>
     1445    <xsl:if test="(not(@readonly) or @readonly!='yes') and @name != 'midlDoesNotLikEmptyInterfaces'">
     1446        <xsl:text>    probe </xsl:text>
     1447        <!-- <xsl:value-of select="concat($topclass, '__set__', $dtraceattrname, '__enter(struct ', $topclass, ' *a_pThis, ')"/>-->
     1448        <xsl:value-of select="concat($topclass, '__set__', $dtraceattrname, '__enter(void *a_pThis, ')"/>
     1449        <xsl:apply-templates select="@type" mode="dtraceparamdecl">
     1450            <xsl:with-param name="dir" select="'in'"/>
     1451        </xsl:apply-templates>
     1452        <xsl:text>);
     1453    probe </xsl:text>
     1454        <!-- <xsl:value-of select="concat($dtracetopclass, '__set__', $dtraceattrname, '__return(struct ', $topclass, ' *a_pThis')"/> -->
     1455        <xsl:value-of select="concat($dtracetopclass, '__set__', $dtraceattrname, '__return(void *a_pThis')"/>
     1456        <xsl:text>, uint32_t a_hrc, int32_t enmWhy, </xsl:text>
     1457        <xsl:apply-templates select="@type" mode="dtraceparamdecl">
     1458            <xsl:with-param name="dir">in</xsl:with-param>
     1459        </xsl:apply-templates>
     1460        <xsl:text>);
     1461</xsl:text>
     1462    </xsl:if>
     1463</xsl:template>
     1464
     1465<!-- - - - - - - - - - - - - - - - - - - - - - -
    14241466  emit all attributes of an interface
    14251467  - - - - - - - - - - - - - - - - - - - - - - -->
     
    14511493</xsl:text>
    14521494        </xsl:when>
     1495        <xsl:when test="$pmode = 'dtrace-probes'">
     1496        </xsl:when>
    14531497        <xsl:otherwise>
    14541498            <xsl:value-of select="concat($G_sNewLine, '    // ', $pmode, ' ', $iface/@name, ' properties', $G_sNewLine)"/>
     
    14681512        <xsl:when test="$pmode='code'">
    14691513            <xsl:apply-templates select="$iface/attribute | $iface/if" mode="code">
     1514                <xsl:with-param name="topclass" select="$topclass"/>
     1515                <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
     1516                <xsl:with-param name="emitmode" select="'attribute'"/>
     1517            </xsl:apply-templates>
     1518        </xsl:when>
     1519        <xsl:when test="$pmode = 'dtrace-probes'">
     1520            <xsl:apply-templates select="$iface/attribute | $iface/if" mode="dtrace-probes">
    14701521                <xsl:with-param name="topclass" select="$topclass"/>
    14711522                <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
     
    16391690            </xsl:otherwise>
    16401691        </xsl:choose>
     1692    </xsl:variable>
     1693    <xsl:variable name="dtracenamehack"> <!-- Ugly hack to deal with Session::assignMachine and similar. -->
     1694        <xsl:if test="name(..) = 'if'">
     1695            <xsl:value-of select="concat('__', ../@target)"/>
     1696        </xsl:if>
    16411697    </xsl:variable>
    16421698
     
    17021758    <xsl:text>
    17031759#ifdef VBOX_WITH_DTRACE_R3_MAIN
    1704         /* dtrace probe </xsl:text>
    1705     <xsl:variable name="dtracenamehack"> <!-- Ugly hack to deal with Session::assignMachine and similar. -->
    1706         <xsl:if test="name(..) = 'if'">
    1707             <xsl:value-of select="concat('__', ../@target)"/>
    1708         </xsl:if>
    1709     </xsl:variable>
    1710     <!-- <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__enter(struct ', $dtracetopclass, ' *a_pThis')"/> -->
    1711     <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__enter(void *a_pThis')"/>
    1712     <xsl:for-each select="param[@dir='in']">
    1713         <xsl:text>, </xsl:text>
    1714         <xsl:apply-templates select="@type" mode="dtraceparamdecl">
    1715             <xsl:with-param name="dir" select="'@dir'"/>
    1716         </xsl:apply-templates>
    1717     </xsl:for-each>
    1718     <xsl:text>); */
    17191760        </xsl:text>
    17201761    <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_ENTER('), $G_lowerCase, $G_upperCase)"/>
     
    17711812
    17721813#ifdef VBOX_WITH_DTRACE_R3_MAIN
    1773         /* dtrace probe </xsl:text>
    1774     <!-- <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, '__return(struct ', $dtracetopclass, ' *a_pThis')"/> -->
    1775     <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__return(void *a_pThis')"/>
    1776     <xsl:text>, uint32_t a_hrc, int32_t enmWhy</xsl:text>
    1777     <xsl:for-each select="param">
    1778         <xsl:text>, </xsl:text>
    1779         <xsl:apply-templates select="@type" mode="dtraceparamdecl">
    1780             <xsl:with-param name="dir" select="'@dir'"/>
    1781         </xsl:apply-templates>
    1782     </xsl:for-each>
    1783     <xsl:text>); */
    17841814        </xsl:text>
    17851815    <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_RETURN('), $G_lowerCase, $G_upperCase)"/>
     
    18611891</xsl:template>
    18621892
     1893<!--  - - - - - - - - - - - - - - - - - - - - - -
     1894  Emits the DTrace probes for a method.
     1895  - - - - - - - - - - - - - - - - - - - - - - -->
     1896<xsl:template match="method" mode="dtrace-probes">
     1897    <xsl:param name="topclass"/>
     1898    <xsl:param name="dtracetopclass"/>
     1899    <xsl:param name="target"/>
     1900
     1901    <xsl:variable name="dtracemethodname">
     1902        <xsl:choose>
     1903            <xsl:when test="@dtracename">
     1904                <xsl:value-of select="@dtracename"/>
     1905            </xsl:when>
     1906            <xsl:otherwise>
     1907                <xsl:value-of select="@name"/>
     1908            </xsl:otherwise>
     1909        </xsl:choose>
     1910    </xsl:variable>
     1911    <xsl:variable name="dtracenamehack"> <!-- Ugly hack to deal with Session::assignMachine and similar. -->
     1912        <xsl:if test="name(..) = 'if'">
     1913            <xsl:value-of select="concat('__', ../@target)"/>
     1914        </xsl:if>
     1915    </xsl:variable>
     1916
     1917    <xsl:text>    probe </xsl:text>
     1918    <!-- <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__enter(struct ', $dtracetopclass, ' *a_pThis')"/> -->
     1919    <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__enter(void *a_pThis')"/>
     1920    <xsl:for-each select="param[@dir='in']">
     1921        <xsl:text>, </xsl:text>
     1922        <xsl:apply-templates select="@type" mode="dtraceparamdecl">
     1923            <xsl:with-param name="dir" select="'@dir'"/>
     1924        </xsl:apply-templates>
     1925    </xsl:for-each>
     1926    <xsl:text>);
     1927    probe </xsl:text>
     1928    <!-- <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, '__return(struct ', $dtracetopclass, ' *a_pThis')"/> -->
     1929    <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__return(void *a_pThis')"/>
     1930    <xsl:text>, uint32_t a_hrc, int32_t enmWhy</xsl:text>
     1931    <xsl:for-each select="param">
     1932        <xsl:text>, </xsl:text>
     1933        <xsl:apply-templates select="@type" mode="dtraceparamdecl">
     1934            <xsl:with-param name="dir" select="'@dir'"/>
     1935        </xsl:apply-templates>
     1936    </xsl:for-each>
     1937    <xsl:text>);
     1938</xsl:text>
     1939
     1940</xsl:template>
     1941
     1942
    18631943<xsl:template name="emitIf">
    18641944    <xsl:param name="passmode"/>
     
    18701950    <xsl:if test="($target = 'xpidl') or ($target = 'midl')">
    18711951        <xsl:choose>
    1872             <xsl:when test="$filelistonly=''">
     1952            <xsl:when test="$generating != 'filelist'">
    18731953                <xsl:choose>
    18741954                    <xsl:when test="$passmode='public'">
     
    19212001                        </xsl:choose>
    19222002                    </xsl:when>
     2003                    <xsl:when test="$passmode = 'dtrace-probes'">
     2004                        <xsl:choose>
     2005                            <xsl:when test="$emitmode = 'method'">
     2006                                <xsl:apply-templates select="method" mode="dtrace-probes">
     2007                                    <xsl:with-param name="target" select="$target"/>
     2008                                    <xsl:with-param name="topclass" select="$topclass"/>
     2009                                    <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
     2010                                </xsl:apply-templates>
     2011                            </xsl:when>
     2012                            <xsl:when test="$emitmode = 'attribute'">
     2013                                <xsl:apply-templates select="attribute" mode="dtrace-probes">
     2014                                    <xsl:with-param name="target" select="$target"/>
     2015                                    <xsl:with-param name="topclass" select="$topclass"/>
     2016                                    <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
     2017                                </xsl:apply-templates>
     2018                            </xsl:when>
     2019                            <xsl:otherwise/>
     2020                        </xsl:choose>
     2021                    </xsl:when>
    19232022                    <xsl:otherwise/>
    19242023                </xsl:choose>
     
    19582057    <xsl:call-template name="emitIf">
    19592058        <xsl:with-param name="passmode" select="'code'"/>
     2059        <xsl:with-param name="target" select="@target"/>
     2060        <xsl:with-param name="emitmode" select="$emitmode"/>
     2061        <xsl:with-param name="topclass" select="$topclass"/>
     2062        <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
     2063    </xsl:call-template>
     2064</xsl:template>
     2065
     2066<xsl:template match="if" mode="dtrace-probes">
     2067    <xsl:param name="topclass"/>
     2068    <xsl:param name="emitmode"/>
     2069    <xsl:param name="dtracetopclass"/>
     2070
     2071    <xsl:call-template name="emitIf">
     2072        <xsl:with-param name="passmode" select="'dtrace-probes'"/>
    19602073        <xsl:with-param name="target" select="@target"/>
    19612074        <xsl:with-param name="emitmode" select="$emitmode"/>
     
    19952108</xsl:text>
    19962109        </xsl:when>
     2110        <xsl:when test="$pmode='dtrace-probes'"/>
    19972111        <xsl:otherwise>
    19982112            <xsl:value-of select="concat($G_sNewLine, '    // ', $pmode, ' ', $iface/@name, ' methods', $G_sNewLine)"/>
     
    20172131            </xsl:apply-templates>
    20182132        </xsl:when>
     2133        <xsl:when test="$pmode='dtrace-probes'">
     2134            <xsl:apply-templates select="$iface/method | $iface/if" mode="dtrace-probes">
     2135                <xsl:with-param name="topclass" select="$topclass"/>
     2136                <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
     2137                <xsl:with-param name="emitmode" select="'method'"/>
     2138            </xsl:apply-templates>
     2139        </xsl:when>
    20192140        <xsl:otherwise/>
    20202141    </xsl:choose>
     
    20592180
    20602181    <xsl:choose>
    2061         <xsl:when test="$filelistonly=''">
     2182        <xsl:when test="$generating = 'headers'">
    20622183            <xsl:apply-templates select="$iface" mode="startfile">
    20632184                <xsl:with-param name="file" select="$filename"/>
     
    21262247            </xsl:apply-templates>
    21272248        </xsl:when>
    2128         <xsl:otherwise>
     2249
     2250        <xsl:when test="$generating = 'filelist'">
    21292251            <xsl:apply-templates select="$iface" mode="listfile">
    21302252                <xsl:with-param name="file" select="$filename"/>
    21312253            </xsl:apply-templates>
     2254        </xsl:when>
     2255
     2256        <xsl:otherwise>
     2257            <xsl:message terminate="yes">
     2258                Did not expect generating='<xsl:value-of select="$generating"/>' in the emitHeader template.
     2259            </xsl:message>
    21322260        </xsl:otherwise>
    21332261    </xsl:choose>
     
    21352263
    21362264<!-- - - - - - - - - - - - - - - - - - - - - - -
    2137   emit all attributes and methods definitions of an interface
     2265  emit all attributes and methods definitions (pmode=code) or probes (pmode=dtrace-probes) of an interface
    21382266  - - - - - - - - - - - - - - - - - - - - - - -->
    21392267<xsl:template name="emitInterfaceDefs">
    21402268    <xsl:param name="iface"/>
    21412269    <xsl:param name="addinterfaces"/>
    2142 
    2143     <xsl:value-of select="concat('DEFINE_EMPTY_CTOR_DTOR(', substring($iface/@name, 2), 'Wrap)', $G_sNewLine, $G_sNewLine)"/>
     2270    <xsl:param name="pmode" select="'code'"/>
     2271
     2272    <xsl:if test="$pmode = 'code'">
     2273        <xsl:value-of select="concat('DEFINE_EMPTY_CTOR_DTOR(', substring($iface/@name, 2), 'Wrap)', $G_sNewLine, $G_sNewLine)"/>
     2274    </xsl:if>
    21442275
    21452276    <xsl:variable name="dtracetopclass">
     
    21552286        <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/>
    21562287        <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
    2157         <xsl:with-param name="pmode" select="'code'"/>
     2288        <xsl:with-param name="pmode" select="$pmode"/>
    21582289    </xsl:call-template>
    21592290
     
    21702301            <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/>
    21712302            <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
    2172             <xsl:with-param name="pmode" select="'code'"/>
     2303            <xsl:with-param name="pmode" select="$pmode"/>
    21732304        </xsl:call-template>
    21742305    </xsl:for-each>
     
    21792310        <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/>
    21802311        <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
    2181         <xsl:with-param name="pmode" select="'code'"/>
     2312        <xsl:with-param name="pmode" select="$pmode"/>
    21822313    </xsl:call-template>
    21832314
     
    21942325            <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/>
    21952326            <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
    2196             <xsl:with-param name="pmode" select="'code'"/>
     2327            <xsl:with-param name="pmode" select="$pmode"/>
    21972328        </xsl:call-template>
    21982329    </xsl:for-each>
     
    22042335<xsl:template name="emitAuxMethodDefs">
    22052336    <xsl:param name="iface"/>
     2337    <xsl:param name="pmode" select="'code'"/>
    22062338    <!-- currently nothing, maybe later some generic FinalConstruct/... implementation -->
    22072339</xsl:template>
     
    22182350
    22192351    <xsl:choose>
    2220         <xsl:when test="$filelistonly=''">
     2352        <xsl:when test="$generating = 'sources'">
    22212353            <xsl:apply-templates select="$iface" mode="startfile">
    22222354                <xsl:with-param name="file" select="$filename"/>
     
    22492381            </xsl:apply-templates>
    22502382        </xsl:when>
    2251         <xsl:otherwise>
     2383        <xsl:when test="$generating = 'filelist'">
    22522384            <xsl:apply-templates select="$iface" mode="listfile">
    22532385                <xsl:with-param name="file" select="$filename"/>
    22542386            </xsl:apply-templates>
     2387        </xsl:when>
     2388        <xsl:otherwise>
     2389            <xsl:message terminate="yes">
     2390                Did not expect generating='<xsl:value-of select="$generating"/>' in the emitCode template.
     2391            </xsl:message>
    22552392        </xsl:otherwise>
    22562393    </xsl:choose>
     2394</xsl:template>
     2395
     2396<!-- - - - - - - - - - - - - - - - - - - - - - -
     2397  emit the DTrace probes for an interface
     2398  - - - - - - - - - - - - - - - - - - - - - - -->
     2399<xsl:template name="emitDTraceProbes">
     2400    <xsl:param name="iface"/>
     2401    <xsl:param name="addinterfaces"/>
     2402
     2403    <xsl:if test="$generating != 'dtrace-probes'">
     2404        <xsl:message terminate="yes">
     2405            Did not expect generating='<xsl:value-of select="$generating"/>' in the emitDTraceProbes template.
     2406        </xsl:message>
     2407    </xsl:if>
     2408
     2409    <!-- interface attributes/methods (public) -->
     2410    <xsl:call-template name="emitInterfaceDefs">
     2411        <xsl:with-param name="iface" select="$iface"/>
     2412        <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
     2413        <xsl:with-param name="pmode">dtrace-probes</xsl:with-param>
     2414    </xsl:call-template>
     2415
     2416    <!-- auxiliary methods (public) -->
     2417    <xsl:call-template name="emitAuxMethodDefs">
     2418        <xsl:with-param name="iface" select="$iface"/>
     2419        <xsl:with-param name="pmode">dtrace-probes</xsl:with-param>
     2420    </xsl:call-template>
     2421
    22572422</xsl:template>
    22582423
     
    23002465<xsl:template match="/idl">
    23012466    <xsl:choose>
    2302         <xsl:when test="$filelistonly=''">
     2467        <xsl:when test="$generating = 'filelist'">
     2468            <xsl:value-of select="concat($filelistonly, ' := \', $G_sNewLine)"/>
     2469            <xsl:apply-templates/>
     2470        </xsl:when>
     2471        <xsl:when test="$generating = 'headers'">
     2472            <xsl:apply-templates/>
     2473        </xsl:when>
     2474        <xsl:when test="$generating = 'sources'">
     2475            <xsl:apply-templates/>
     2476        </xsl:when>
     2477        <xsl:when test="$generating = 'dtrace-probes'">
     2478            <xsl:apply-templates/>
    23032479        </xsl:when>
    23042480        <xsl:otherwise>
    2305             <xsl:value-of select="concat($filelistonly, ' := \', $G_sNewLine)"/>
    2306         </xsl:otherwise>
    2307     </xsl:choose>
    2308     <xsl:apply-templates/>
    2309     <xsl:choose>
    2310         <xsl:when test="$filelistonly=''">
    2311         </xsl:when>
    2312         <xsl:otherwise>
    2313             <xsl:text>
    2314 </xsl:text>
     2481            <xsl:message terminate="yes">
     2482                Unknown string parameter value: generating='<xsl:value-of select="$generating"/>'
     2483            </xsl:message>
    23152484        </xsl:otherwise>
    23162485    </xsl:choose>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette