GDBMI_var_create.st
changeset 12 568a2971c977
child 56 20989de12cfb
equal deleted inserted replaced
11:474fbb650afe 12:568a2971c977
       
     1 "{ Package: 'jv:libgdbs' }"
       
     2 
       
     3 GDBMICommand subclass:#GDBMI_var_create
       
     4 	instanceVariableNames:''
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'GDB-Core-Commands-MI'
       
     8 !
       
     9 
       
    10 !GDBMI_var_create class methodsFor:'documentation'!
       
    11 
       
    12 documentation
       
    13 "
       
    14 The `-var-create' Command
       
    15 -------------------------
       
    16 
       
    17 Synopsis
       
    18 ........
       
    19 
       
    20       -var-create {NAME | '-'}
       
    21          {FRAME-ADDR | '*' | '@'} EXPRESSION
       
    22 
       
    23    This operation creates a variable object, which allows the
       
    24 monitoring of a variable, the result of an expression, a memory cell or
       
    25 a CPU register.
       
    26 
       
    27    The NAME parameter is the string by which the object can be
       
    28 referenced.  It must be unique.  If `-' is specified, the varobj system
       
    29 will generate a string 'varNNNNNN' automatically.  It will be unique
       
    30 provided that one does not specify NAME of that format.  The command
       
    31 fails if a duplicate name is found.
       
    32 
       
    33    The frame under which the expression should be evaluated can be
       
    34 specified by FRAME-ADDR.  A `*' indicates that the current frame should
       
    35 be used.  A `@' indicates that a floating variable object must be
       
    36 created.
       
    37 
       
    38    EXPRESSION is any expression valid on the current language set (must
       
    39 not begin with a `*'), or one of the following:
       
    40 
       
    41    * `*ADDR', where ADDR is the address of a memory cell
       
    42 
       
    43    * `*ADDR-ADDR' -- a memory address range (TBD)
       
    44 
       
    45    * `$REGNAME' -- a CPU register name
       
    46 
       
    47    A varobj's contents may be provided by a Python-based
       
    48 pretty-printer.  In this case the varobj is known as a 'dynamic
       
    49 varobj'.  Dynamic varobjs have slightly different semantics in some
       
    50 cases.  If the `-enable-pretty-printing' command is not sent, then {No
       
    51 value for `GDBN'} will never create a dynamic varobj.  This ensures
       
    52 backward compatibility for existing clients.
       
    53 
       
    54 Result
       
    55 ......
       
    56 
       
    57 This operation returns attributes of the newly-created varobj.  These
       
    58 are:
       
    59 
       
    60 `name'
       
    61      The name of the varobj.
       
    62 
       
    63 `numchild'
       
    64      The number of children of the varobj.  This number is not
       
    65      necessarily reliable for a dynamic varobj.  Instead, you must
       
    66      examine the `has_more' attribute.
       
    67 
       
    68 `value'
       
    69      The varobj's scalar value.  For a varobj whose type is some sort of
       
    70      aggregate (e.g., a `struct'), or for a dynamic varobj, this value
       
    71      will not be interesting.
       
    72 
       
    73 `type'
       
    74      The varobj's type.  This is a string representation of the type, as
       
    75      would be printed by the {No value for `GDBN'} CLI.  If `print
       
    76      object' (*note set print object: Print Settings.) is set to `on',
       
    77      the _actual_ (derived) type of the object is shown rather than the
       
    78      _declared_ one.
       
    79 
       
    80 `thread-id'
       
    81      If a variable object is bound to a specific thread, then this is
       
    82      the thread's identifier.
       
    83 
       
    84 `has_more'
       
    85      For a dynamic varobj, this indicates whether there appear to be any
       
    86      children available.  For a non-dynamic varobj, this will be 0.
       
    87 
       
    88 `dynamic'
       
    89      This attribute will be present and have the value `1' if the
       
    90      varobj is a dynamic varobj.  If the varobj is not a dynamic varobj,
       
    91      then this attribute will not be present.
       
    92 
       
    93 `displayhint'
       
    94      A dynamic varobj can supply a display hint to the front end.  The
       
    95      value comes directly from the Python pretty-printer object's
       
    96      `display_hint' method.  *Note Pretty Printing API::.
       
    97 
       
    98    Typical output will look like this:
       
    99 
       
   100       name='NAME',numchild='N',type='TYPE',thread-id='M',
       
   101        has_more='HAS_MORE'
       
   102 
       
   103 
       
   104 "
       
   105 ! !
       
   106 
       
   107 !GDBMI_var_create methodsFor:'accessing'!
       
   108 
       
   109 operation
       
   110 	^ 'var-create'
       
   111 ! !
       
   112