From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32168 invoked by alias); 9 May 2018 14:31:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32145 invoked by uid 89); 9 May 2018 14:31:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:skip_hw X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 May 2018 14:31:55 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF6D311E2E9 for ; Wed, 9 May 2018 14:31:53 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B94ED7B39; Wed, 9 May 2018 14:31:53 +0000 (UTC) Subject: Re: [python][patch] PR python/19151 Hardware breakpoints in GDB Python. To: Phil Muldoon , "gdb-patches@sourceware.org" References: <12c35b5f-aa8d-17b3-476d-2fbf4eb3587d@redhat.com> <68969e58-85d9-5cb7-d2a5-14930d08f799@redhat.com> From: Pedro Alves Message-ID: Date: Wed, 09 May 2018 14:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <68969e58-85d9-5cb7-d2a5-14930d08f799@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00196.txt.bz2 Hi Phil, I agree with Eli, this should be mentioned in NEWS, as all Python API additions/changes do. Some nits below, but otherwise looks fine. Please post a v2 with a NEWS entry, including the proposed git commit log, and it should be good to go. On 04/30/2018 01:37 PM, Phil Muldoon wrote: > > 2018-04-30 Phil Muldoon > > PR python/19151 > * python/py-breakpoint.c: Add hardware breakpoint constant > gdb.BP_HARDWARE_BREAKPOINT. Mention "(pybp_codes)": * python/py-breakpoint.c (pybp_codes): Add hardware breakpoint constant gdb.BP_HARDWARE_BREAKPOINT. > (bppy_init): Add bp_hardware_breakpoint case. Use the enum bptype > variable Double space after '.' and missing '.' at end of second sentence. > --- a/gdb/testsuite/gdb.python/py-breakpoint.exp > +++ b/gdb/testsuite/gdb.python/py-breakpoint.exp > @@ -681,6 +681,33 @@ proc_with_prefix test_bkpt_qualified {} { > "-q in spec string and qualified false" > } > > +# Test hardware assisted breakpoints > +proc_with_prefix test_hardware_breakpoints { } { > + global srcfile testfile decimal > + > + # Start with a fresh gdb. > + clean_restart ${testfile} > + > + if {[skip_hw_breakpoint_tests]} { > + unsupported "Hardware breakpoints." Missing "return" > + } > + > + if ![runto_main] then { > + fail "cannot run to main." > + return 0 > + } > + > + set hardware_location [gdb_get_line_number "Break at multiply."] > + gdb_test "python hbp = gdb.Breakpoint (\"$hardware_location\", type=gdb.BP_HARDWARE_BREAKPOINT)" \ ^^ spurious double space. > + ".*Hardware assisted breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\." \ Leading ".*" not necessary, it's implied. > + "Set hardware breakpoint" Lowercase "Set". > + gdb_continue_to_breakpoint "Break at multiply." \ > + ".*$srcfile:$hardware_location.*" Leading ".*" not necessary, it's implied. > + gdb_test "info breakpoints" \ > + "2.*hw breakpoint.*$srcfile:$hardware_location.*" \ > + "Check info breakpoints shows a hardware breakpoint" Lowercase "Check". I'd remove "check, even, since all tests are checking something: "info breakpoints shows a hardware breakpoint" Thanks, Pedro Alves