public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Siva Chandra <sivachandra@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>,
	gdb-patches <gdb-patches@sourceware.org>
Subject: Re: Regression for gdb.cp/exceptprint.exp [Re: [PATCH v6] Make chained function calls in expressions work]
Date: Sat, 29 Nov 2014 10:16:00 -0000	[thread overview]
Message-ID: <CAGyQ6gw6pPYQoF-eyc44Kv2r-YonPhzaFkFDaAr8+7CeVR00NQ@mail.gmail.com> (raw)
In-Reply-To: <20141129082620.GA16774@host2.jankratochvil.net>

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

On Sat, Nov 29, 2014 at 12:26 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Sat, 29 Nov 2014 01:03:57 +0100, Siva Chandra wrote:
>> I have now pushed this patch
>
> [bash]jkratoch@MOCK-fedora-21-x86_64:/home/jkratoch/redhat/gdb-clean/gdb/testsuite# git log
> commit 6c659fc2c7cd2da6d2b9a3d7c38597ad3821832a
> Author: Siva Chandra <sivachandra@chromium.org>
> Date:   Tue Nov 11 05:43:03 2014 -0800
>     Enable chained function calls in C++ expressions.
>
> On Fedora 21 x86_64 and x86_64-m32 (i686 not tested due to some unrelated
> regression).
>
>  print $_exception^M
> -$1 = 0x400b10 "hi bob"^M
> -(gdb) PASS: gdb.cp/exceptprint.exp: string: print exception value at throw
> -continue^M
> +thread.c:711: internal-error: value_in_thread_stack_temporaries: Assertion `tp != NULL && tp->stack_temporaries_enabled' failed.^M
> +A problem internal to GDB has been detected,^M
> +further debugging may prove unreliable.^M

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 the above. While I setup my VM/fedora box, can I ask you to
test the attached patch which should fix this (and hopefully fix the
regression)?

Thanks,
Siva Chandra

[-- Attachment #2: quick_fix.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;

  parent reply	other threads:[~2014-11-29 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27  6:55 [PATCH v6] Make chained function calls in expressions work Siva Chandra
2014-11-28 12:10 ` Ulrich Weigand
2014-11-29  0:04   ` Siva Chandra
2014-11-29  8:26     ` Regression for gdb.cp/exceptprint.exp [Re: [PATCH v6] Make chained function calls in expressions work] Jan Kratochvil
2014-11-29  8:59       ` Siva Chandra
2014-11-29  9:13         ` Jan Kratochvil
2014-11-29 10:16       ` Siva Chandra [this message]
2014-11-29 12:38         ` 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=CAGyQ6gw6pPYQoF-eyc44Kv2r-YonPhzaFkFDaAr8+7CeVR00NQ@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).