This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]