argument as a Python command. For example:
@smallexample
-(@value{GDBP}) python print 23
+(@value{GDBP}) python print(23)
23
@end smallexample
@smallexample
(@value{GDBP}) python
->print 23
+>print(23)
>end
23
@end smallexample
Example:
@smallexample
-(@value{GDBP}) python print foo
+(@value{GDBP}) python print(foo)
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'foo' is not defined
reflect any flags that are temporarily in effect.
@smallexample
-(gdb) python print (gdb.print_options ()['max_elements'])
+(gdb) python print(gdb.print_options ()['max_elements'])
200
@end smallexample
@end defun
Example:
@smallexample
-print gdb.string_to_argv ("1 2\ \\\"3 '4 \"5' \"6 '7\"")
+print(gdb.string_to_argv ("1 2\ \\\"3 '4 \"5' \"6 '7\""))
['1', '2 "3', '4 "5', "6 '7"]
@end smallexample
operator, like:
@smallexample
-(@value{GDBP}) python print gdb.newest_frame() == gdb.selected_frame ()
+(@value{GDBP}) python print(gdb.newest_frame() == gdb.selected_frame ())
True
@end smallexample
(gdb) start
(gdb) python import gdb.types
(gdb) python foo_ref = gdb.parse_and_eval("foo_ref")
-(gdb) python print gdb.types.get_basic_type(foo_ref.type)
+(gdb) python print(gdb.types.get_basic_type(foo_ref.type))
int
@end smallexample
@smallexample
(@value{GDBP}) python import gdb.types
(@value{GDBP}) python struct_a = gdb.lookup_type("struct A")
-(@value{GDBP}) python print struct_a.keys ()
+(@value{GDBP}) python print(struct_a.keys ())
@{['a', '']@}
-(@value{GDBP}) python print [k for k,v in gdb.types.deep_items(struct_a)]
+(@value{GDBP}) python print([k for k,v in gdb.types.deep_items(struct_a)])
@{['a', 'b0', 'b1']@}
@end smallexample