GDBMI_var_set_visualizer.st
changeset 112 a8138ced2f5e
parent 91 472a4841a8b6
child 259 651864c2aa29
--- a/GDBMI_var_set_visualizer.st	Wed Feb 07 12:07:19 2018 +0000
+++ b/GDBMI_var_set_visualizer.st	Fri Feb 09 10:16:01 2018 +0000
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
 jv:libgdbs - GNU Debugger Interface Library
 Copyright (C) 2015-now Jan Vrany
@@ -48,6 +50,44 @@
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 "
+!
+
+documentation
+"
+Synopsis
+
+ -var-set-visualizer name visualizer
+
+Set a visualizer for the variable object name.
+
+visualizer is the visualizer to use. The special value ‘None’ means to disable any visualizer in use.
+
+If not ‘None’, visualizer must be a Python expression. This expression must evaluate to a callable object which accepts a single argument. GDB will call this object with the value of the varobj 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 (see Pretty Printing API).
+
+The pre-defined function gdb.default_visualizer may be used to select a visualizer by following the built-in process (see 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 -list-features (see GDB/MI Support Commands) can be used to check this.
+Example
+
+Resetting the visualizer:
+
+(gdb)
+-var-set-visualizer V None
+^done
+
+Reselecting the default (type-based) visualizer:
+
+(gdb)
+-var-set-visualizer V gdb.default_visualizer
+^done
+
+Suppose SomeClass is a visualizer class. A lambda expression can be used to instantiate this class for a varobj:
+
+(gdb)
+-var-set-visualizer V 'lambda val: SomeClass()'
+^done
+
+"
 ! !
 
 !GDBMI_var_set_visualizer methodsFor:'accessing'!