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.129.124]) by sourceware.org (Postfix) with ESMTPS id DEA273851175 for ; Tue, 28 Jun 2022 18:48:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DEA273851175 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-451-jSDpukrUOK2k_VHwBpTwRA-1; Tue, 28 Jun 2022 14:48:53 -0400 X-MC-Unique: jSDpukrUOK2k_VHwBpTwRA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B3C543C10147 for ; Tue, 28 Jun 2022 18:48:52 +0000 (UTC) Received: from [10.97.116.12] (ovpn-116-12.gru2.redhat.com [10.97.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6BD062166B29 for ; Tue, 28 Jun 2022 18:48:52 +0000 (UTC) Message-ID: <49dfc299-df87-e313-434a-9ebd1572907e@redhat.com> Date: Tue, 28 Jun 2022 15:48:50 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: [PINGv2][PATCH] gdb/testsuite: Expand gdb.cp/mb-ctor.exp to test dynamic allocation To: gdb-patches@sourceware.org References: <20220607195452.40555-1-blarsen@redhat.com> From: Bruno Larsen In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, 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: Tue, 28 Jun 2022 18:48:56 -0000 ping! Cheers! Bruno Larsen On 6/21/22 09:46, Bruno Larsen wrote: > ping! > > Cheers! > Bruno Larsen > > On 6/7/22 16:54, Bruno Larsen wrote: >> 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. >> >> --- >>   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" >> + >> +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" >> + >> +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" >