public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add function name and file to semantic error messages for not found local variables.
@ 2008-11-11  0:58 Przemysław Pawełczyk
  2008-11-11 10:15 ` Mark Wielaard
  0 siblings, 1 reply; 4+ messages in thread
From: Przemysław Pawełczyk @ 2008-11-11  0:58 UTC (permalink / raw)
  To: systemtap

Hi,

Few weeks ago I found out SystemTap and from that time I'm slowly
discovering its features. I've already joined discussion at
#systemtap.
I have a patch analogous to Mark Wielaard's commit 194c6687 (Add
function name and file to semantic error messages for $return).

Some background:

His patch was a side-effect of question about my simple script:
stap -e 'global errors = 0; probe syscall.*.return {if ($return < 0)
errors++} probe end {printf("Syscalls with errors: %d\n", errors);
delete errors}'
because I said that analysis had failed on compat_sys_recvmsg. Mark
noticed this also, but he asked me how I had found such information
and I pointed at stap -vv and comparing pc. Mark gave me also a link
to http://sourceware.org/bugzilla/show_bug.cgi?id=5890, which he
commented.

Day before that I had other problem, caused by script:
stap -e 'probe syscall.* {printf("%s(%s)\n", probefunc(), argstr)}' -c 'echo'
and Mark helped me then also (explanation:
http://sourceware.org/bugzilla/show_bug.cgi?id=5434#c2).
Couple of days later, writing strace-like script
(http://research.pawelczyk.it/systemtap/strace.stp) on clean systemtap
I spotted, that more meaningful error message in mentioned case would
be useful as well. I put some info on channel, but probably it was
overlooked. Now I'm trying more formal way.

If I forgot about something, please let me know. It's my first message here.


diff --git a/tapsets.cxx b/tapsets.cxx
index 5acf50c..fd81927 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1690,6 +1690,8 @@ struct dwflpp
 	print_locals (scopes, alternatives);
 	throw semantic_error ("unable to find local '" + local + "'"
 			      + " near pc " + lex_cast_hex<string>(pc)
+			      + " for " + dwarf_diename (scope_die)
+			      + "(" + dwarf_diename (cu) + ")"
 			      + (alternatives.str() == "" ? "" : (" (alternatives:" +
alternatives.str () + ")")));
       }


-- 
Przemysław Pawełczyk

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-11 12:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-11  0:58 [PATCH] Add function name and file to semantic error messages for not found local variables Przemysław Pawełczyk
2008-11-11 10:15 ` Mark Wielaard
2008-11-11 12:06   ` Przemysław Pawełczyk
2008-11-11 12:33     ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).