Changeset 53878 in vbox
- Timestamp:
- Jan 21, 2015 12:55:21 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97718
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r53876 r53878 197 197 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \ 198 198 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \ 199 $(VBoxAPIWrap_VBOX_RAWSRC) 199 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \ 200 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources 200 201 201 202 # Two VBox variables used here and/or in the rules generating wrappers. 202 VBoxAPIWrap_VBOX_RAWSRC = \203 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers204 203 VBoxAPIWrap_VBOX_XSLT = \ 205 204 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server.xsl … … 1156 1155 1157 1156 # 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)): \ 1160 1174 $(VBOX_XIDL_FILE) \ 1161 1175 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \ … … 1166 1180 $(QUIET)$(RM) -f $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_FILES),$(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h)) 1167 1181 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \ 1182 --stringparam generating "sources" \ 1168 1183 --stringparam filelistonly "" \ 1169 1184 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $< … … 1175 1190 $(QUIET)$(MKDIR) -p $(@D) 1176 1191 $(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" \ 1178 1194 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $< 1179 1195 $(QUIET)$(APPEND) -n "$@" "" "" \ … … 1184 1200 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \ 1185 1201 +| $(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" 1197 1219 1198 1220 -
trunk/src/VBox/Main/idl/apiwrap-server.xsl
r53875 r53878 509 509 </xsl:variable> 510 510 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 520 532 </xsl:template> 521 533 … … 1170 1182 <xsl:text> 1171 1183 #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); */1176 1184 </xsl:text> 1177 1185 <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_ENTER('), $G_lowerCase, $G_upperCase)"/> … … 1213 1221 <xsl:text> 1214 1222 #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> 1224 1224 <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/> 1225 1225 <xsl:text>this, hrc, 0 /*normal*/,</xsl:text> … … 1321 1321 1322 1322 #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>); */1330 1323 </xsl:text> 1331 1324 <xsl:value-of select="translate(concat('VBOXAPI_', $topclass, '_SET_', $dtraceattrname, '_ENTER('), $G_lowerCase, $G_upperCase)"/> … … 1361 1354 1362 1355 #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> 1372 1357 <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_SET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/> 1373 1358 <xsl:text>this, hrc, 0 /*normal*/,</xsl:text> … … 1422 1407 1423 1408 <!-- - - - - - - - - - - - - - - - - - - - - - - 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 <!-- - - - - - - - - - - - - - - - - - - - - - - 1424 1466 emit all attributes of an interface 1425 1467 - - - - - - - - - - - - - - - - - - - - - - --> … … 1451 1493 </xsl:text> 1452 1494 </xsl:when> 1495 <xsl:when test="$pmode = 'dtrace-probes'"> 1496 </xsl:when> 1453 1497 <xsl:otherwise> 1454 1498 <xsl:value-of select="concat($G_sNewLine, ' // ', $pmode, ' ', $iface/@name, ' properties', $G_sNewLine)"/> … … 1468 1512 <xsl:when test="$pmode='code'"> 1469 1513 <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"> 1470 1521 <xsl:with-param name="topclass" select="$topclass"/> 1471 1522 <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/> … … 1639 1690 </xsl:otherwise> 1640 1691 </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> 1641 1697 </xsl:variable> 1642 1698 … … 1702 1758 <xsl:text> 1703 1759 #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>); */1719 1760 </xsl:text> 1720 1761 <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_ENTER('), $G_lowerCase, $G_upperCase)"/> … … 1771 1812 1772 1813 #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>); */1784 1814 </xsl:text> 1785 1815 <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_RETURN('), $G_lowerCase, $G_upperCase)"/> … … 1861 1891 </xsl:template> 1862 1892 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 1863 1943 <xsl:template name="emitIf"> 1864 1944 <xsl:param name="passmode"/> … … 1870 1950 <xsl:if test="($target = 'xpidl') or ($target = 'midl')"> 1871 1951 <xsl:choose> 1872 <xsl:when test="$ filelistonly=''">1952 <xsl:when test="$generating != 'filelist'"> 1873 1953 <xsl:choose> 1874 1954 <xsl:when test="$passmode='public'"> … … 1921 2001 </xsl:choose> 1922 2002 </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> 1923 2022 <xsl:otherwise/> 1924 2023 </xsl:choose> … … 1958 2057 <xsl:call-template name="emitIf"> 1959 2058 <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'"/> 1960 2073 <xsl:with-param name="target" select="@target"/> 1961 2074 <xsl:with-param name="emitmode" select="$emitmode"/> … … 1995 2108 </xsl:text> 1996 2109 </xsl:when> 2110 <xsl:when test="$pmode='dtrace-probes'"/> 1997 2111 <xsl:otherwise> 1998 2112 <xsl:value-of select="concat($G_sNewLine, ' // ', $pmode, ' ', $iface/@name, ' methods', $G_sNewLine)"/> … … 2017 2131 </xsl:apply-templates> 2018 2132 </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> 2019 2140 <xsl:otherwise/> 2020 2141 </xsl:choose> … … 2059 2180 2060 2181 <xsl:choose> 2061 <xsl:when test="$ filelistonly=''">2182 <xsl:when test="$generating = 'headers'"> 2062 2183 <xsl:apply-templates select="$iface" mode="startfile"> 2063 2184 <xsl:with-param name="file" select="$filename"/> … … 2126 2247 </xsl:apply-templates> 2127 2248 </xsl:when> 2128 <xsl:otherwise> 2249 2250 <xsl:when test="$generating = 'filelist'"> 2129 2251 <xsl:apply-templates select="$iface" mode="listfile"> 2130 2252 <xsl:with-param name="file" select="$filename"/> 2131 2253 </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> 2132 2260 </xsl:otherwise> 2133 2261 </xsl:choose> … … 2135 2263 2136 2264 <!-- - - - - - - - - - - - - - - - - - - - - - - 2137 emit all attributes and methods definitions of an interface2265 emit all attributes and methods definitions (pmode=code) or probes (pmode=dtrace-probes) of an interface 2138 2266 - - - - - - - - - - - - - - - - - - - - - - --> 2139 2267 <xsl:template name="emitInterfaceDefs"> 2140 2268 <xsl:param name="iface"/> 2141 2269 <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> 2144 2275 2145 2276 <xsl:variable name="dtracetopclass"> … … 2155 2286 <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/> 2156 2287 <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/> 2157 <xsl:with-param name="pmode" select=" 'code'"/>2288 <xsl:with-param name="pmode" select="$pmode"/> 2158 2289 </xsl:call-template> 2159 2290 … … 2170 2301 <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/> 2171 2302 <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/> 2172 <xsl:with-param name="pmode" select=" 'code'"/>2303 <xsl:with-param name="pmode" select="$pmode"/> 2173 2304 </xsl:call-template> 2174 2305 </xsl:for-each> … … 2179 2310 <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/> 2180 2311 <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/> 2181 <xsl:with-param name="pmode" select=" 'code'"/>2312 <xsl:with-param name="pmode" select="$pmode"/> 2182 2313 </xsl:call-template> 2183 2314 … … 2194 2325 <xsl:with-param name="topclass" select="substring($iface/@name, 2)"/> 2195 2326 <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/> 2196 <xsl:with-param name="pmode" select=" 'code'"/>2327 <xsl:with-param name="pmode" select="$pmode"/> 2197 2328 </xsl:call-template> 2198 2329 </xsl:for-each> … … 2204 2335 <xsl:template name="emitAuxMethodDefs"> 2205 2336 <xsl:param name="iface"/> 2337 <xsl:param name="pmode" select="'code'"/> 2206 2338 <!-- currently nothing, maybe later some generic FinalConstruct/... implementation --> 2207 2339 </xsl:template> … … 2218 2350 2219 2351 <xsl:choose> 2220 <xsl:when test="$ filelistonly=''">2352 <xsl:when test="$generating = 'sources'"> 2221 2353 <xsl:apply-templates select="$iface" mode="startfile"> 2222 2354 <xsl:with-param name="file" select="$filename"/> … … 2249 2381 </xsl:apply-templates> 2250 2382 </xsl:when> 2251 <xsl: otherwise>2383 <xsl:when test="$generating = 'filelist'"> 2252 2384 <xsl:apply-templates select="$iface" mode="listfile"> 2253 2385 <xsl:with-param name="file" select="$filename"/> 2254 2386 </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> 2255 2392 </xsl:otherwise> 2256 2393 </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 2257 2422 </xsl:template> 2258 2423 … … 2300 2465 <xsl:template match="/idl"> 2301 2466 <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/> 2303 2479 </xsl:when> 2304 2480 <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> 2315 2484 </xsl:otherwise> 2316 2485 </xsl:choose>
Note:
See TracChangeset
for help on using the changeset viewer.