|
From: Cees <ce...@pc...> - 2006-01-25 10:50:36
|
Hi,
I am trying to write suppression rules for leaks that originate from some
function say RootOfAllEvil.
Below that function there are many leaks but not all at the same stack depth.
AFAIK, I could suppress all _Znwj (C++ new) at depth 1 by doing:
{
<insert a suppression name here>
Memcheck:Leak
fun:_Znwj
fun:*
fun:RootOfAllEvil
}
and add more for depth 2,3, etc.
But is there any way of definining something like?:
{
<insert a suppression name here>
Memcheck:Leak
fun:_Znwj
?? 1 or more of any functions
fun:RootOfAllEvil
}
It sounds so naturraly to me that this is possible, but I am unable to find
information on if this is possible, or that I can achieve the same in another
fashion.
Tanks in advance,
Cees
|
|
From: Nicholas N. <nj...@cs...> - 2006-01-25 11:07:52
|
On Wed, 25 Jan 2006, Cees wrote:
> But is there any way of definining something like?:
>
> {
> <insert a suppression name here>
> Memcheck:Leak
> fun:_Znwj
> ?? 1 or more of any functions
> fun:RootOfAllEvil
> }
Currently no, sorry.
Nick
|
|
From: Cees W. <ce...@pc...> - 2006-01-25 13:38:28
|
>> But is there any way of definining something like?:
>>
>> {
>> <insert a suppression name here>
>> Memcheck:Leak
>> fun:_Znwj
>> ?? 1 or more of any functions
>> fun:RootOfAllEvil
>> }
>
>
> Currently no, sorry.
Thanks Nick, that save for looking any further.
As a workaround I discovered the XML output of valgrind.
That let me do funky filter things like:
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:strip-space elements="*" />
<xsl:output method="xml" indent="yes"/>
<!-- match any occurence of RootOfAllEvil -->
<xsl:template match="error[.//fn='RootOfAllEvil']">
<!-- and filter out this kind for RootOfAllEvil -->
<xsl:choose>
<xsl:when test=".//kind[1]='Leak_StillReachable'"/>
<xsl:when test=".//kind[1]='Leak_IndirectlyLost'"/>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="error">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates select="error"/>
</xsl:template>
</xsl:transform>
--
Cees Wesseling
PCRaster Environmental Software
|