Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, Jan Kratochvil <jkratoch@redhat.com>
Subject: Re: Current GDB crashes when it sources Emacs's .gdbinit
Date: Wed, 15 Apr 2009 21:55:00 -0000	[thread overview]
Message-ID: <m3tz4peg60.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m363h5fwy0.fsf@fleche.redhat.com> (Tom Tromey's message of "Wed\, 15 Apr 2009 15\:07\:03 -0600")

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> I found another crash through further testing.
Tom> I'll send the final patch plus test case after the regression tests
Tom> are done.

Here's the fix and the test case.  The one test exercises both bugs.

Built and regtested on x86-64 (compile farm).
I also reproduced both bugs here and verified the fix manually.

Jan, this is needed for Fedora.  Sorry about that.

Tom

2009-04-15  Tom Tromey  <tromey@redhat.com>

	* c-lang.c (evaluate_subexp_c): Correctly handle EVAL_SKIP.

2009-04-15  Tom Tromey  <tromey@redhat.com>

	* gdb.base/charset.exp: Add regression test.

Index: c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.64
diff -u -r1.64 c-lang.c
--- c-lang.c	14 Apr 2009 21:54:33 -0000	1.64
+++ c-lang.c	15 Apr 2009 21:46:55 -0000
@@ -941,7 +941,15 @@
 	*pos += 2;
 
 	if (noside == EVAL_SKIP)
-	  return NULL;
+	  {
+	    /* Return a dummy value of the appropriate type.  */
+	    if ((dest_type & C_CHAR) != 0)
+	      result = allocate_value (type);
+	    else
+	      result = value_typed_string ("", 0, type);
+	    do_cleanups (cleanup);
+	    return result;
+	  }
 
 	if ((dest_type & C_CHAR) != 0)
 	  {
Index: testsuite/gdb.base/charset.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/charset.exp,v
retrieving revision 1.13
diff -u -r1.13 charset.exp
--- testsuite/gdb.base/charset.exp	25 Mar 2009 19:25:49 -0000	1.13
+++ testsuite/gdb.base/charset.exp	15 Apr 2009 21:46:57 -0000
@@ -604,4 +604,9 @@
     test_combination u UCS-2 U UCS-4
 }
 
+# Regression test for a cleanup bug in the charset code.
+gdb_test "print 'a' == 'a' || 'b' == 'b'" \
+  ".* = 1" \
+  "EVAL_SKIP cleanup handling regression test"
+
 gdb_exit 


  reply	other threads:[~2009-04-15 21:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 19:10 Eli Zaretskii
2009-04-15 19:44 ` Tom Tromey
2009-04-15 20:36   ` Eli Zaretskii
2009-04-15 21:07     ` Tom Tromey
2009-04-15 21:55       ` Tom Tromey [this message]
2009-04-15 22:15         ` Eli Zaretskii

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=m3tz4peg60.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jkratoch@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