Lines Matching refs:Python
15 # Test custom MI commands implemented in Python.
17 load_lib gdb-python.exp
26 if {[lsearch -exact [mi_get_features] python] < 0} {
27 unsupported "python support is disabled"
33 mi_gdb_test "set python print-stack full" \
35 "set python print-stack full"
39 "load python file"
41 mi_gdb_test "python pycmd1('-pycmd')" \
64 "\\^error,msg=\"Error occurred in Python: non-string object used as key: Bad Key\"" \
68 "\\^error,msg=\"Error occurred in Python: non-string object used as key: 1\"" \
74 "\\^error,msg=\"Error occurred in Python: __repr__ returned non-string \\(type BadKey\\)\""] \
100 "\\^error,msg=\"Error occurred in Python: Result from invoke must be a dictionary\""
109 "\\^error,msg=\"Error occurred in Python: Invalid key in MI result: ${pattern}\""
113 "\\^error,msg=\"Error occurred in Python: Invalid empty key in MI result\""
138 [string_to_regexp {^error,msg="Error occurred in Python."}]
145 # With python <= 3.12.
154 # With python >= 3.13.
164 mi_gdb_test "python pycmd2('-pycmd')" \
178 "Define new command -pycmd-new MI command from Python MI command"
182 "redefine -pycmd MI command from Python MI command"
192 mi_gdb_test "python pycmd1('')" \
193 ".*&\"ValueError.*: MI command name is empty\\...\".*\\^error,msg=\"Error occurred in Python.*\"" \
196 mi_gdb_test "python pycmd1('-')" \
200 "&\"Error occurred in Python.*..\"" \
201 "\\^error,msg=\"Error occurred in Python.*\""] \
204 mi_gdb_test "python pycmd1('-bad-character-@')" \
208 "&\"Error occurred in Python.*..\"" \
209 "\\^error,msg=\"Error occurred in Python.*\""] \
212 mi_gdb_test "python cmd=pycmd1('-abc')" \
214 "create command -abc, stored in a python variable"
216 mi_gdb_test "python print(cmd.name)" \
220 mi_gdb_test "python print(cmd.installed)" \
228 mi_gdb_test "python cmd.installed = False" \
236 mi_gdb_test "python cmd.installed = None" \
237 ".*\r\n\\^error,msg=\"Error occurred in Python: gdb\\.MICommand\\.installed must be set to a bool, not None\"" \
240 mi_gdb_test "python cmd.installed = 1" \
241 ".*\r\n\\^error,msg=\"Error occurred in Python: gdb\\.MICommand\\.installed must be set to a bool, not int\"" \
244 mi_gdb_test "python print(cmd.installed)" \
251 mi_gdb_test "python cmd.installed = True" \
259 mi_gdb_test "python other=pycmd2('-abc')" \
261 "create another command called -abc, stored in a separate python variable"
263 mi_gdb_test "python print(other.installed)" \
267 mi_gdb_test "python print(cmd.installed)" \
275 mi_gdb_test "python cmd.installed = True" \
283 mi_gdb_test "python print(other.installed)" \
287 mi_gdb_test "python print(cmd.installed)" \
291 mi_gdb_test "python aa = pycmd3('-aa', 'message one', 'xxx')" \
299 mi_gdb_test "python aa.__init__('-aa', 'message two', 'yyy')" \
307 mi_gdb_test "python aa.__init__('-bb', 'message three', 'zzz')" \
311 "&\"Error occurred in Python.*..\"" \
312 "\\^error,msg=\"Error occurred in Python.*\""] \
319 mi_gdb_test "python aa.installed = False" \
323 mi_gdb_test "python aa.__init__('-bb', 'message three', 'zzz')" \
327 "&\"Error occurred in Python.*..\"" \
328 "\\^error,msg=\"Error occurred in Python.*\""] \
331 mi_gdb_test "python aa.__init__('-aa', 'message three', 'zzz')" \
335 mi_gdb_test "python aa.installed = True" \
346 mi_gdb_test "python no_invoke('-no-invoke')" ".*\\^done" \
352 "\\^error,msg=\"Error occurred in Python: 'no_invoke' object has no attribute 'invoke'\""] \
356 mi_gdb_test "python setattr(no_invoke, 'invoke', free_invoke)" ".*\\^done"
357 mi_gdb_test "python cmd = no_invoke('-hello')" ".*\\^done"
360 mi_gdb_test "python delattr(no_invoke, 'invoke')" ".*\\^done"
365 "\\^error,msg=\"Error occurred in Python: 'no_invoke' object has no attribute 'invoke'\""] \
367 mi_gdb_test "python cmd.invoke = 'string'" ".*\\^done"
372 "\\^error,msg=\"Error occurred in Python: 'str' object is not callable\""] \
376 mi_gdb_test "python cmd = pycmd2('-data-disassemble')" \
380 "&\"Error occurred in Python.*..\"" \
381 "\\^error,msg=\"Error occurred in Python.*\""] \
386 mi_gdb_test "python run_exception_tests()" \