Use string_to_event_location_basic in guile.
authorKeith Seitz <keiths@redhat.com>
Tue, 9 Feb 2016 18:02:53 +0000 (10:02 -0800)
committerKeith Seitz <keiths@redhat.com>
Tue, 9 Feb 2016 22:29:21 +0000 (14:29 -0800)
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/ChangeLog
gdb/guile/scm-breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.guile/scm-breakpoint.exp

index 64fc796668272fa9ac04a739435477447b47db74..f7591ff192f93155941ef8c79ae6d37f8a0c7003 100644 (file)
@@ -1,3 +1,9 @@
+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
index 716fe4cbe8e69b8e55a3c07500d1a45508127a84..baecf011d16f3530f7627d946748835d53ef2854 100644 (file)
@@ -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);
+  copy = skip_spaces (location);
+  eloc = string_to_event_location_basic (&copy, current_language);
   cleanup = make_cleanup_delete_event_location (eloc);
 
   TRY
index 38f1fc5e8e3c00aae94be4a47288cb08a7eebf1b..c4e082a23a47d1b24c15dacc6ce6d3681c90d74d 100644 (file)
@@ -1,3 +1,8 @@
+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
index 542a40fda409001a462e7abaa92d45423129e038..33edf86b7f64a58e3a10871cf16d15696c463fbe 100644 (file)
@@ -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