From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 128E83842AFC for ; Thu, 30 Jun 2022 14:26:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 128E83842AFC Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-464-r9EyFmImM9unHmNdchKklw-1; Thu, 30 Jun 2022 10:26:51 -0400 X-MC-Unique: r9EyFmImM9unHmNdchKklw-1 Received: by mail-wm1-f72.google.com with SMTP id az35-20020a05600c602300b003a1867d09b5so333310wmb.0 for ; Thu, 30 Jun 2022 07:26:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=roLoXsqF/YeP+O8UC4RR5drZszw7BdWjpnUix8fBuWk=; b=ADeGRg3YWPRvJCHobKcrNwqeqrc/p/q7hKQ5jhZwzuLEWY2uOHDJ/lHd0+G6Rlpn4n rMoQL8h+M+04xBVqpvxw2+TxKdeWJ53QW5VmcmoQxwySL4OwRPQsJComFaG9erh8QzE6 3msq0sw+T5ZUNyJzbIhgOiGcOfQ+ZDcy/C6FAZwj5y+QQ/hPnQ5wtmsX7et55mT0jAv6 ew39Opk/y9M1QbjU4x7YdvRiuWsKWK92cXaGTgSdvh0shzgEUh5DwTw+lddrAnRz/e/C +U7QjoDfvZPswPZj4VYkMqgUg8CrHyvq/V/YKnvF4FyuE3vRl+MsnXDD2q8sxDu+7jhZ BmvQ== X-Gm-Message-State: AJIora9UjnO+OgFU6PfhOKJ3rGfpSKJZLGpX0waA59LOV6bPgXY471xg ikGDZpNAkrjU1SCp+icbzYZ74uwsmzf7fI+RycS8yMDdu0fgwYSwny8OLamBaGSXEH7ZREErQM+ /kVh4slwaZM4g68LE/sh2sg== X-Received: by 2002:a7b:c410:0:b0:3a0:2d7d:732a with SMTP id k16-20020a7bc410000000b003a02d7d732amr12298698wmi.113.1656599210542; Thu, 30 Jun 2022 07:26:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uCLU1LJD2mHwBpSQESzOz+nciI3VvTFailtv4BE8svx2puUvPjNZR5ivq24d987Gn4a8/Ung== X-Received: by 2002:a7b:c410:0:b0:3a0:2d7d:732a with SMTP id k16-20020a7bc410000000b003a02d7d732amr12298677wmi.113.1656599210322; Thu, 30 Jun 2022 07:26:50 -0700 (PDT) Received: from localhost (15.72.115.87.dyn.plus.net. [87.115.72.15]) by smtp.gmail.com with ESMTPSA id p28-20020a1c545c000000b003a02de5de80sm2843327wmi.4.2022.06.30.07.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 07:26:49 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/testsuite: Expand gdb.cp/mb-ctor.exp to test dynamic allocation In-Reply-To: <20220607195452.40555-1-blarsen@redhat.com> References: <20220607195452.40555-1-blarsen@redhat.com> Date: Thu, 30 Jun 2022 15:26:48 +0100 Message-ID: <877d4ycjmf.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Thu, 30 Jun 2022 14:26:54 -0000 Bruno Larsen via Gdb-patches writes: > When testing GDB's ability to stop in constructors, gdb.cp/mb-ctor.exp > only tested objects allocated on the stack. This commit adds a couple of > dynamic allocations and tests if GDB can stop in it as well. > --- > > This was inspired by an outstanding patch in Fedora's GDB tree. I'm not > sure if it is different enough to warrant testing, but I don't think it > would hurt either. I agree that it can't hurt to include this additional testing. The patch looks good, with a minor nit fixed... > > --- > gdb/testsuite/gdb.cp/mb-ctor.cc | 6 ++++++ > gdb/testsuite/gdb.cp/mb-ctor.exp | 16 ++++++++++++++++ > 2 files changed, 22 insertions(+) > > diff --git a/gdb/testsuite/gdb.cp/mb-ctor.cc b/gdb/testsuite/gdb.cp/mb-ctor.cc > index c54b4fece48..faa59f16459 100644 > --- a/gdb/testsuite/gdb.cp/mb-ctor.cc > +++ b/gdb/testsuite/gdb.cp/mb-ctor.cc > @@ -64,5 +64,11 @@ int main() > DeeplyDerived's ctor. */ > DeeplyDerived dd(15); > > + Derived *dyn_d = new Derived (24); > + DeeplyDerived *dyn_dd = new DeeplyDerived (42); > + > + delete dyn_d; > + delete dyn_dd; > + > return 0; > } > diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp > index cf22be9caa8..4b445635205 100644 > --- a/gdb/testsuite/gdb.cp/mb-ctor.exp > +++ b/gdb/testsuite/gdb.cp/mb-ctor.exp > @@ -59,6 +59,22 @@ gdb_test "continue" \ > > gdb_continue_to_breakpoint "set breakpoint here, second time" ".* breakpoint here" > > +gdb_test "continue" \ > + ".*Breakpoint.*Derived.*i=24.*" \ > + "run to breakpoint 1 dynamic v1" > + > +gdb_continue_to_breakpoint "set breakpoint here, first dynamic time" ".* breakpoint here" This line is too long, and can be split like: gdb_continue_to_breakpoint "set breakpoint here, first dynamic time" \ ".* breakpoint here" > + > +gdb_test "continue" \ > + ".*Breakpoint.*Derived.*i=42.*" \ > + "run to breakpoint 1 dynamic v2" > + > +gdb_continue_to_breakpoint "set breakpoint here, second dynamic time" ".* breakpoint here" And again here. With those fixed, please feel free to apply this patch. Thanks, Andrew > + > +gdb_test "continue" ".*Breakpoint.*~Derived.*" "Run to dynamic destructor v1" > + > +gdb_test "continue" ".*Breakpoint.*~Derived.*" "Run to dynamic destructor v2" > + > gdb_test "continue" \ > ".*Breakpoint.*~Derived.*" \ > "run to breakpoint 3 v1" > -- > 2.31.1