From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66261 invoked by alias); 26 Jan 2016 12:23:09 -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 66250 invoked by uid 89); 26 Jan 2016 12:23:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=delegate, Hx-languages-length:1654, sk:py-brea, sk:pybrea X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 26 Jan 2016 12:23:07 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0C1991168D6; Tue, 26 Jan 2016 07:23:06 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id azD2butlmAiE; Tue, 26 Jan 2016 07:23:05 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A640B1168C9; Tue, 26 Jan 2016 07:23:05 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A150840C2A; Tue, 26 Jan 2016 16:22:56 +0400 (RET) Date: Tue, 26 Jan 2016 12:23:00 -0000 From: Joel Brobecker To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] python/19506 -- gdb.Breakpoint address location regression Message-ID: <20160126122256.GH5146@adacore.com> References: <1453413926-24995-1-git-send-email-keiths@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453413926-24995-1-git-send-email-keiths@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2016-01/txt/msg00647.txt.bz2 Hi Keith, On Thu, Jan 21, 2016 at 02:05:26PM -0800, Keith Seitz wrote: > When the locations API was committed, it assumed that all valid > arguments to the gdb.Breakpoint command were a linespec (aside from > keywords describing various breakpoint properties). However, address > locations are a separate class of locations which were overlooked by my > patch. > > This patch introduces a new function analogous to the CLI function > string_to_event_location. This new function only handles address and > linespec locations. I have made no attempt to fully implement explicit > locations. > > This patch fixes python/19506: > > (gdb) python gdb.Breakpoint("*main") > Traceback (most recent call last): > File "", line 1, in > RuntimeError: Function "*main" not defined. > Error while executing Python code. > > Now: > > (gdb) python gdb.Breakpoint("*main") > Breakpoint 1 at 0x4005fb: file ../../../src/gdb/testsuite/gdb.python/py-breakpoint.c, line 32. > > gdb/ChangeLog > > * python/py-breakpoint.c (python_string_to_event_location): New > function. > (bppy_init): Use python_string_to_event_location instead of > new_linespec_location. > > gdb/testsuite/gdb.python > > * gdb.python/py-breakpoint.exp (test_bkpt_address): New proc. > (toplevel): Call test_bkpt_address. Silly question, but does this work with " *main" (extra leading space)? It's too bad you have to explicitly check for '*' in the string. Perhaps we should delegate that part to the linespec module? Perhaps other areas might want to have the same (eg. the guile breakpoint module). -- Joel