This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/4593] kread() functions should provide better error messages
- From: "joshua dot i dot stone at intel dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 7 Jun 2007 01:09:50 -0000
- Subject: [Bug runtime/4593] kread() functions should provide better error messages
- References: <20070604193455.4593.fche@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From joshua dot i dot stone at intel dot com 2007-06-07 01:09 -------
(In reply to comment #0)
> At the moment, all we get is "pointer dereference failed".
> We should also see the pointer value, and could enjoy even
> more information.
It's not really kread() creating the message, but the other convenience macro
CATCH_DEREF_FAULT(). The problem is that the underlying deref() macros use a
goto for error handling, so I can only have a single catch-point per function to
formulate an error message. So it's often hard to know *which* pointer failed.
There are ways to get around that, but I'm not sure how to do it in a generic
way. Probably the cleanest way is to fill in the error message right before the
goto in deref(). The dwarf accessors also call deref() -- would this change be
ok for those as well?
> The present tactic of setting context->last_error
> to a static unchanged string would have to change. An easy
> improvement would be to statically allocate an new error_buffer
> string field in the context, which embedded-C code could sprintf
> into and incidentally use to set the context->last_error.
This is a good idea.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=4593
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.