From patchwork Mon Feb 1 22:10:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 10693 Received: (qmail 26844 invoked by alias); 1 Feb 2016 22:10:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 26762 invoked by uid 89); 1 Feb 2016 22:10:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2005, sk:test_wa, sk:test_bk, gdb.guile X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 01 Feb 2016 22:10:11 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 9FBBA5A4A for ; Mon, 1 Feb 2016 22:10:09 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11MA8VA021810 for ; Mon, 1 Feb 2016 17:10:09 -0500 Subject: [PATCH V2 3/4] Use string_to_event_location_basic in guile. From: Keith Seitz To: gdb-patches@sourceware.org Date: Mon, 01 Feb 2016 14:10:08 -0800 Message-ID: <20160201221008.1415.18385.stgit@valrhona.uglyboxes.com> In-Reply-To: <20160201220928.1415.59039.stgit@valrhona.uglyboxes.com> References: <20160201220928.1415.59039.stgit@valrhona.uglyboxes.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes This patch, analogous to the previous python patch, implements proper legacy linespec support in guile code using the newly introduced string_to_event_location_basic. gdb/ChangeLog * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Skip leading whitespace and use string_to_event_location_basic instead of new_linespec_location. gdb/testsuite/ChangeLog * gdb.guile/scm-breakpoint.exp (test_bkpt_address): New procedure. (toplevel): Call test_bkpt_address. --- gdb/guile/scm-breakpoint.c | 4 ++-- gdb/testsuite/gdb.guile/scm-breakpoint.exp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c index 716fe4c..baecf01 100644 --- a/gdb/guile/scm-breakpoint.c +++ b/gdb/guile/scm-breakpoint.c @@ -425,8 +425,8 @@ gdbscm_register_breakpoint_x (SCM self) pending_breakpoint_scm = self; location = bp_smob->spec.location; - copy = location; - eloc = new_linespec_location (©); + copy = skip_spaces (location); + eloc = string_to_event_location_basic (©, current_language); cleanup = make_cleanup_delete_event_location (eloc); TRY diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp index 542a40f..33edf86 100644 --- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp +++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp @@ -487,6 +487,18 @@ proc test_bkpt_registration {} { } } +proc test_bkpt_address {} { + global decimal srcfile + + # Leading whitespace is intentional! + gdb_scm_test_silent_cmd \ + "guile (define bp1 (make-breakpoint \" *multiply\"))" \ + "create address breakpoint a ' *multiply'" 1 + + gdb_test "guile (register-breakpoint! bp1)" \ + ".*Breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\." +} + test_bkpt_basic test_bkpt_deletion test_bkpt_cond_and_cmds @@ -495,3 +507,4 @@ test_watchpoints test_bkpt_internal test_bkpt_eval_funcs test_bkpt_registration +test_bkpt_address