diff options
author | Tom Tromey <tromey@redhat.com> | 2009-05-28 01:09:20 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-05-28 01:09:20 +0000 |
commit | b6313243984b74ee6772dd8273b0e6073ad1815b (patch) | |
tree | 79db018823e681990855f3c379c40e2cc7de9f6e /gdb/doc | |
parent | a6bac58e84001d33b9540e208e9ca6d6ab265bf3 (diff) | |
download | gdb-b6313243984b74ee6772dd8273b0e6073ad1815b.zip gdb-b6313243984b74ee6772dd8273b0e6073ad1815b.tar.gz gdb-b6313243984b74ee6772dd8273b0e6073ad1815b.tar.bz2 |
gdb
2009-05-27 Vladimir Prus <vladimir@codesourcery.com>
Tom Tromey <tromey@redhat.com>
Thiago Jung Bauermann <bauerman@br.ibm.com>
* mi/mi-main.c (mi_cmd_list_features): List "python" feature.
* varobj.h (varobj_set_visualizer): Declare.
(varobj_get_display_hint): Likewise.
(varobj_update_result_t) <children_changed, value_installed>: New
fields.
* mi/mi-cmds.c (mi_cmds): Add var-set-visualizer.
* mi/mi-cmds.h (mi_cmd_var_set_visualizer,
mi_cmd_var_set_child_range): Declare.
* mi/mi-cmd-var.c (mi_cmd_var_set_visualizer): New function.
(mi_cmd_var_list_children): Emit display hint.
(varobj_update_one): Emit display hint. Handle dynamic children.
* python/python.c (GdbMethods): Add "default_visualizer".
* python/python-internal.h (apply_varobj_pretty_printer,
gdbpy_get_varobj_pretty_printer, gdbpy_get_display_hint):
Declare.
(gdbpy_default_visualizer): Likewise.
* varobj.c: Include python.h, python-internal.h.
(PyObject): New typedef.
(struct varobj) <children_requested, pretty_printer>: New fields.
(varobj_create): Call install_default_visualizer.
(instantiate_pretty_printer): New function.
(varobj_set_display_format): Update.
(varobj_get_display_hint): New function.
(update_dynamic_varobj_children): New function.
(varobj_get_num_children): Handle dynamic children.
(varobj_list_children): Likewise.
(install_new_value): Likewise.
(varobj_add_child): New function.
(install_visualizer): Likewise.
(install_default_visualizer): Likewise.
(varobj_set_visualizer): Likewise.
(varobj_update): Handle dynamic children.
(create_child): Use create_child_with_value.
(create_child_with_value): New function.
(value_get_print_value): Call pretty printer. Add value_formatter
argument.
(c_value_of_variable): Update.
(varobj_invalidate): Always free all_rootvarobj.
* python/python-prettyprint.c (apply_varobj_pretty_printer): New
function.
(gdbpy_get_varobj_pretty_printer): Likewise.
(gdbpy_default_visualizer): Likewise.
gdb/doc
2009-05-27 Tom Tromey <tromey@redhat.com>
* gdb.texinfo (GDB/MI Miscellaneous Commands): Document "python"
feature.
(GDB/MI Variable Objects): Document -var-set-visualizer.
gdb/testsuite
2009-05-27 Tom Tromey <tromey@redhat.com>
Thiago Jung Bauermann <bauerman@br.ibm.com>
* lib/mi-support.exp (mi_varobj_update_dynamic): New proc.
(mi_child_regexp): Likewise.
(mi_list_varobj_children_range): Likewise.
(mi_get_features): Likewise.
(mi_list_varobj_children): Rewrite.
* gdb.python/python-mi.exp: New file.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 62 |
2 files changed, 74 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 2e28f37..95c9e66 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,4 +1,16 @@ 2009-05-27 Tom Tromey <tromey@redhat.com> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Document "python" + feature. + (GDB/MI Variable Objects): Document -var-set-visualizer. + +2009-04-02 Tom Tromey <tromey@redhat.com> + + * gdb.texinfo (GDB/MI Miscellaneous Commands): Document "python" + feature. + (GDB/MI Variable Objects): Document -var-set-visualizer. + +2009-05-27 Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> Phil Muldoon <pmuldoon@redhat.com> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 45e580c..971ed04 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -23442,6 +23442,64 @@ Unfreezing a variable does not update it, only subsequent (gdb) @end smallexample +@subheading The @code{-var-set-visualizer} command +@findex -var-set-visualizer +@anchor{-var-set-visualizer} + +@subsubheading Synopsis + +@smallexample + -var-set-visualizer @var{name} @var{visualizer} +@end smallexample + +Set a visualizer for the variable object @var{name}. + +@var{visualizer} is the visualizer to use. The special value +@samp{None} means to disable any visualizer in use. + +If not @samp{None}, @var{visualizer} must be a Python expression. +This expression must evaluate to a callable object which accepts a +single argument. @value{GDBN} will call this object with the value of +the varobj @var{name} as an argument (this is done so that the same +Python pretty-printing code can be used for both the CLI and MI). +When called, this object must return an object which conforms to the +pretty-printing interface (@pxref{Pretty Printing}). + +The pre-defined function @code{gdb.default_visualizer} may be used to +select a visualizer by following the built-in process +(@pxref{Selecting Pretty-Printers}). This is done automatically when +a varobj is created, and so ordinarily is not needed. + +This feature is only available if Python support is enabled. The MI +command @code{-list-features} (@pxref{GDB/MI Miscellaneous Commands}) +can be used to check this. + +@subsubheading Example + +Resetting the visualizer: + +@smallexample +(gdb) +-var-set-visualizer V None +^done +@end smallexample + +Reselecting the default (type-based) visualizer: + +@smallexample +(gdb) +-var-set-visualizer V gdb.default_visualizer +^done +@end smallexample + +Suppose @code{SomeClass} is a visualizer class. A lambda expression +can be used to instantiate this class for a varobj: + +@smallexample +(gdb) +-var-set-visualizer V "lambda val: SomeClass()" +^done +@end smallexample @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Data Manipulation @@ -25001,6 +25059,10 @@ as possible presense of the @code{frozen} field in the output of @code{-varobj-create}. @item pending-breakpoints Indicates presence of the @option{-f} option to the @code{-break-insert} command. +@item python +Indicates presence of Python scripting support, Python-based +pretty-printing commands, and possible presence of the +@samp{display_hint} field in the output of @code{-var-list-children} @item thread-info Indicates presence of the @code{-thread-info} command. |