This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: Python pretty-printing [5/6]


El jue, 09-04-2009 a las 16:19 +0100, Phil Muldoon escribiÃ:
> Thiago Jung Bauermann wrote:
> > I found one potential problem, which could cause the function to return
> > NULL without an exception being set (it's not the case I thought of
> > before, I think): suppose there's no objfile Python object when this
> > function is called, to the ALL_OBJFILES loop will skip all objs, then
> > the gdb module has no pretty_printers attribute, or the pretty_printers
> > value is not a list object. In that case, the function will return NULL
> > without a Python exception being set. Can it happen?
> 
> This would require the gdb.pretty_printers attribute in the code to be 
> changed from a list to something else (or removed for the not existing 
> scenario).  Anyway it would require a conscious code change on behalf of 
> another author, and not an environmental change. It could happen if 
> somebody changed the code, but I suspect (in this scenario) it would 
> fail long before it reached here.

I wonder if the pretty printing code in general would be better off
manipulating pretty_printers as a Sequence object, instead of a List.
After all, the OO people say you never know when you want to change your
implementation from a List to a FunkyStringOfObjects. :-)

I think me asking this to be changed would be pedantic, though. I agree
with you in that there's no real problem here.

> I'm in the middle of this right now. I'm putting the finishing touches 
> on the optional string fetch parameter from the comments posted to the 
> archer list, and will start work on fixing string output.

Awesome! I'm owing you an e-mail reply. Will do right now.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


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