This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [RFA] deleting breakpoints inside of 'commands' [Repost]


Michael Snyder wrote:
> 
> Andrew Cagney wrote:
> >
> > >
> > > I know GDB has performance problems with symbols, but I do not
> > > know that it doesn't have performance problems with executing
> > > command lists.  I know that when I used to work on the XRAY
> > > debugger, macro performance was a really big issue, whereas
> > > no one seems to have talked about it much in GDB...
> >
> > I'd expect gdb's macro performance to also be an issue.  I'd expect the
> > problems to come from host<->target overhead and not this command
> > duplication though.
> 
> OK, well, virtually anything will pale to insignificance
> next to host<->target overhead.  As I said, if I'm the only
> one who feels any concern about this, I will waive it.

I have the same concerns.
We haven't heard from Don yet.  Maybe he has some compromise solution.

Anyway, I find the copy solution a hack.

One way to fix this is to have the chain of commands as an object with
use count.  It is only freed when the count is down to zero again.

When you associate it with a breakpoint it goes up to 1.  When you
get it to execute it goes up to 2.

When a breakpoint is deleted, it deallocates it.  If the count goes 
to zero memory is freed.  But if the script is being executed (and
is deleting self) the count will go to 1 and nothing else happens
until the script finishes executing and the chain is freed (then
the count goes to zero and memory is deallocated).


-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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