On Saturday 25 September 2010, Mike Coleman wrote:
> > With C++, the full signature is part of the function name.
> > It is easier to use wildcards, e.g. "--dump-after=foo*" to trigger
> > a dump whenever a function starting with "foo" is left.
>
> Hadn't seen the wildcard thing documented anywhere.
Ooops.
This should get a top priority on my TODO list. Thanks for pointing out.
It works like shell globbing, with wildcards "*" (0 or more unknown chars)
and "?" (exactly one unknown char).
> That should make
> life simpler, though I still couldn't get it to fire. If I just say
> "--dump-after=*f*" (quoted from the shell, of course), would you
> expect that to fire?
Yes. Quoting should not even be needed, as you probably do not have a
file starting with "--dump-after=".
E.g. running
valgrind --tool=callgrind --dump-after=*f* ls
gives me tons of dumps here (I had to kill it).
Every dump contains the dump reason ("trigger"). After above example,
if I do
grep Trigger callgrind.out.*
I get
callgrind.out.15169.1:desc: Trigger: --dump-after=open_verify
callgrind.out.15169.10:desc: Trigger: --dump-after=_dl_map_object_from_fd
callgrind.out.15169.100:desc: Trigger: --dump-after=_IO_file_doallocate
callgrind.out.15169.1000:desc: Trigger: --dump-after=_dl_sysinfo_int80
callgrind.out.15169.10000:desc: Trigger: --dump-after=0x08051bcf
callgrind.out.15169.10001:desc: Trigger: --dump-after=0x08051bcf
callgrind.out.15169.10002:desc: Trigger: --dump-after=0x08051bcf
callgrind.out.15169.10003:desc: Trigger: --dump-after=gobble_file
...
It even matches against addresses of funtion entries if no debug info is found.
What version of Valgrind are you using?
> I'm a little unclear on whether this works with (say) template class
> functions in namespaces, etc.
Callgrind does the matching against demangled symbol names (unless you run with
"--demangle=no"), and these contain class name and namespaces.
> Has anyone ever actually seen this
> work? Googling doesn't turn up much.
Hmm.. I probably should add a regression test for this.
But as you see above, it works at least for me...
Josef
>
> Mike
>
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users