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]


Kevin Buettner wrote:
> 
> This doesn't sound too bad; if the patches look reasonable, I may change
> my mind...
> 

I am sconfident it can be small.  I don't know if this is what Don's
next patch
will do, but if it is we will know for sure.

> HOWEVER, I'm against reference counts in general because it can be
> very hard to get the counter increments / decrements put in the right
> places.  If you screw it up, you either get memory leaks or memory
> corruption or both.  If we're contemplating the use of reference
> counts for other areas of GDB, I think we ought to rethink the problem
> and use some other garbage collection technique instead.
> 

Lets not get carried over :-)  I am not proposing it as a GDB
programming
style in general.  I just suggested it as an algorithm to solve a
specific
problem with low overhead.  Don't worry.

The ref counts can get really messy if everyone has to deal with them.
But, if properly encapsulated, most programers will not even know that
they are
dealing with ref counts and the chances of leaks/corruption is very slow
(whoever programmed the object had worked 26 hours in a row or
something).

Take a look at the "Proxy" pattern on the "Design Patterns" book (and
blame
Andrew Cagney for reminding me of this book a few months ago ;-) ).

Regards,
Fernando

-- 
Fernando Nasser
Red Hat Canada Ltd.                     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]