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: [patch][python] Add breakpoint support.


On 04/08/2010 09:40 PM, Tom Tromey wrote:
>>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
> 
> Phil> There is a save_breakpoints.py script in the archer repository
> Phil> already, so a lot of the work is done. I have a patch to modify that
> Phil> to save watchpoints too.  I've not ported it here today as I purely
> Phil> want to concentrate on the API aspect of porting. But there is really
> Phil> no reason why it can't go in immediately as part of another porting
> Phil> effort. I  think it would need some make/configure hackery to install,
> Phil> which is definitely my weakest area.
> 
> I can help with that if you want.

That would be great, thanks.  I'll check the Python breakpoint API
in tomorrow at some point during BST time. So after that, it should be
ok.

> I think the more difficult problem is deciding how users should activate
> commands written in Python.  Right now for Archer we have this "require"
> thing, but that seems like kind of a hack.  OTOH, loading all the
> commands at startup also seems weird.  It will make startup slower, for
> one thing.  Maybe we could implement some kind of auto-loading?

I normally (I think -- it's been awhile) just end up loading these with
execfile in my .gdbinit.  I cannot remember now. Anyway, it is not
optimal.  

Off the cuff, I think some kind of lazy-loading script mechanism would
be neat.  Scripts would register interest (much like the the
pretty-printers do now) in some kind of registry. I guess at start-up
GDB would have to invoke at least script stubs. This would
be so completion could work with Python scripts that are present but
not loaded.  And then, if all internal GDB commands are exhausted on
completion, GDB  could look in the Python script registry for commands
and complete/load them on demand. Or something like that?  I've no
idea how difficult this lazy mechanism would be off-hand.  Making GDB
aware of all Python utility scripts in a library seems nebulous. How?

Cheers,

Phil


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