Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@red-bean.com>
To: Andrew STUBBS <andrew.stubbs@st.com>,
	Jim Blandy <jimb@red-bean.com>,
	 	gdb-patches@sources.redhat.com
Subject: Re: [RFC] Alternate approach to keeping convenience variables
Date: Sat, 10 Dec 2005 05:07:00 -0000	[thread overview]
Message-ID: <8f2776cb0512091513s41aea52cu531da8f5dcaa8a9@mail.gmail.com> (raw)
In-Reply-To: <20051209205923.GA21331@nevyn.them.org>

On 12/9/05, Daniel Jacobowitz <drow@false.org> wrote:
> 2005-12-09  Daniel Jacobowitz  <dan@codesourcery.com>
>
>         * Makefile.in (gdbtypes_h, gdbtypes.o, utils.o): Update.
>         * defs.h (hashtab_obstack_allocate, dummy_obstack_deallocate): Add
>         prototypes.
>         * dwarf2read.c (read_subroutine_type): Use TYPE_ZALLOC.
>         (hashtab_obstack_allocate, dummy_obstack_deallocate): Moved to...
>         * utils.c (hashtab_obstack_allocate, dummy_obstack_deallocate):
>         ...here.
>         * gdbtypes.c: Include "hashtab.h".
>         (build_gdbtypes): Remove extra prototype.
>         (struct type_pair, type_pair_hash, type_pair_eq)
>         (create_copied_types_hash, copy_type_recursive): New.
>         * gdbtypes.h: Include "hashtab.h".
>         (TYPE_ZALLOC): New.
>         (create_copied_types_hash, copy_type_recursive): New prototypes.
>         * objfiles.c (free_objfile): Call preserve_values.
>         * symfile.c (reread_symbols): Likewise.
>         (clear_symtab_users): Remove calls to clear_value_history and
>         clear_internalvars.
>         * value.c (clear_value_history, clear_internalvars): Removed.
>         (preserve_one_value, preserve_values): New functions.
>         * value.h (clear_value_history, clear_internalvars): Removed.
>         (preserve_values): New prototype.
>
>         * tracepoint.c (_initialize_tracepoint): Do not initialize convenience
>         variables here.

Well, that's a head-on attack.  I think Mr. Stubbs will be pleased
when he comes back.

I don't understand what the tracepoint.c change has to do with the
rest of the patch.

Commit the removal of the extra build_gdbtypes prototype as a separate
obvious change.

Same for TYPE_ZALLOC.  Make this a function, not a macro.

It would be nice if the comments for hashtab_obstack_allocate and the
dummy free actually explained what sort of DATA argument they expect.

copy_type_recursive undoes the sharing given a bunch of 'struct type'
objects all referring to a given 'struct main_type' object.  You could
just stick both kinds of pointers in the type hash, at the cost of
some static typing.  And it doesn't preserve 'pointer_type',
'reference_type', or 'chain' groupings.

Go ahead and expand the comment in copy_type_recursive to spell out
why it is *necessary* to add the type pair to the hash table before
the type is completely constructed.  Don't just point out that we do
it where we do it.

Because they would have different lifetimes, we should never have a
type in one objfile pointing to a type in another objfile.  And if we
ever did, then that assert would catch it.  Good.  There should be a
comment to that effect in some appropriate place.

preserve_values also needs a comment indicating that it's meant to be
called only when we're about to free the given objfile, which ensures
that we never make more than one copy of a given type.


  reply	other threads:[~2005-12-09 23:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-21 22:05 [PATCH] keeping convenience variables (take 2) Andrew STUBBS
2005-11-22  4:58 ` Eli Zaretskii
2005-11-22  8:43 ` Jim Blandy
2005-11-22 19:27   ` Andrew STUBBS
2005-12-10  4:46     ` [RFC] Alternate approach to keeping convenience variables Daniel Jacobowitz
2005-12-10  5:07       ` Jim Blandy [this message]
2005-12-10  8:24         ` Daniel Jacobowitz
2005-12-10 22:20           ` Jim Blandy
2005-12-11 18:12             ` Eli Zaretskii
2005-12-11 19:17       ` Eli Zaretskii
2006-01-23 22:29         ` Jim Blandy
2006-01-24 11:44           ` Andrew STUBBS
2006-01-24 18:41             ` Jim Blandy
2006-01-24 18:43               ` Daniel Jacobowitz
2006-01-24 19:16                 ` Jim Blandy
2006-01-24 19:24                   ` Daniel Jacobowitz
2006-01-25  0:13                     ` Jim Blandy
2006-01-24 19:45                   ` Andrew STUBBS
2006-01-04 12:17       ` Andrew STUBBS
2006-01-04 17:00         ` Jim Blandy
2006-01-04 17:48           ` Andrew STUBBS
2006-01-04 18:37             ` Jim Blandy
2006-01-22 21:04               ` Daniel Jacobowitz
2006-01-22 21:31       ` Daniel Jacobowitz
2006-01-23 22:46         ` Jim Blandy
2006-01-27 17:53         ` Eli Zaretskii
2006-01-27 18:12           ` Jim Blandy
2006-01-27 18:29             ` Eli Zaretskii
2006-01-27 18:41           ` Joel Brobecker
2006-02-01 23:14         ` Daniel Jacobowitz
2006-02-02  4:18           ` Eli Zaretskii
2006-02-06 22:14             ` Daniel Jacobowitz

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=8f2776cb0512091513s41aea52cu531da8f5dcaa8a9@mail.gmail.com \
    --to=jimb@red-bean.com \
    --cc=andrew.stubbs@st.com \
    --cc=gdb-patches@sources.redhat.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