core/com.nokia.carbide.cpp.doc.user/html/debugger/variables/view_variables.htm
author fturovic <frank.turovich@nokia.com>
Thu, 07 Oct 2010 15:31:31 -0500
changeset 2142 1458a474103c
parent 2140 3cc835ea617d
permissions -rw-r--r--
minor edits

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="LASTUPDATED" content="06/17/05 11:09:43" />
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
<title>Variables view</title>
<link rel="StyleSheet" href="../../../book.css" type="text/css"/>
</head>
<body >
<h2>Variables view</h2>
<p>The <img src="../../images/command_link.png" border="0" alt="" /> <a href='javascript:executeCommand("org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.debug.ui.VariableView)")' class="command-link"><b>Variables</b></a> 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>
<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 Value pane within the view.</p>
<p align="center"><img src="../images/view_variables.png" width="551" height="281"></p>
<p class="figure">Figure 1 - Variables view </p>
<div class="step">
    <h4>To open the Variables view </h4>
    <ul>
        <li>Click the Window &gt; Show View &gt; Variables menu option</li>
        <p>A <b>Variables</b> view appears.</p>
    </ul>
</div>
<h3>Variables view toolbar icons</h3>
<p>The following commands appear on the <b>Variables</b> view toolbar: </p>
<table width="88%"  border="0" cellpadding="2" cellspacing="0">
  <tr>
    <th width="34%" scope="col">Item</th>
    <th width="14%" scope="col">Icons</th>
    <th width="52%" scope="col">Explanation</th>
  </tr>
  <tr>
    <td><b>Show Type Names </b></td>
    <td><div align="center"><img src="../images/var_toggle_type_names_icon.png" width="19" height="19" /></div></td>
    <td>Toggles the display of type names in the <b>Variables</b> view. </td>
  </tr>
  <tr>
    <td><b>Show Logical Structure </b></td>
    <td><div align="center"><img src="../images/var_show_logical_struct_icon.png" width="19" height="19" /></div></td>
    <td>Not available in C/C++ yet. </td>
  </tr>
  <tr>
    <td><b>Collapse All </b></td>
    <td><div align="center"><img src="../images/var_collapse_all_icon.png" width="17" height="18" /></div></td>
    <td>Collapses all expanded variables into the top level. </td>
  </tr>
  <tr>
    <td><b>Add Global Variables </b></td>
    <td><div align="center"><img src="../images/var_add_global_vars_icon.png" width="19" height="19" /></div></td>
    <td><p>Click 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. </p>
        <p class="note"><b>NOTE</b> Not yet implemented in C3, use <b>View Menu &gt; Show Globals Defined in this File</b> menu option instead.</p></td>
  </tr>
  <tr>
    <td><b>Remove Selected Global Variables </b></td>
    <td><div align="center"><img src="../images/var_remove_selected_globals_icon.png" width="18" height="16" /></div></td>
    <td>Click to remove all currently selected global variables from the variables list. </td>
  </tr>
  <tr>
    <td><b>Remove All Global Variables </b></td>
    <td><div align="center"><img src="../images/var_remove_all_globals_icon.png" width="19" height="19" /></div></td>
    <td>Click to remove all global variables from the variables list. </td>
  </tr>
  <tr>
    <td><b>View Menu</b></td>
    <td><div align="center"><img src="../images/icon_menu_white.png" width="12" height="12"></div></td>
    <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>
        <p align="center"><img src="../images/menu_view_variables_01.png" alt="View menu" width="373" height="158"></p>
        <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>
  </tr>
</table>
<h3>Variables view context menu options</h3>
<p>Right-click in the <b>Variables</b> view to access the commands on the Variables view context menu.</p>
<p align="center"><img src="../images/menu_view_variables_02.png" alt="Variables view context menu" width="424" height="344"></p>
<p class="figure">Figure 2. Variables view context menu commands</p>
<p>The  commands include: </p>
<table width="100%"  border="0" cellpadding="2" cellspacing="0">
  <tr>
    <th width="27%" scope="col">Item</th>
    <th width="62%" scope="col">Explanation</th>
  </tr>
  <tr>
    <td><b>Select All</b></td>
    <td>Selects all the variables shown in the <b>Variables</b> view.</td>
  </tr>
  <tr>
    <td><b>Copy Variables</b></td>
    <td><p>Copies the selected variables to the clipboard.</p>
        <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>
  </tr>
  <tr>
    <td><b>Enable</b></td>
    <td>Enables the selected variable.</td>
  </tr>
  <tr>
    <td><b>Disable</b></td>
    <td>Disables the selected variable.</td>
  </tr>
  <tr>
    <td><b>Cast To Type...</b></td>
    <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>
        <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>
        <p align="center"><img src="../images/wnd_cast_to_type.png" alt="Cast To Type window" width="488" height="197"></p>
        </td>
  </tr>
  <tr>
      <td><strong>Display As Array...</strong></td>
      <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>
        <p align="center"><img src="../images/wnd_display_as_array.png" alt="Display as Array" width="488" height="195"></p></td>
  </tr>
  <tr>
    <td><b>View Memory</b></td>
    <td>Opens a <a href="../views/view_memory.htm">Memory</a> view on the selected variable so you can examine it.</td>
  </tr>
  <tr>
      <td><b>Format</b></td>
      <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>
              <ul>
                  <li>Binary (<span class="code">0b100000</span>)</li>
                  <li>Natural (<span class="code">256</span>)</li>
                  <li>Decimal (<span class="code">256</span>)</li>
                  <li>Hexadecimal (<span class="code">0x100</span>)</li>
              </ul></td>
  </tr>
  <tr>
    <td><b>Find...</b></td>
    <td><p>Opens a <b>Find</b> dialog to search for variables. Enter the variable to search for and click <strong>OK</strong>.</p>
        <p align="center"><img src="../images/wnd_find_variables.png" alt="Find window" width="398" height="437"></p></td>
  </tr>
  <tr>
    <td><b>Change Value...</b></td>
    <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>
    <p align="center"><img src="../images/wnd_set_value.png" width="488" height="234"></p></td>
  </tr>
  <tr>
      <td><b>Add Global Variables...</b></td>
      <td><p>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. </p>
        <p class="note"><b>NOTE</b> Not yet implemented in C3, use <b>View Menu &gt; Show Globals Defined in this File</b> menu options instead.</p></td>
  </tr>
  <tr>
      <td><b>Remove Global Variables</b></td>
      <td><p>Remove the selected global variables from the Variables view.</p>
        <p class="note"><b>NOTE</b> Not yet implemented in C3, use <b>View Menu &gt; Show Globals Defined in this File</b> menu options instead.</p></td>
  </tr>
  <tr>
      <td><b>Remove All Global Variables</b></td>
      <td>Remove all  global variables from the Variables view.</td>
  </tr>
  <tr>
    <td><b>Add Watchpoint (C/C++)...</b></td>
    <td><p>Opens the <a href="../watchpoints/setting_watchpoints.htm">Add Watchpoint</a> dialog enabling you to define a watchpoint on the variable.</p>
        <p align="center"><img src="../images/wnd_add_watchpoint.png" alt="Add Watchpoint window" width="238" height="253"></p></td>
  </tr>
  <tr>
    <td><b> Watch</b></td>
    <td>Creates a watchpoint on the selected variable and displays it in the <a href="../watchpoints/watchpoints.htm">Watchpoint</a> view. </td>
  </tr>
</table>
<h5>Other references</h5>
<ul>
  <li><a href="variables.htm">Variables and Expressions Overview</a></li>
</ul>
<div id="footer">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
</body>
</html>