Fix scripted probe breakpoints
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.guile / scm-breakpoint.exp
index 542a40fda409001a462e7abaa92d45423129e038..183ad1671f5997706421c91eb3a6191d28f77189 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# Copyright (C) 2010-2019 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@ load_lib gdb-guile.exp
 
 standard_testfile
 
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
@@ -487,6 +487,40 @@ 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)+\."
+}
+
+proc test_bkpt_probe {} {
+    global decimal hex testfile srcfile
+
+    if { [prepare_for_testing "failed to prepare" ${testfile}-probes \
+           ${srcfile} {additional_flags=-DUSE_PROBES}] } {
+       return -1
+    }
+
+    if ![gdb_guile_runto_main] then {
+       return
+    }
+
+    gdb_scm_test_silent_cmd \
+       "guile (define bp1 (make-breakpoint \"-probe test:result_updated\"))" \
+       "create probe breakpoint"
+
+    gdb_test \
+       "guile (register-breakpoint! bp1)" \
+       "Breakpoint $decimal at $hex" \
+       "register probe breakpoint"
+}
+
 test_bkpt_basic
 test_bkpt_deletion
 test_bkpt_cond_and_cmds
@@ -495,3 +529,5 @@ test_watchpoints
 test_bkpt_internal
 test_bkpt_eval_funcs
 test_bkpt_registration
+test_bkpt_address
+test_bkpt_probe
This page took 0.025942 seconds and 4 git commands to generate.