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:
> 
> I don't think that reference counting is the right way to go.  You'll
> be adding complexity to GDB in the form of making certain parts of GDB
> responsible for updating the reference counts.  Also, there's the
> overhead of maintaining the reference counts.  I agree that making a
> copy of the commands might be a little bit slower, but it has the
> advantage of being simple which makes it easier to verify correctness.
> 

What complexity?  The same parts of GDB that allocate/deallocate the
list
(maybe two places?) will to call a slightly different function.  The one
that deallocates checks the counter first intead of blindly freeing up
memory.  The only addition is a couple of calls where we pick a list of
commands to be executed (one place perhaps) to make sure the fact we are
using it is known. 

No need to recursively look for anything, parse anything.  No overhead
at
all except for some incr and decr operations.


-- 
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]