From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id D0D1C3943426 for ; Fri, 14 May 2021 16:22:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D0D1C3943426 Received: by mail-wm1-x330.google.com with SMTP id t206so82349wmf.0 for ; Fri, 14 May 2021 09:22:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=DjZ27PhjwUE2w+EGVeftT0Zx0ovV54besYGgLdgNfDc=; b=dbgVF8IQIYgO/3pzU77qeWflpWZ+CXY2svvWj1ZEkWJs/PcuNx77EnuiOVbUDKQdwA QraZFvgR/B6BZ+1hxJhNAbIpL6AcuTvFUvwMDBQYMYtqQWCpgLTcEmckfL2j1m+s5do2 d2OEJ5dIrkiWCnd8esv8+orqf9eZkAC5A23KA1xPlHcqHWp15Ge3r95XN06VC0yhKCF0 vB5WlJtHQhUqEt4BqHr1qwAdg/LOTuMKt27ll5jF59AQGb5c7MH0JspVQr/OR0o3ROrT M8fWfQYljXU2vG5EqbR0/ThjU/siZiLLT/lepv4F4RpZE9YYhY684PJlPTurLTHrEOWh sRYQ== X-Gm-Message-State: AOAM5330Y76l82lqYSAtusB7azcKfFV3Cc19186csLAY0+vf9X1I/y+U VPU/RFeIatebmvXDBnmfOrW9kAl0R00Miw== X-Google-Smtp-Source: ABdhPJxG8HghaK6pLrP8kximpxgW+Y3QJzGHWcqehi9T3B39dPMTECNyI8SdXugx01jMQ9XTvlBQXA== X-Received: by 2002:a05:600c:251:: with SMTP id 17mr10535656wmj.64.1621009340913; Fri, 14 May 2021 09:22:20 -0700 (PDT) Received: from bucheron-thinkpad (cpc120850-nrwh12-2-0-cust139.4-4.cable.virginm.net. [82.32.180.140]) by smtp.gmail.com with ESMTPSA id g16sm9074989wmh.32.2021.05.14.09.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 09:22:20 -0700 (PDT) From: Magne Hov To: "Aktemur, Tankut Baris" , "gdb-patches@sourceware.org" Subject: RE: [PATCH v2] gdb: fix eval.c assert during inferior exit event In-Reply-To: References: <20210505155627.3850386-1-mhov@undo.io> <20210510172121.2123009-1-mhov@undo.io> Date: Fri, 14 May 2021 17:22:19 +0100 Message-ID: <5smtsxjnes.fsf@undo.io> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2021 16:22:23 -0000 Thanks for these comments, I'll make sure to address them in a revised patch. On 11 May 2021 07:16, "Aktemur, Tankut Baris" wrote: > On Monday, May 10, 2021 7:21 PM, Magne Hov wrote: >> diff --git a/gdb/eval.c b/gdb/eval.c >> index 1b3c974009a..34c6c6160d4 100644 >> --- a/gdb/eval.c >> +++ b/gdb/eval.c >> @@ -93,7 +93,7 @@ struct value * >> expression::evaluate (struct type *expect_type, enum noside noside) >> { >> gdb::optional stack_temporaries; >> - if (target_has_execution () >> + if (target_has_execution () && inferior_ptid != null_ptid > > Nit: there is an extra space before `&&`. > >> && language_defn->la_language == language_cplus >> && !thread_stack_temporaries_enabled_p (inferior_thread ())) >> stack_temporaries.emplace (inferior_thread ()); >> diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp >> index e89cd8b021b..9aa0680fd0e 100644 >> --- a/gdb/testsuite/gdb.python/py-events.exp >> +++ b/gdb/testsuite/gdb.python/py-events.exp >> @@ -197,18 +197,33 @@ gdb_test_multiple "continue" $test { >> gdb_test_no_output "delete $second_breakpoint" >> >> #test exited event. >> +proc get_process_id {test} { >> + global gdb_prompt >> + gdb_test_multiple "info proc" $test { >> + -re "process (\\d+).*$gdb_prompt $" { >> + set process_id $expect_out(1,string) >> + pass $test > > Using `$gdb_test_name` is preferable here, I believe. > > -Baris > > > > Intel Deutschland GmbH > Registered Address: Am Campeon 10, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928