core/com.nokia.carbide.cpp.doc.user/html/debugger/variables/viewing_variables.htm
changeset 1599 e6d4a94a48d3
parent 1376 120480c02651
child 1658 2a5c0df13bad
equal deleted inserted replaced
1594:92ca7b538bd2 1599:e6d4a94a48d3
     9 </head>
     9 </head>
    10 <body bgcolor="#FFFFFF">
    10 <body bgcolor="#FFFFFF">
    11 <h2>Viewing Variables </h2>
    11 <h2>Viewing Variables </h2>
    12 <p>The <b>Variables</b> view allows manipulation of project  variables and the variable hierarchy used in the source code. For example, you can change the variable format, change a variable value, add watch expressions, or add global variables. </p>
    12 <p>The <b>Variables</b> view allows manipulation of project  variables and the variable hierarchy used in the source code. For example, you can change the variable format, change a variable value, add watch expressions, or add global variables. </p>
    13 <p>Figure 1 shows the Variables view with <b>Show Type Names</b> option enabled. The default view shows the variables list and include the Name and Value for all the variables within scope. In addition, when you select a variable its value is also shown in a different pane within the view.</p>
    13 <p>Figure 1 shows the Variables view with <b>Show Type Names</b> option enabled. The default view shows the variables list and include the Name and Value for all the variables within scope. In addition, when you select a variable its value is also shown in a different pane within the view.</p>
    14 <p align="center"><img src="../images/view_variables.png" width="583" height="262"></p>
    14 <p align="center"><img src="../images/view_variables.png" width="551" height="281"></p>
    15 <p class="figure">Figure 1 - Variables view </p>
    15 <p class="figure">Figure 1 - Variables view </p>
    16 <h3>Variables view toolbar icons</h3>
    16 <h3>Variables view toolbar icons</h3>
    17 <p>The following commands appear on the Variables view toolbar: </p>
    17 <p>The following commands appear on the Variables view toolbar: </p>
    18 <table width="88%"  border="0" cellpadding="2" cellspacing="0">
    18 <table width="88%"  border="0" cellpadding="2" cellspacing="0">
    19   <tr>
    19   <tr>
    50     <td><b>Remove All Global Variables </b></td>
    50     <td><b>Remove All Global Variables </b></td>
    51     <td><div align="center"><img src="../images/var_remove_all_globals_icon.png" width="19" height="19" /></div></td>
    51     <td><div align="center"><img src="../images/var_remove_all_globals_icon.png" width="19" height="19" /></div></td>
    52     <td>Click to remove all global variables from the variables list. </td>
    52     <td>Click to remove all global variables from the variables list. </td>
    53   </tr>
    53   </tr>
    54   <tr>
    54   <tr>
    55     <td><b>Menu</b></td>
    55     <td><b>View Menu</b></td>
    56     <td><div align="center"><img src="../images/icon_menu_white.png" width="12" height="12"></div></td>
    56     <td><div align="center"><img src="../images/icon_menu_white.png" width="12" height="12"></div></td>
    57     <td><p>Enables you to modifiy the <b>Layout</b> to change the view orientation between: horizontal, vertical, or variables pane only.</p>
    57     <td><p>Enables you to modifiy the <b>Layout</b> to change the view orientation between: horizontal, vertical, or variables pane only and customize the columns shown in the view.</p>
       
    58         <p align="center"><img src="../images/menu_view_variables_01.png" alt="View menu" width="373" height="158"></p>
    58         <p>In addition, use <b>Show All Variables</b> to toggle between showing only those variables that are in scope and live or   show all local variables, even if redundant. With this option on you will see all of the variables including the multiple defined variables like &ldquo;i&rdquo; for your loops  and ones that may no longer have accurate values.</p></td>
    59         <p>In addition, use <b>Show All Variables</b> to toggle between showing only those variables that are in scope and live or   show all local variables, even if redundant. With this option on you will see all of the variables including the multiple defined variables like &ldquo;i&rdquo; for your loops  and ones that may no longer have accurate values.</p></td>
    59   </tr>
    60   </tr>
    60 </table>
    61 </table>
    61 <h3>Variables view context menu options</h3>
    62 <h3>Variables view context menu options</h3>
    62 <p>Right-click in the <b>Variables</b> view to access the commands on the Variables view context menu.</p>
    63 <p>Right-click in the <b>Variables</b> view to access the commands on the Variables view context menu.</p>
    63 <p align="center"><img src="../images/view_variables_menu_cmds.png" width="236" height="334"></p>
    64 <p align="center"><img src="../images/menu_view_variables_02.png" alt="Variables view context menu" width="424" height="344"></p>
    64 <p class="figure">Figure 2. Variables view context menu commands</p>
    65 <p class="figure">Figure 2. Variables view context menu commands</p>
    65 <p>The  commands include: </p>
    66 <p>The  commands include: </p>
    66 <table width="100%"  border="0" cellpadding="2" cellspacing="0">
    67 <table width="100%"  border="0" cellpadding="2" cellspacing="0">
    67   <tr>
    68   <tr>
    68     <th width="27%" scope="col">Item</th>
    69     <th width="27%" scope="col">Item</th>
    72     <td><b>Select All</b></td>
    73     <td><b>Select All</b></td>
    73     <td>Selects all the variables shown in the <b>Variables</b> view.</td>
    74     <td>Selects all the variables shown in the <b>Variables</b> view.</td>
    74   </tr>
    75   </tr>
    75   <tr>
    76   <tr>
    76     <td><b>Copy Variables</b></td>
    77     <td><b>Copy Variables</b></td>
    77     <td>Copies the selected variables to the clipboard.</td>
    78     <td><p>Copies the selected variables to the clipboard.</p>
       
    79         <p class="note"><strong>NOTE</strong> Only the selected variables visible in the Variables view are copied. Variables listed outside the boundary of the view are not in memory and can't be copied at this time.</p></td>
    78   </tr>
    80   </tr>
    79   <tr>
    81   <tr>
    80     <td><b>Enable</b></td>
    82     <td><b>Enable</b></td>
    81     <td>Enables the selected variable.</td>
    83     <td>Enables the selected variable.</td>
    82   </tr>
    84   </tr>
    83   <tr>
    85   <tr>
    84     <td><b>Disable</b></td>
    86     <td><b>Disable</b></td>
    85     <td>Disables the selected variable.</td>
    87     <td>Disables the selected variable.</td>
    86   </tr>
    88   </tr>
    87   <tr>
    89   <tr>
    88     <td><b>Display as Array...</b></td>
    90     <td><b>Cast To Type...</b></td>
    89     <td>&nbsp;</td>
    91     <td><p>Opens the <b>Cast to Type</b> dialog where you can assign a new type to the variable. Enter the type and click <strong>OK</strong>. </p>
       
    92         <p>All cast variables are then shown using the <strong>Restore Original Type</strong> menu option making them easy to identify and restore later.</p>
       
    93         <p align="center"><img src="../images/wnd_cast_to_type.png" alt="Cast To Type window" width="488" height="197"></p>
       
    94         </td>
    90   </tr>
    95   </tr>
    91   <tr>
    96   <tr>
    92     <td><b>Cast To Type...</b></td>
    97       <td><strong>Display As Array...</strong></td>
    93     <td>Opens the <b>Cast to Type</b> dialog where you can assign a new type to the variable.</td>
    98       <td><p>Opens the <strong>Display as Array</strong> dialog where you can set array parameters to show the variables. Enter the <strong>Start index</strong> and <strong>Length</strong>, then click <strong>OK</strong> to update how the variables are shown in the Variables view.</p>
    94   </tr>
    99         <p align="center"><img src="../images/wnd_display_as_array.png" alt="Display as Array" width="488" height="195"></p></td>
    95   <tr>
       
    96     <td><p><b>Restore Original Type</b></p>    </td>
       
    97     <td>Resets the selected variable to the original type assigned by the program.</td>
       
    98   </tr>
   100   </tr>
    99   <tr>
   101   <tr>
   100     <td><b>View Memory</b></td>
   102     <td><b>View Memory</b></td>
   101     <td>Opens a <b>Memory</b> view on the selected variable so you can examine it.</td>
   103     <td>Opens a <a href="../../reference/view_memory_wnd.htm">Memory</a> view on the selected variable so you can examine it.</td>
       
   104   </tr>
       
   105   <tr>
       
   106       <td><b>Format</b></td>
       
   107       <td><p>Change the selected variable's  display format. The default setting is Natural, or the format assigned when the variable is defined. For example, the decimal value of 256 would appear as:</p>
       
   108               <ul>
       
   109                   <li>Binary (<span class="code">0b100000</span>)</li>
       
   110                   <li>Natural (<span class="code">256</span>)</li>
       
   111                   <li>Decimal (<span class="code">256</span>)</li>
       
   112                   <li>Hexadecimal (<span class="code">0x100</span>)</li>
       
   113               </ul></td>
   102   </tr>
   114   </tr>
   103   <tr>
   115   <tr>
   104     <td><b>Find...</b></td>
   116     <td><b>Find...</b></td>
   105     <td>Opens a <b>Find</b> dialog to search for variables.</td>
   117     <td><p>Opens a <b>Find</b> dialog to search for variables. Enter the variable to search for and click <strong>OK</strong>.</p>
       
   118         <p align="center"><img src="../images/wnd_find_variables.png" alt="Find window" width="398" height="437"></p></td>
   106   </tr>
   119   </tr>
   107   <tr>
   120   <tr>
   108     <td><b>Change Value...</b></td>
   121     <td><b>Change Value...</b></td>
   109     <td><p>Opens the <b>Set Value</b> dialog where you can modify the value assigned to the selected variable. Change the value and click <b>OK</b>.</p>
   122     <td><p>Opens the <b>Set Value</b> dialog where you can modify the value assigned to the selected variable. Change the value and click <b>OK</b>.</p>
   110     <p align="center"><img src="../images/wnd_set_value.png" width="401" height="214"></p></td>
   123     <p align="center"><img src="../images/wnd_set_value.png" width="488" height="234"></p></td>
       
   124   </tr>
       
   125   <tr>
       
   126       <td><b>Add Global Variables...</b></td>
       
   127       <td>Select  to open the <a href="adding_variables.htm">Global Variables</a> dialog where you can select one or more global variables to display in the Variables view. Global variables appear at the top of the variables list. </td>
       
   128   </tr>
       
   129   <tr>
       
   130       <td><b>Remove Global Variables</b></td>
       
   131       <td>Remove the selected global variables from the Variables view.</td>
       
   132   </tr>
       
   133   <tr>
       
   134       <td><b>Remove All Global Variables</b></td>
       
   135       <td>Remove all  global variables from the Variables view.</td>
   111   </tr>
   136   </tr>
   112   <tr>
   137   <tr>
   113     <td><b>Add Watchpoint (C/C++)...</b></td>
   138     <td><b>Add Watchpoint (C/C++)...</b></td>
   114     <td>Opens the <a href="../watchpoints/setting_watchpoints.htm">Add Watchpoint</a> dialog enabling you to define a watchpoint on the variable.</td>
   139     <td><p>Opens the <a href="../watchpoints/setting_watchpoints.htm">Add Watchpoint</a> dialog enabling you to define a watchpoint on the variable.</p>
       
   140         <p align="center"><img src="../images/wnd_add_watchpoint.png" alt="Add Watchpoint window" width="238" height="253"></p></td>
   115   </tr>
   141   </tr>
   116   <tr>
   142   <tr>
   117     <td><b>Add Global Variables...</b></td>
   143     <td><b> Watch</b></td>
   118     <td>Select  to open the <a href="adding_variables.htm">Global Variables</a> dialog where you can select one or more global variables to display in the Variables view. Global variables appear at the top of the variables list. </td>
       
   119   </tr>
       
   120   <tr>
       
   121     <td><b>Remove Global Variables</b></td>
       
   122     <td>Remove the selected global variables from the Variables view.</td>
       
   123   </tr>
       
   124   <tr>
       
   125     <td><b>Remove All Global Variables</b></td>
       
   126     <td>Remove all  global variables from the Variables view.</td>
       
   127   </tr>
       
   128   <tr>
       
   129     <td><b>Create Watch Expression</b></td>
       
   130     <td>Creates a watchpoint on the selected variable and displays it in the <a href="../watchpoints/watchpoints.htm">Watchpoint</a> view. </td>
   144     <td>Creates a watchpoint on the selected variable and displays it in the <a href="../watchpoints/watchpoints.htm">Watchpoint</a> view. </td>
   131   </tr>
       
   132   <tr>
       
   133     <td><b>Format</b></td>
       
   134     <td><p>Change the selected variable's  display format. The default setting is Natural, or the format assigned when the variable is defined. For example, the decimal value of 256 would appear as:</p>
       
   135       <ul>
       
   136         <li>Binary (<span class="code">0b100000</span>)</li>
       
   137         <li>Natural (<span class="code">256</span>)</li>
       
   138         <li>Decimal (<span class="code">256</span>)</li>
       
   139         <li>Hexadecimal (<span class="code">0x100</span>)</li>
       
   140     </ul>      </td>
       
   141   </tr>
   145   </tr>
   142 </table>
   146 </table>
   143 <h5>Other references</h5>
   147 <h5>Other references</h5>
   144 <ul>
   148 <ul>
   145   <li><a href="variables.htm">Variables and Expressions Overview</a></li>
   149   <li><a href="variables.htm">Variables and Expressions Overview</a></li>