summaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-12-07 17:37:02 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2017-12-07 17:37:02 -0500
commitec72db3ef415ebdcedaf36a1d83bd6624ec063e0 (patch)
treed75361de814c7dc18b1b286d081121f1915ab739 /gdb/testsuite
parent99598d713f45d1b26015ec3562d160dc2b3792e4 (diff)
Fix wrong prefix in py-breakpoint.exp
The prefix in test_bkpt_explicit_loc is wrong. Instead of using with_test_prefix directly, define test_bkpt_explicit_loc with proc_with_prefix. gdb/testsuite/ChangeLog: * gdb.python/py-breakpoint.exp (test_bkpt_explicit_loc): Define with proc_with_prefix, don't use with_test_prefix.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.python/py-breakpoint.exp144
2 files changed, 76 insertions, 73 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index acad3305bf..87ec247129 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-07 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdb.python/py-breakpoint.exp (test_bkpt_explicit_loc): Define
+ with proc_with_prefix, don't use with_test_prefix.
+
2017-12-07 Tom Tromey <tom@tromey.com>
* gdb.base/break.exp: Add test for empty "commands".
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp
index e89b9b8446..699c98fbea 100644
--- a/gdb/testsuite/gdb.python/py-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-breakpoint.exp
@@ -531,83 +531,81 @@ proc_with_prefix test_bkpt_events {} {
check_last_event breakpoint_deleted
}
-proc test_bkpt_explicit_loc {} {
+proc_with_prefix test_bkpt_explicit_loc {} {
global srcfile testfile
- with_test_prefix test_bkpt_invisible {
- # Start with a fresh gdb.
- clean_restart ${testfile}
-
- if ![runto_main] then {
- fail "cannot run to main."
- return 0
- }
+ # Start with a fresh gdb.
+ clean_restart ${testfile}
- delete_breakpoints
-
- set bp_location1 [gdb_get_line_number "Break at multiply."]
- set bp_location2 [gdb_get_line_number "Break at add."]
-
- gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=$bp_location1)" \
- "set explicit breakpoint by line" 0
- gdb_continue_to_breakpoint "break at multiply for explicit line" \
- ".*Break at multiply.*"
-
- gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"+1\")" \
- "set explicit breakpoint by relative line" 0
- gdb_continue_to_breakpoint "break at add for relative line" \
- ".*Break at add.*"
-
- delete_breakpoints
- gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"-1\")" \
- "set explicit breakpoint by relative negative line" 0
- gdb_continue_to_breakpoint "break at multiply for negative line" \
- ".*Break at multiply.*"
-
- delete_breakpoints
- gdb_test "python bp1 = gdb.Breakpoint (line=bp1)" \
- "RuntimeError: Line keyword should be an integer or a string.*" \
- "set explicit breakpoint by invalid line type"
-
- delete_breakpoints
- gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (function=\"add\")" \
- "set explicit breakpoint by function" 0
- gdb_continue_to_breakpoint "break at function add for function" \
- ".*Break at function add.*"
-
- delete_breakpoints
- gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", function=\"add\")" \
- "set explicit breakpoint by source file and function" 0
- gdb_continue_to_breakpoint "break at function add for source and function" \
- ".*Break at function add.*"
-
- delete_breakpoints
- gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"$bp_location2\")" \
- "set explicit breakpoint by source file and line number" 0
- gdb_continue_to_breakpoint "break at add for source and line" \
- ".*Break at add.*"
-
- delete_breakpoints
- gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"-source $srcfile -line $bp_location2\")" \
- "set explicit breakpoint by source file and line number in spec" 0
- gdb_continue_to_breakpoint "break at add for source and line in spec" \
- ".*Break at add.*"
-
- delete_breakpoints
- gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\")" \
- "RuntimeError: Specifying a source must also include a line, label or function.*" \
- "set invalid explicit breakpoint by source only"
-
- gdb_test "python bp1 = gdb.Breakpoint (source=\"foo.c\", line=\"5\")" \
- "No source file named foo.*" \
- "set invalid explicit breakpoint by missing source and line"
- gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"900\")" \
- "No line 900 in file \"$srcfile\".*" \
- "set invalid explicit breakpoint by source and invalid line"
- gdb_test "python bp1 = gdb.Breakpoint (function=\"blah\")" \
- "Function \"blah\" not defined.*" \
- "set invalid explicit breakpoint by missing function"
+ if ![runto_main] then {
+ fail "cannot run to main."
+ return 0
}
+
+ delete_breakpoints
+
+ set bp_location1 [gdb_get_line_number "Break at multiply."]
+ set bp_location2 [gdb_get_line_number "Break at add."]
+
+ gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=$bp_location1)" \
+ "set explicit breakpoint by line" 0
+ gdb_continue_to_breakpoint "break at multiply for explicit line" \
+ ".*Break at multiply.*"
+
+ gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"+1\")" \
+ "set explicit breakpoint by relative line" 0
+ gdb_continue_to_breakpoint "break at add for relative line" \
+ ".*Break at add.*"
+
+ delete_breakpoints
+ gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"-1\")" \
+ "set explicit breakpoint by relative negative line" 0
+ gdb_continue_to_breakpoint "break at multiply for negative line" \
+ ".*Break at multiply.*"
+
+ delete_breakpoints
+ gdb_test "python bp1 = gdb.Breakpoint (line=bp1)" \
+ "RuntimeError: Line keyword should be an integer or a string.*" \
+ "set explicit breakpoint by invalid line type"
+
+ delete_breakpoints
+ gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (function=\"add\")" \
+ "set explicit breakpoint by function" 0
+ gdb_continue_to_breakpoint "break at function add for function" \
+ ".*Break at function add.*"
+
+ delete_breakpoints
+ gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", function=\"add\")" \
+ "set explicit breakpoint by source file and function" 0
+ gdb_continue_to_breakpoint "break at function add for source and function" \
+ ".*Break at function add.*"
+
+ delete_breakpoints
+ gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"$bp_location2\")" \
+ "set explicit breakpoint by source file and line number" 0
+ gdb_continue_to_breakpoint "break at add for source and line" \
+ ".*Break at add.*"
+
+ delete_breakpoints
+ gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"-source $srcfile -line $bp_location2\")" \
+ "set explicit breakpoint by source file and line number in spec" 0
+ gdb_continue_to_breakpoint "break at add for source and line in spec" \
+ ".*Break at add.*"
+
+ delete_breakpoints
+ gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\")" \
+ "RuntimeError: Specifying a source must also include a line, label or function.*" \
+ "set invalid explicit breakpoint by source only"
+
+ gdb_test "python bp1 = gdb.Breakpoint (source=\"foo.c\", line=\"5\")" \
+ "No source file named foo.*" \
+ "set invalid explicit breakpoint by missing source and line"
+ gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"900\")" \
+ "No line 900 in file \"$srcfile\".*" \
+ "set invalid explicit breakpoint by source and invalid line"
+ gdb_test "python bp1 = gdb.Breakpoint (function=\"blah\")" \
+ "Function \"blah\" not defined.*" \
+ "set invalid explicit breakpoint by missing function"
}
test_bkpt_basic