From: Tom Tromey <tromey@redhat.com>
To: Chris Moller <cmoller@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Patch for PR 10728
Date: Tue, 02 Feb 2010 23:57:00 -0000 [thread overview]
Message-ID: <m37hqvyywa.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4B689FD2.9070300@redhat.com> (Chris Moller's message of "Tue, 02 Feb 2010 16:57:38 -0500")
Chris> + * c-lang.h:
Empty entry; it is customary to list the new names, e.g., from an
earlier patch:
* c-lang.h (cp_print_value_fields_rtti): Declare.
Chris> +extern void cp_initialise_statmem_stack();
Chris> +extern void cp_free_statmem_stack();
Space before open parens. Use (void), not ().
These occur several times.
Chris> - return val_print (val_type, value_contents_all (val),
Chris> + {
Chris> + int rc;
Chris> +
Chris> + cp_initialise_statmem_stack();
initialize, with a z.
Chris> + rc = val_print (val_type, value_contents_all (val),
Chris> value_embedded_offset (val),
Chris> value_address (val),
Chris> stream, 0, &opts, current_language);
Chris> +
Chris> + cp_free_statmem_stack();
There are other calls to val_print in this function.
It seems like they should all be wrapped.
If cp_free_statmem_stack must be called, then you need a cleanup.
However, does it really need to be called? IMO it is ok to keep a
little data on this obstack in between calls as long as it is cleared at
the next call (so that we don't leak an unbounded amount over time).
It isn't clear to me from this patch or the explanation that
cp_initialise_statmem_stack is called at every relevant entry point.
In fact it would be better not to have to do that, because auditing
this call hierarchy is tricky.
E.g., m2-valprint.c has a call to cp_print_value_fields. Does that
matter?
I didn't read the old code in depth; is there a way to make this
self-initializing?
Chris> +/* initialise to empty the static member stack */
Comments should start with a capital and end with a period & two
spaces. See the GNU Coding Standards.
Chris> + void * statmem_obstack_top = NULL;
No space after the "*".
Chris> - first_dont_print
Chris> - = (CORE_ADDR *) obstack_base (&dont_print_statmem_obstack);
Chris> - i = (CORE_ADDR *) obstack_next_free (&dont_print_statmem_obstack)
Chris> - - first_dont_print;
Chris> + first_dont_print =
Chris> + (CORE_ADDR *)obstack_base (&dont_print_statmem_obstack);
Chris> + i =
Chris> + obstack_object_size (&dont_print_statmem_obstack) / sizeof(CORE_ADDR);
The formatting is weird here; the first statement doesn't appear to have
changed, but has gratuitous formatting changes, and the second statement
has a tab before the "=".
Chris> +send_gdb "print b\n"
Chris> +
Chris> +gdb_expect {
Chris> + -re "same as static member" {
Chris> + pass "print b"
Chris> + }
Chris> + timeout { fail "(timeout) print b" }
Chris> +}
Don't use sent + gdb_expect. Use gdb_test.
Tom
next prev parent reply other threads:[~2010-02-02 23:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-02 21:57 Chris Moller
2010-02-02 23:57 ` Tom Tromey [this message]
2010-02-03 4:36 ` Chris Moller
2010-02-03 18:23 ` Tom Tromey
2010-02-03 4:52 ` Chris Moller
-- strict thread matches above, loose matches on Subject: below --
2010-01-27 19:41 Chris Moller
2010-01-28 18:09 ` Tom Tromey
2010-01-28 18:38 ` Chris Moller
2010-01-28 20:03 ` Tom Tromey
2010-02-03 20:41 ` Chris Moller
2010-02-03 20:50 ` Tom Tromey
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=m37hqvyywa.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=cmoller@redhat.com \
--cc=gdb-patches@sourceware.org \
/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