[RFC updated PATCH 2/2] Bug Translator 3016 : Error accessing members of anonymous structs / unions

Prerna Saxena prerna@linux.vnet.ibm.com
Mon Sep 8 08:55:00 GMT 2008


Hi Frank,
As per your suggestion , I've removed the clog messages and instead 
replaced them with  a global (static) string to contain error messages 
in case of errors encountered in reading/decoding dwarf information. 
This brings 2 scenarios :

i  . An error is encountered in a search path but the listed member is 
found in another search path :
    No error message displayed in this case.

ii . An error is encountered in reading dwarf info for a search path AND 
the listed member is not found in any search path :
    The respective error msg is listed at the end when a semantic error 
is thrown for Translation failure.

This seems to work okay for now, but I'm looking forward to suggestions 
for improving it :-)

Frank Ch. Eigler wrote:
> Prerna Saxena <prerna@linux.vnet.ibm.com> writes:
>
>   
>>> [...]
>>> The code that prints to clog needs to go back to throwing exceptions,
>>> or if absolutely necessary, to session.print_{warning,error}.
>>>       
>
>   
>> I had deliberately changed code in function translate_components() to
>> print  to clog instead of throwing exceptions.
>>     
>
> Right.
>
>   
>> [...]  I thought it would not be a good idea to make the code throw
>> an exception if a there are issues determining the dwarf information
>> for one search path traversing one of the nested structs ; there is
>> a reasonably good chance this member may be discovered in another
>> search path and the translation may succeed later on.  [...]
>>     
>
> The problem with this line of thought is that the user will see
> messages that he won't know what to do with.  There should be no
> message on clog at all if the search succeeds down another branch.
>
> One can use exceptions in this context just fine.  When you recurse,
> you can catch the exceptions, only to throw a new (or a saved old) one
> should the final search results come up empty.
>
>
> - FChE
>   
Regards,

-- 
Prerna Saxena

Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: anon-union-2.patch
URL: <http://sourceware.org/pipermail/systemtap/attachments/20080908/44574ee6/attachment.ksh>


More information about the Systemtap mailing list