Next: Customizing the Debugger, Previous: The Assembly Window, Up: Debugging

### 11.8 The Debugger Console

This is the text window located at the bottom of the main window. In this console, you have direct access to the underlying debugger, and can send commands (you need to refer to the underlying debugger's documentation, but usually typing help will give you an overview of the commands available).

If the underlying debugger allows it, pressing <Tab> in this window will provide completion for the command that is being typed (or for its arguments).

There are also additional commands defined to provide a simple text interface to some graphical features.

Here is the complete list of such commands. The arguments between square brackets are optional and can be omitted.

`graph (print|display) expression [dependent on display_num] [link_name name] [at x, y] [num num]`
  This command creates a new item in the canvas, that shows the value of Expression. Expression should be the name of a variable, or one of its fields, that is in the current scope for the debugger.

  The command `graph print` will create a frozen item, that is not automatically refreshed when the debugger stops, whereas `graph display` displays an automatically refreshed item.

  The new item is associated with a number, that is visible in its title bar. This number can be specified through the `num` keyword, and will be taken into account if no such item already exists. These numbers can be used to create links between the items, using the second argument to the command, dependent on. The link itself (i.e. the line) can be given a name that is automatically displayed, using the third argument.

`graph (print|display) `command``
  This command is similar to the one above, except it should be used to display the result of a debugger command in the canvas.

  For instance, if you want to display the value of a variable in hexadecimal rather than the default decimal with gdb, you should use a command like:

                graph display `print /x my_variable`

  This will evaluate the command between back-quotes every time the debugger stops, and display this in the canvas. The lines that have changed will be automatically highlighted (in red by default).

  This command is the one used by default to display the value of registers for instance.

`graph (enable|disable) display display_num [display_num ...]`
  This command will change the refresh status of items in the canvas. As explained above, items are associated with a number visible in their title bar.

  Using the `graph enable` command will force the item to be automatically refreshed every time the debugger stops, whereas the `graph disable` command will freeze the item.

`graph undisplay display_num`
  This command will remove an item from the canvas
`view (source|asm|source_asm)`
  This command indicates what should be displayed in the source window. The first option indicates that only the source code should be visible, the second one specifies that only the assembly code should be visible, and the last one indicates that both should be displayed.