Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Siva Chandra <sivachandra@google.com>
To: gdb-patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
	Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: [PATCH] Fix regression introduced by 6c659fc2c7cd2da6d2b9a3d7c38597ad3821832a
Date: Sat, 29 Nov 2014 18:08:00 -0000	[thread overview]
Message-ID: <CAGyQ6gwhzpzy6bVtMaj7NOqtXnKQDzOG2OdqesJUkya4bpAF9Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 814 bytes --]

The regression was pointed out here:
https://sourceware.org/ml/gdb-patches/2014-11/msg00728.html

It was introduced by my patch which was pushed as
6c659fc2c7cd2da6d2b9a3d7c38597ad3821832a. What my patch did was to
make evaluate_subexp non re-entrant. As in, if evaluate_subexp is
called with *pos == 0 while a top level expression is under
evaluation, then it will crash with symptoms similar to those reported
above. The attached patch fixes this problem and hence the regression.
Jan Kratochvil has kindly tested it for me and confirmed that it
indeed fixes the regression and does not introduce any new ones.

gdb/ChangeLog:

2014-11-29  Siva Chandra Reddy  <sivachandra@google.com>

        * eval.c (evaluate_subexp): Check that thread stack temporaries
        are not already enabled before enabling them.

[-- Attachment #2: fix_regression_v1.txt --]
[-- Type: text/plain, Size: 539 bytes --]

diff --git a/gdb/eval.c b/gdb/eval.c
index a13793c..c2ab879 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -69,7 +69,8 @@ evaluate_subexp (struct type *expect_type, struct expression *exp,
   int cleanup_temps = 0;
 
   if (*pos == 0 && target_has_execution
-      && exp->language_defn->la_language == language_cplus)
+      && exp->language_defn->la_language == language_cplus
+      && !thread_stack_temporaries_enabled_p (inferior_ptid))
     {
       cleanups = enable_thread_stack_temporaries (inferior_ptid);
       cleanup_temps = 1;

             reply	other threads:[~2014-11-29 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29 18:08 Siva Chandra [this message]
2014-11-29 21:28 ` Ulrich Weigand
2014-11-29 23:52   ` Siva Chandra

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=CAGyQ6gwhzpzy6bVtMaj7NOqtXnKQDzOG2OdqesJUkya4bpAF9Q@mail.gmail.com \
    --to=sivachandra@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=uweigand@de.ibm.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