From 32af040ef2fcbeccf746acef230db826fad951f9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 15 Oct 2024 10:50:01 -0600 Subject: Require a command argument in gdb.execute_mi Hannes pointed out that gdb.execute_mi() will crash. This patch fixes the bug. Reviewed-By: Guinevere Larsen --- gdb/testsuite/gdb.python/py-exec-mi.exp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/testsuite/gdb.python') diff --git a/gdb/testsuite/gdb.python/py-exec-mi.exp b/gdb/testsuite/gdb.python/py-exec-mi.exp index 8a5d0c9..6b81644 100644 --- a/gdb/testsuite/gdb.python/py-exec-mi.exp +++ b/gdb/testsuite/gdb.python/py-exec-mi.exp @@ -30,3 +30,7 @@ gdb_test_no_output "python gdb.execute_mi('-exec-arguments', 'a', 'b', 'c')" \ "set arguments" gdb_test "show args" ".*\"a b c\"." + +# Ensure that this causes an error, not a crash. +gdb_test "python gdb.execute_mi()" \ + "Error occurred in Python: gdb.execute_mi requires command argument" -- cgit v1.1