From: Michael Snyder <msnyder@cygnus.com>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: Don Howard <dhoward@redhat.com>,
Andrew Cagney <ac131313@cygnus.com>,
gdb-patches@sources.redhat.com,
Fernando Nasser <fnasser@cygnus.com>
Subject: Re: [RFA] deleting breakpoints inside of 'commands' [Repost]
Date: Wed, 19 Sep 2001 12:18:00 -0000 [thread overview]
Message-ID: <3BA8EF66.43ED46F5@cygnus.com> (raw)
In-Reply-To: <1010919190753.ZM14865@ocotillo.lan>
Kevin Buettner wrote:
>
> On Sep 19, 9:34am, Don Howard wrote:
>
> > > > 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).
> > >
> > > Rememeber, the patch doesn't have to be perfect, just acceptable. In
> > > this case, the change eliminates a stray pointer problem (which would
> > > likely still occure with reference counters) and hence makes gdb far
> > > more robust - I put robustness and maintainability at a much higher
> > > priority level then performance.
> > > When someone manages to demonstrate that the copy is a significant
> > > overhead (using ``set maint profile on/off'' [:-)]) then I think we
> > > should refine the code to do what you propose (or gasp add a garbage
> > > collector :-/). However, Don, if you're upto the task.
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > I don't understand what you are asking here. I've followed the thread
> > and it seems that the unconditional copy is not acceptable. I will look
> > at the suggestions that Fernando and Michael have suggested and see if I
> > can come up with another patch.
>
> 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.
>
> A slightly more complicated scheme would examine the command list for
> commands which may alter/delete the list and then tag the entire list
> as one that needs to be copied. This would be done ahead of time
> (probably at the time that the list is created). There's no point in
> scanning the command list every time we want to execute the commands
> because it's nearly as cheap to make a copy. (Both are linear time
> operations.)
I thought about this, but then I thought that the command list
might include user-defined commands, which in turn might call
delete. That makes it a recursive problem. And I'm not sure
whether user commands might be re-defined later (after this
step has been done.)
next prev parent reply other threads:[~2001-09-19 12:18 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-17 9:34 Don Howard
2001-09-17 15:39 ` Michael Snyder
2001-09-18 6:56 ` Fernando Nasser
2001-09-18 7:56 ` Andrew Cagney
2001-09-18 8:09 ` Fernando Nasser
2001-09-18 10:34 ` Michael Snyder
2001-09-18 17:47 ` Andrew Cagney
2001-09-18 18:03 ` Michael Snyder
2001-09-19 7:20 ` Fernando Nasser
2001-09-19 8:17 ` Andrew Cagney
2001-09-19 9:22 ` Fernando Nasser
2001-09-19 11:44 ` PRMS not TODO: " Andrew Cagney
2001-09-19 9:33 ` Don Howard
2001-09-19 12:08 ` Kevin Buettner
2001-09-19 12:18 ` Michael Snyder [this message]
2001-09-19 13:09 ` Kevin Buettner
[not found] ` <3BA905AD.5F8F1A68@redhat.com>
2001-09-19 14:22 ` Kevin Buettner
2001-09-19 14:44 ` Fernando Nasser
2001-09-20 15:24 ` Don Howard
2001-09-20 18:05 ` Andrew Cagney
[not found] <Pine.LNX.4.33.0109211638230.1755-100000@theotherone>
2001-09-24 17:10 ` Kevin Buettner
2001-09-24 17:33 ` Kevin Buettner
2001-09-24 18:52 ` Andrew Cagney
2001-09-26 13:07 ` Fernando Nasser
2001-09-26 14:20 ` Kevin Buettner
2001-09-26 14:57 ` Fernando Nasser
2001-09-26 15:09 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BA8EF66.43ED46F5@cygnus.com \
--to=msnyder@cygnus.com \
--cc=ac131313@cygnus.com \
--cc=dhoward@redhat.com \
--cc=fnasser@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox