Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Chris Moller <cmoller@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Patch for cp-valprint.c
Date: Fri, 22 Jan 2010 22:07:00 -0000	[thread overview]
Message-ID: <m3my05ssje.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4B59DF28.4090306@redhat.com> (Chris Moller's message of "Fri, 22 	Jan 2010 12:23:52 -0500")

>>>>> "Chris" == Chris Moller <cmoller@redhat.com> writes:

Chris> While working on something else, I found the following:
Chris>    /* FIXME (alloca): unsafe if baseclass is really really large. */
Chris>    gdb_byte *buf = alloca (TYPE_LENGTH (baseclass));

Chris> The attached patch replaces that with a xmalloc/xfree pair.

Please send unidiff or context diffs.

I just put "diff -u -N" into my ~/.cvsrc.  I've never regretted it.

>> buf = xmalloc (TYPE_LENGTH (baseclass));

>> if (buf) {
>> xfree (buf);
>> buf = NULL;

In gdb you can't generally do pairings like this, due to exceptions.
Instead, you must make a cleanup.

Also, you don't need to check the argument to xfree; xfree handles NULL
pointers fine.

Chris> -FAIL: gdb.base/solib-display.exp: after rerun
Chris> -FAIL: gdb.base/solib-display.exp: after rerun (GDB internal error)
Chris> -PASS: gdb.base/solib-display.exp: break 25
Chris> -FAIL: gdb.base/solib-display.exp: continue (GDB internal error)
Chris> -PASS: gdb.base/solib-display.exp: display main_global
Chris> -PASS: gdb.base/solib-display.exp: display a_local
Chris> -PASS: gdb.base/solib-display.exp: display a_static
Chris> -PASS: gdb.base/solib-display.exp: break 25
Chris> -FAIL: gdb.base/solib-display.exp: continue
Chris> +ERROR: Process no longer exists
Chris> +UNRESOLVED: gdb.base/solib-display.exp: after rerun
Chris> +WARNING: remote_expect statement without a default case?!
Chris> +FAIL: gdb.base/solib-display.exp: Can't run to main (3)

Jan has a patch pending for this.

I don't know about the other changes offhand.  Sometimes I re-run the
test suite to see if problems just go away... though I think Jan has put
some work into making this happen less.

Tom


  reply	other threads:[~2010-01-22 22:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22 17:24 Chris Moller
2010-01-22 22:07 ` Tom Tromey [this message]
2010-01-23  0:26   ` Jan Kratochvil

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=m3my05ssje.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