Avoid assertion error for statement probe

Wenji Huang wenji.huang@oracle.com
Mon Aug 10 09:29:00 GMT 2009


Frank Ch. Eigler wrote:
[...]
>> $ stap -e 'probe process("./stap").statement("foo@main.cxx:*") {}'
>> semantic error: no matched function 'foo' in main.cxx
>> semantic error: no probes found
> 
> Not a bad idea, but perhaps we don't need that particular "no matched
> function" message that covers just this case, considering that the "no
> probes found" message can/should be paired with the probe point.
> 
> 
> - FChE
> 
How about to defer the error to the outer calling ?

$ stap -e 'probe process("./stap").statement("foo@main.cxx:1025-1026") {}'
semantic error: no match while resolving probe point 
process("./stap").statement("foo@main.cxx:1025-1026")
semantic error: no probes found
Pass 2: analysis failed.  Try again with another '--vp 01' option.

diff --git a/dwflpp.cxx b/dwflpp.cxx
index ff62265..d37b5e9 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -794,6 +794,8 @@ dwflpp::iterate_over_srcfile_lines (char const * 
srcfile,
    auto_free_ref<Dwarf_Line**> free_srcsp(srcsp);

    get_module_dwarf();
+  if (!this->function)
+    return;

    if (line_type == RELATIVE)
      {



More information about the Systemtap mailing list