From patchwork Sat Nov 29 18:08:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Chandra Reddy X-Patchwork-Id: 4011 Received: (qmail 23761 invoked by alias); 29 Nov 2014 18:08:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23749 invoked by uid 89); 29 Nov 2014 18:08:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ob0-f169.google.com Received: from mail-ob0-f169.google.com (HELO mail-ob0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 29 Nov 2014 18:08:22 +0000 Received: by mail-ob0-f169.google.com with SMTP id vb8so6216213obc.14 for ; Sat, 29 Nov 2014 10:08:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=5CayEIabpWnkNYb1FoB87pRYvA4mRZXrbpAbjoaEvKs=; b=WVcBZzwnDzpe2qxz2ZtuQvREcv/uQhWgqZiewOZ/jg0y47Onq+Sr95yJmFNoaF7f81 ZiWI1J+7UxVLg90y5D1X+Xg+N8oefeHobo5nkeAVxEmckdZ6FqkU5u8zkbFtcEZ7B/a6 mKFiI8ECp/axVdpVzsel4qoih4VKGFbSmkOYL4bXkuhRn9Glui0kQXBmQEhgjwtA0u2d GFcGs/ry6pE2H7UeUptyr6Xpapo2l1dvKMdhb1jqp0OvF0+Sa1fwHC6lihS4B/V5OtpH awCgKU7bDvzyENhDoxg0QVKrgBEqJ4r3dHGrbEplARKJWU7d+DhRJIuEkw1YCGuqVbG4 1aeg== X-Gm-Message-State: ALoCoQldMrr6icDVHMQ2QPqwz61BRi/QHeldvt+/l+n9tEMkmam2ubJnf8Tij1H3YMHXyCDryIij MIME-Version: 1.0 X-Received: by 10.60.48.65 with SMTP id j1mr18358863oen.42.1417284500792; Sat, 29 Nov 2014 10:08:20 -0800 (PST) Received: by 10.202.225.68 with HTTP; Sat, 29 Nov 2014 10:08:20 -0800 (PST) Date: Sat, 29 Nov 2014 10:08:20 -0800 Message-ID: Subject: [PATCH] Fix regression introduced by 6c659fc2c7cd2da6d2b9a3d7c38597ad3821832a From: Siva Chandra To: gdb-patches Cc: Ulrich Weigand , Jan Kratochvil X-IsSubscribed: yes 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 * eval.c (evaluate_subexp): Check that thread stack temporaries are not already enabled before enabling them. 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;