This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Thread bound variable objects [was: Re: MI non-stop mode spec]
> > OK, it should be:
> >
> > + if (old_cleanups != NULL)
> > + do_cleanups (old_cleanups);
>
> I think that's also wrong. In the event that no cleanups were installed
> before calling this function, this code will fail to run the
> cleanups installed by this function. In the event that a cleanup
> should be really installed conditionally, the right code is:
>
> struct cleanups *back_to = make_cleanup (null_cleanup, NULL);
>
> if (...)
> make_cleanup ();
>
> do_cleanups (back_to);
I don't really see that: if nothing is added to cleanup_chain then no cleanups
are done.
>...
> > I see now from the ChangeLog that you've committed your own change without
> > posting to the list first or explaining what it does.
>
> Sorry, no:
> 1. I've checked in two changes, not one.
> 2. Both are posted to gdb-patches.
OK, my mistake. I saw the first one.
> 3. Both are general cleanups, and don't implement anything that your patch
> tries to implement.
It's just that the second one includes changes in and overlaps with my patch so
I thought it was part of that thread. I'm not sure where that leaves things
now.
> > My patch does two things:
> >
> > 1) It stops a variable object from being considered automatically out of
> > scope when the selected thread changes.
> > 2) It associates a thread-id field with the variable object so that the
> > front end can organise the display of watch expressions accordingly.
> >
> > AFAICS your patch does neither of these. Could you please say what it
> > does do?
>
> Please see my gdb-patches posts.
With regard to the second patch, why you are using
make_cleanup_restore_current_thread when you aren't switching the thread in the
first place?
--
Nick http://www.inet.net.nz/~nickrob