This is the mail archive of the mailing list for the Archer 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][rfc] Rename gdb.Breakpoint getter methods.

El vie, 05-12-2008 a las 16:39 -0700, Tom Tromey escribiÃ:
> >>>>> "Thiago" == Thiago Jung Bauermann <> writes:
> Thiago> Most breakpoint properties can change (condition, commands, thread,
> Thiago> is_valid, is_enabled, is_silent, hit_count, ignore_count), so I kept
> Thiago> them as methods, just removing the get_ prefix.
> It seems to me that if we support changing the property from Python,
> then an attribute with side effects is natural.  E.g.:
>     b.ignore_count = 5
>     b.silent = True
> The changeability of things like the condition does not seem like a
> severe problem in this case.  We don't support setting all the
> attributes from Python -- but there's no reason we shouldn't.
> Thiago> But perhaps number and location (can it ever change?) could be
> Thiago> changed to attributes?
> Location is immutable in gdb, though I don't know why.
> We could enable this from Python, too.
> Number ought to be fixed.


> So, I think basically all of these should be attributes.
> What do you think?  Is this too magical?

I agree it is natural to have settable attributes in python, my only
concern is that it's possible for the attributes to change without the
python script touching them (e.g., because it was changed via the GDB
command line by the user). Would that be confusing to the python
programmer? I really don't know, maybe not.

In that case, even gdb.current_objfile, gdb.current_frame and
gdb.current_thread could be attributes...
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]