+2020-06-30 Philippe Waroquiers <philippe.waroquiers@skynet.be>
+
+ * gdb.python/py-breakpoint.exp: use gdb_test_multiline instead
+ of gdb_py_test_multiple.
+ * gdb.python/py-cmd.exp: Likewise.
+ * gdb.python/py-events.exp: Likewise.
+ * gdb.python/py-function.exp: Likewise.
+ * gdb.python/py-inferior.exp: Likewise.
+ * gdb.python/py-infthread.exp: Likewise.
+ * gdb.python/py-linetable.exp: Likewise.
+ * gdb.python/py-parameter.exp: Likewise.
+ * gdb.python/py-value.exp: Likewise.
+
2020-06-30 Tom de Vries <tdevries@suse.de>
PR testsuite/26175
}
delete_breakpoints
- gdb_py_test_multiple "Sub-class a breakpoint" \
+ gdb_test_multiline "Sub-class a breakpoint" \
"python" "" \
"class bp_eval (gdb.Breakpoint):" "" \
" inf_i = 0" "" \
" return False" "" \
"end" ""
- gdb_py_test_multiple "Sub-class a second breakpoint" \
+ gdb_test_multiline "Sub-class a second breakpoint" \
"python" "" \
"class bp_also_eval (gdb.Breakpoint):" "" \
" count = 0" "" \
" return False" "" \
"end" ""
- gdb_py_test_multiple "Sub-class a third breakpoint" \
+ gdb_test_multiline "Sub-class a third breakpoint" \
"python" "" \
"class basic (gdb.Breakpoint):" "" \
" count = 0" "" \
"Set breakpoint" 0
gdb_py_test_silent_cmd "python eval_bp2.condition = \"1==1\"" \
"Set a condition" 0
- gdb_py_test_multiple "Construct an eval function" \
+ gdb_test_multiline "Construct an eval function" \
"python" "" \
"def stop_func ():" "" \
" return True" "" \
gdb_test "python print (check_eval.count)" "1" \
"Test that evaluate function is run when location also has normal bp"
- gdb_py_test_multiple "Sub-class a watchpoint" \
+ gdb_test_multiline "Sub-class a watchpoint" \
"python" "" \
"class wp_eval (gdb.Breakpoint):" "" \
" def stop (self):" "" \
}
delete_breakpoints
- gdb_py_test_multiple "Sub-class and check temporary breakpoint" \
+ gdb_test_multiline "Sub-class and check temporary breakpoint" \
"python" "" \
"class temp_bp (gdb.Breakpoint):" "" \
" count = 0" "" \
clean_restart ${testfile}
- gdb_py_test_multiple "Create event handler" \
+ gdb_test_multiline "Create event handler" \
"python" "" \
"def note_event(arg):" "" \
" global last_bp_event" "" \
# Test a simple command.
-gdb_py_test_multiple "input simple command" \
+gdb_test_multiline "input simple command" \
"python" "" \
"class test_cmd (gdb.Command):" "" \
" def __init__ (self):" "" \
# Test a prefix command, and a subcommand within it.
-gdb_py_test_multiple "input prefix command" \
+gdb_test_multiline "input prefix command" \
"python" "" \
"class prefix_cmd (gdb.Command):" "" \
" def __init__ (self):" "" \
gdb_test "prefix_cmd ugh" "prefix_cmd output, arg = ugh" "call prefix command"
-gdb_py_test_multiple "input subcommand" \
+gdb_test_multiline "input subcommand" \
"python" "" \
"class subcmd (gdb.Command):" "" \
" def __init__ (self):" "" \
# Test prefix command using keyword arguments.
-gdb_py_test_multiple "input prefix command, keyword arguments" \
+gdb_test_multiline "input prefix command, keyword arguments" \
"python" "" \
"class prefix_cmd2 (gdb.Command):" "" \
" def __init__ (self):" "" \
gdb_test "prefix_cmd2 argh" "prefix_cmd2 output, arg = argh" "call prefix command, keyword arguments"
-gdb_py_test_multiple "input subcommand under prefix_cmd2" \
+gdb_test_multiline "input subcommand under prefix_cmd2" \
"python" "" \
"class subcmd (gdb.Command):" "" \
" def __init__ (self):" "" \
# Test a subcommand in an existing GDB prefix.
-gdb_py_test_multiple "input new subcommand" \
+gdb_test_multiline "input new subcommand" \
"python" "" \
"class newsubcmd (gdb.Command):" "" \
" def __init__ (self):" "" \
# Test a command that throws gdb.GdbError.
-gdb_py_test_multiple "input command to throw error" \
+gdb_test_multiline "input command to throw error" \
"python" "" \
"class test_error_cmd (gdb.Command):" "" \
" def __init__ (self):" "" \
"string_to_argv ('1\\ 2 3')"
# Test user-defined python commands.
-gdb_py_test_multiple "input simple user-defined command" \
+gdb_test_multiline "input simple user-defined command" \
"python" "" \
"class test_help (gdb.Command):" "" \
" \"\"\"Docstring\"\"\"" "" \
"don't show user-defined python command in `show user command`"
# Test expression completion on fields
-gdb_py_test_multiple "expression completion command" \
+gdb_test_multiline "expression completion command" \
"python" "" \
"class expr_test (gdb.Command):" "" \
" def __init__ (self):" "" \
# Test that interrupting pagination throws a gdb quit.
gdb_test_no_output "set height 10"
-gdb_py_test_multiple "input multi-line-output command" \
+gdb_test_multiline "input multi-line-output command" \
"python" "" \
"class test_mline (gdb.Command):" "" \
" \"\"\"Docstring\"\"\"" "" \
# Test before_prompt event.
-gdb_py_test_multiple "define new user command" \
+gdb_test_multiline "define new user command" \
"define xxz" "End with a line saying just .end.." \
"set variable \$x = 72" "" \
"set variable \$y = 93" "" \
"end" ""
-gdb_py_test_multiple "add before_prompt listener" \
+gdb_test_multiline "add before_prompt listener" \
"python" "" \
"count = 0" "" \
"def listener():" "" \
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
-gdb_py_test_multiple "input convenience function" \
+gdb_test_multiline "input convenience function" \
"python" "" \
"class test_func (gdb.Function):" "" \
" def __init__ (self):" "" \
# Test returning a gdb.Value from the function. This segfaulted GDB at one point.
-gdb_py_test_multiple "input value-returning convenience function" \
+gdb_test_multiline "input value-returning convenience function" \
"python" "" \
"class Double (gdb.Function):" "" \
" def __init__ (self):" "" \
gdb_test "print \$double (1)" "= 2" "call value-returning function, language = $lang"
}
-gdb_py_test_multiple "input int-returning function" \
+gdb_test_multiline "input int-returning function" \
"python" "" \
"class Yes(gdb.Function):" "" \
" def __init__(self):" "" \
gdb_test "print \$yes() && \$yes()" " = 1" "call yes with &&"
gdb_test "print \$yes() || \$yes()" " = 1" "call yes with ||"
-gdb_py_test_multiple "Test GDBError" \
+gdb_test_multiline "Test GDBError" \
"python" "" \
"class GDBError(gdb.Function):" "" \
" def __init__(self):" "" \
gdb_test "print \$gdberror()" "This is a GdbError.*" \
"Test GdbError. There should not be a stack trace"
-gdb_py_test_multiple "Test Normal Error" \
+gdb_test_multiline "Test Normal Error" \
"python" "" \
"class NormalError(gdb.Function):" "" \
" def __init__(self):" "" \
gdb_test "print \$normalerror()" "Traceback.*File.*line 5.*in invoke.*RuntimeError.*This is a Normal Error.*" \
"Test a Runtime error. There should be a stack trace."
-gdb_py_test_multiple "input command-calling function" \
+gdb_test_multiline "input command-calling function" \
"python" "" \
"class CallCommand(gdb.Function):" "" \
" def __init__(self):" "" \
gdb_test "python print (inf_list\[0\].is_valid())" "True" \
"check inferior validity 1"
- gdb_py_test_multiple "install new inferior event handler" \
+ gdb_test_multiline "install new inferior event handler" \
"python" "" \
"my_inferior_count = 1" "" \
"def new_inf_handler(evt):" "" \
" my_inferior_count = my_inferior_count + 1" "" \
"gdb.events.new_inferior.connect(new_inf_handler)" "" \
"end" ""
- gdb_py_test_multiple "install inferior deleted event handler" \
+ gdb_test_multiline "install inferior deleted event handler" \
"python" "" \
"def del_inf_handler(evt):" "" \
" global my_inferior_count" "" \
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
-gdb_py_test_multiple "install new_thread event handler" \
+gdb_test_multiline "install new_thread event handler" \
"python" "" \
"seen_a_thread = False" "" \
"def thread_handler(evt):" "" \
gdb_py_test_silent_cmd "python lt = gdb.selected_frame().find_sal().symtab.linetable()" \
"get instruction" 0
-gdb_py_test_multiple "input simple command" \
+gdb_test_multiline "input simple command" \
"python" "" \
"def list_lines():" "" \
" for l in lt:" "" \
# Test a simple boolean parameter.
with_test_prefix "boolean parameter" {
- gdb_py_test_multiple "Simple gdb booleanparameter" \
+ gdb_test_multiline "Simple gdb booleanparameter" \
"python" "" \
"class TestParam (gdb.Parameter):" "" \
" \"\"\"When enabled, test param does something useful. When disabled, does nothing.\"\"\"" "" \
# Test an enum parameter.
with_test_prefix "enum parameter" {
- gdb_py_test_multiple "enum gdb parameter" \
+ gdb_test_multiline "enum gdb parameter" \
"python" "" \
"class TestEnumParam (gdb.Parameter):" "" \
" \"\"\"When set, test param does something useful. When disabled, does nothing.\"\"\"" "" \
# Test a file parameter.
with_test_prefix "file parameter" {
- gdb_py_test_multiple "file gdb parameter" \
+ gdb_test_multiline "file gdb parameter" \
"python" "" \
"class TestFileParam (gdb.Parameter):" "" \
" \"\"\"When set, test param does something useful. When disabled, does nothing.\"\"\"" "" \
# Test a parameter that is not documented.
with_test_prefix "undocumented parameter" {
- gdb_py_test_multiple "Simple gdb booleanparameter" \
+ gdb_test_multiline "Simple gdb booleanparameter" \
"python" "" \
"class TestUndocParam (gdb.Parameter):" "" \
" def get_show_string (self, pvalue):" ""\
# Test a parameter that is not documented in any way..
with_test_prefix "really undocumented parameter" {
- gdb_py_test_multiple "Simple gdb booleanparameter" \
+ gdb_test_multiline "Simple gdb booleanparameter" \
"python" "" \
"class TestNodocParam (gdb.Parameter):" "" \
" def __init__ (self, name):" "" \
# Test deprecated API. Do not use in your own implementations.
with_test_prefix "deprecated API parameter" {
- gdb_py_test_multiple "Simple gdb booleanparameter" \
+ gdb_test_multiline "Simple gdb booleanparameter" \
"python" "" \
"class TestParam (gdb.Parameter):" "" \
" \"\"\"When enabled, test param does something useful. When disabled, does nothing.\"\"\"" "" \
}
foreach kind {PARAM_ZUINTEGER PARAM_ZUINTEGER_UNLIMITED} {
- gdb_py_test_multiple "Simple gdb $kind" \
+ gdb_test_multiline "Simple gdb $kind" \
"python" "" \
"class TestNodocParam (gdb.Parameter):" "" \
" def __init__ (self, name):" "" \
}
}
-gdb_py_test_multiple "Throwing gdb parameter" \
+gdb_test_multiline "Throwing gdb parameter" \
"python" "" \
"class TestThrowParam (gdb.Parameter):" "" \
" def __init__ (self, name):" "" \
proc test_value_boolean {} {
# First, define a useful function to test booleans.
- gdb_py_test_multiple "define function to test booleans" \
+ gdb_test_multiline "define function to test booleans" \
"python" "" \
"def test_bool (val):" "" \
" if val:" "" \
# Test that values are hashable.
proc test_value_hash {} {
- gdb_py_test_multiple "Simple Python value dictionary" \
+ gdb_test_multiline "Simple Python value dictionary" \
"python" "" \
"one = gdb.Value(1)" "" \
"two = gdb.Value(2)" "" \