This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Use string_to_event_location_basic in guile.
- From: Keith Seitz <kseitz at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 9 Feb 2016 22:36:59 -0000
- Subject: [binutils-gdb] Use string_to_event_location_basic in guile.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a96e36da2f5278949099b0b985b2fa6ce474b135
commit a96e36da2f5278949099b0b985b2fa6ce474b135
Author: Keith Seitz <keiths@redhat.com>
Date: Tue Feb 9 10:02:53 2016 -0800
Use string_to_event_location_basic in guile.
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.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/guile/scm-breakpoint.c | 4 ++--
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.guile/scm-breakpoint.exp | 13 +++++++++++++
4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 64fc796..f7591ff 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2016-02-09 Keith Seitz <keiths@redhat.com>
+ * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Skip
+ leading whitespace and use string_to_event_location_basic instead
+ of new_linespec_location.
+
+2016-02-09 Keith Seitz <keiths@redhat.com>
+
PR python/19506
* python/py-breakpoint.c (bppy_init): Use
string_to_event_location_basic instead of new_linespec_location.
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/ChangeLog b/gdb/testsuite/ChangeLog
index 38f1fc5..c4e082a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2016-02-09 Keith Seitz <keiths@redhat.com>
+ * gdb.guile/scm-breakpoint.exp (test_bkpt_address): New procedure.
+ (toplevel): Call test_bkpt_address.
+
+2016-02-09 Keith Seitz <keiths@redhat.com>
+
PR python/19506
* gdb.python/py-breakpoint.exp (test_bkpt_address): New procedure.
(toplevel): Call test_bkpt_address.
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