File: gdb-mi.el.html
This mode acts as a graphical user interface to GDB. You can interact with GDB through the GUD buffer in the usual way, but there are also further buffers which control the execution and describe the state of your program. It separates the input/output of your program from that of GDB and displays expressions and their current values in their own buffers. It also uses features such as the fringe/display margin for breakpoints, and the toolbar (see the GDB Graphical Interface section in the Emacs info manual).
M-x gdb will start the debugger.
This file uses GDB/MI as the primary interface to GDB. It runs gdb with GDB/MI (-interp=mi) and access CLI using "-interpreter-exec console cli-command". This code replaces gdb-ui.el and uses MI tokens instead of queues. Eventually MI should be asynchronous.
Windows Platforms:
If you are using Emacs and GDB on Windows you will need to flush the buffer explicitly in your program if you want timely display of I/O in Emacs. Alternatively you can make the output stream unbuffered, for example, by using a macro:
#ifdef UNBUFFERED
setvbuf (stdout, (char *) NULL, _IONBF, 0);
#endif
and compiling with -DUNBUFFERED while debugging.
If you are using Cygwin GDB and find that the source is not being displayed in Emacs when you step through it, possible solutions are to:
1) Use Cygwin X Windows and Cygwin Emacs. (Since 22.1 Emacs builds under Cygwin.) 2) Use MinGW GDB instead. 3) Use cygwin-mount.el
Defined variables (135)
breakpoint-disabled-icon | Icon for disabled breakpoint in display margin. |
breakpoint-disabled-pbm-data | PBM data used for disabled breakpoint icon. |
breakpoint-enabled-icon | Icon for enabled breakpoint in display margin. |
breakpoint-enabled-pbm-data | PBM data used for enabled breakpoint icon. |
breakpoint-xpm-data | XPM data used for breakpoint icon. |
gdb--memory-display-warning | Display warning on memory header if t. |
gdb--window-configuration-before | Stores the window configuration before starting GDB. |
gdb-active-process | GUD tooltips display variable values when t, and macro definitions otherwise. |
gdb-breakpoints-list | Association list of breakpoints provided by "-break-list" MI command. |
gdb-breakpoints-mode-abbrev-table | Abbrev table for ‘gdb-breakpoints-mode’. |
gdb-breakpoints-mode-hook | Hook run after entering ‘gdb-breakpoints-mode’. |
gdb-breakpoints-mode-map | Keymap for ‘gdb-breakpoints-mode’. |
gdb-breakpoints-mode-syntax-table | Syntax table for ‘gdb-breakpoints-mode’. |
gdb-buf-publisher | Used to invalidate GDB buffers by emitting a signal in ‘gdb-update’. |
gdb-buffer-type | One of the symbols bound in ‘gdb-buffer-rules’. |
gdb-changed-registers | List of changed register numbers (strings). |
gdb-control-commands-regexp | Regexp matching GDB commands that enter a recursive reading loop. |
gdb-cpp-define-alist-flags | Preprocessor flags for ‘gdb-cpp-define-alist-program’. |
gdb-cpp-define-alist-program | Shell command for generating a list of defined macros in a source file. |
gdb-create-source-file-list | Non-nil means create a list of files from which the executable was built. |
gdb-debug-log | List of commands sent to and replies received from GDB. |
gdb-debug-log-max | Maximum size of ‘gdb-debug-log’. If nil, size is unlimited. |
gdb-debuginfod-enable | Whether the current GDB session can query debuginfod servers. |
gdb-debuginfod-enable-setting | Whether to enable downloading missing debug info from debuginfod servers. |
gdb-default-window-configuration-file | If non-nil, load this window configuration (layout) on startup. |
gdb-define-alist | Alist of #define directives for GUD tooltips. |
gdb-delete-out-of-scope | If non-nil delete watch expressions automatically when they go out of scope. |
gdb-disassembly-font-lock-keywords | Font lock keywords used in ‘gdb-disassembly-mode’. |
gdb-disassembly-mode-abbrev-table | Abbrev table for ‘gdb-disassembly-mode’. |
gdb-disassembly-mode-hook | Hook run after entering ‘gdb-disassembly-mode’. |
gdb-disassembly-mode-map | Keymap for ‘gdb-disassembly-mode’. |
gdb-disassembly-mode-syntax-table | Syntax table for ‘gdb-disassembly-mode’. |
gdb-discard-unordered-replies | Non-nil means discard any out-of-order GDB replies. |
gdb-display-buffer-other-frame-action | ‘display-buffer’ action for displaying GDB utility frames. |
gdb-display-io-buffer | When non-nil, display the separate ‘gdb-inferior-io’ buffer. |
gdb-display-io-nopopup | When non-nil, and the ‘gdb-inferior-io’ buffer is buried, don’t pop it up. |
gdb-display-source-buffer-action | ‘display-buffer’ action used when GDB displays a source buffer. |
gdb-edit-locals-map-1 | Keymap to edit value of a simple data type local variable. |
gdb-enable-debug | Non-nil if Gdb-Enable-Debug mode is enabled. |
gdb-enable-debug-hook | Hook run after entering or leaving ‘gdb-enable-debug’. |
gdb-filter-output | Message to be shown in GUD console. |
gdb-frame-address | Identity of frame for watch expression. |
gdb-frame-number | Selected frame level for main current thread. |
gdb-frames-font-lock-keywords | Font lock keywords used in ‘gdb-frames-mode’. |
gdb-frames-mode-abbrev-table | Abbrev table for ‘gdb-frames-mode’. |
gdb-frames-mode-hook | Hook run after entering ‘gdb-frames-mode’. |
gdb-frames-mode-map | Keymap for ‘gdb-frames-mode’. |
gdb-frames-mode-syntax-table | Syntax table for ‘gdb-frames-mode’. |
gdb-gud-control-all-threads | When non-nil, GUD execution commands affect all threads when in non-stop mode. |
gdb-handler-list | List of gdb-handler keeping track of all pending GDB commands. |
gdb-inferior-io-mode-hook | Hook run after entering ‘gdb-inferior-io-mode’. |
gdb-inferior-io-mode-map | Keymap for ‘gdb-inferior-io-mode’. |
gdb-locals-mode-abbrev-table | Abbrev table for ‘gdb-locals-mode’. |
gdb-locals-mode-hook | Hook run after entering ‘gdb-locals-mode’. |
gdb-locals-mode-map | Keymap for ‘gdb-locals-mode’. |
gdb-locals-mode-syntax-table | Syntax table for ‘gdb-locals-mode’. |
gdb-locals-simple-values-only | Only display simple values in the Locals buffer. |
gdb-locals-table-row-config | Configuration for table rows in the local variable display. |
gdb-locals-value-limit | Maximum length the value of a local variable is allowed to be. |
gdb-locals-values-table | Mapping of local variable names to a string with their value. |
gdb-locals-watch-map | Keymap to create watch expression of a complex data type local variable. |
gdb-location-alist | Alist of breakpoint numbers and full filenames. |
gdb-macro-info | Non-nil if GDB knows that the inferior includes preprocessor macro info. |
gdb-main-file | Source file from which program execution begins. |
gdb-many-windows | Non-nil if Gdb-Many-Windows mode is enabled. |
gdb-many-windows-hook | Hook run after entering or leaving ‘gdb-many-windows’. |
gdb-max-children | Maximum number of children before expansion requires confirmation. |
gdb-max-source-window-count | Maximum number of source windows to use. |
gdb-memory-address | Address of memory display. |
gdb-memory-address-expression | This expression is passed to gdb. |
gdb-memory-columns | Number of data columns in memory window. |
gdb-memory-font-lock-keywords | Font lock keywords used in ‘gdb-memory-mode’. |
gdb-memory-format | Display format of data items in memory window. |
gdb-memory-format-map | Keymap to select format in the header line. |
gdb-memory-format-menu | Menu of display formats in the header line. |
gdb-memory-header | Header line used in ‘gdb-memory-mode’. |
gdb-memory-last-address | Last successfully accessed memory address. |
gdb-memory-mode-abbrev-table | Abbrev table for ‘gdb-memory-mode’. |
gdb-memory-mode-hook | Hook run after entering ‘gdb-memory-mode’. |
gdb-memory-mode-map | Keymap for ‘gdb-memory-mode’. |
gdb-memory-mode-syntax-table | Syntax table for ‘gdb-memory-mode’. |
gdb-memory-next-page | Address of next memory page for program memory buffer. |
gdb-memory-prev-page | Address of previous memory page for program memory buffer. |
gdb-memory-rows | Number of data rows in memory window. |
gdb-memory-unit | Unit size of data items in memory window. |
gdb-memory-unit-map | Keymap to select units in the header line. |
gdb-memory-unit-menu | Menu of units in the header line. |
gdb-mi-decode-strings | When non-nil, decode octal escapes in GDB output into non-ASCII text. |
gdb-non-stop | Indicates whether current GDB session is using non-stop mode. |
gdb-non-stop-setting | If non-nil, GDB sessions are expected to support the non-stop mode. |
gdb-output-sink | The disposition of the output of the current gdb command. |
gdb-register-names | List of register names. |
gdb-registers-enable-filter | If non-nil, enable register name filter in register buffer. |
gdb-registers-filter-pattern-list | Patterns for names that are displayed in register buffer. |
gdb-registers-mode-abbrev-table | Abbrev table for ‘gdb-registers-mode’. |
gdb-registers-mode-hook | Hook run after entering ‘gdb-registers-mode’. |
gdb-registers-mode-map | Keymap for ‘gdb-registers-mode’. |
gdb-registers-mode-syntax-table | Syntax table for ‘gdb-registers-mode’. |
gdb-restore-window-configuration-after-quit | If non-nil, restore window configuration as of before GDB started. |
gdb-running-threads-count | Number of currently running threads. |
gdb-selected-file | Name of selected file for main current thread. |
gdb-selected-frame | Name of selected function for main current thread. |
gdb-selected-line | Number of selected line for main current thread. |
gdb-show-changed-values | If non-nil change the face of out of scope variables and changed values. |
gdb-show-main | Non-nil means display source file containing the main routine at startup. |
gdb-show-threads-by-default | Show threads list buffer instead of breakpoints list by default. |
gdb-source-file-list | List of source files for the current executable. |
gdb-source-window-list | List of windows used for displaying source files. |
gdb-speedbar-auto-raise | Non-nil if Gdb-Speedbar-Auto-Raise mode is enabled. |
gdb-speedbar-auto-raise-hook | Hook run after entering or leaving ‘gdb-speedbar-auto-raise’. |
gdb-stack-buffer-addresses | Show frame addresses in stack buffers. |
gdb-stack-buffer-locations | Show file information or library names in stack buffers. |
gdb-stopped-functions | List of functions called whenever GDB stops. |
gdb-stopped-threads-count | Number of currently stopped threads. |
gdb-switch-reasons | List of stop reasons for which Emacs should switch thread. |
gdb-switch-when-another-stopped | When nil, don’t switch to stopped thread if some other |
gdb-thread-buffer-addresses | Show addresses for thread frames in threads buffer. |
gdb-thread-buffer-arguments | Show function arguments in threads buffer. |
gdb-thread-buffer-locations | Show file information or library names in threads buffer. |
gdb-thread-buffer-verbose-names | Show long thread names in threads buffer. |
gdb-thread-number | Main current thread. |
gdb-threads-font-lock-keywords | Font lock keywords used in ‘gdb-threads-mode’. |
gdb-threads-list | Association list of threads provided by "-thread-info" MI command. |
gdb-threads-mode-abbrev-table | Abbrev table for ‘gdb-threads-mode’. |
gdb-threads-mode-hook | Hook run after entering ‘gdb-threads-mode’. |
gdb-threads-mode-map | Keymap for ‘gdb-threads-mode’. |
gdb-threads-mode-syntax-table | Syntax table for ‘gdb-threads-mode’. |
gdb-use-colon-colon-notation | If non-nil use FUN::VAR format to display variables in the speedbar. |
gdb-var-list | List of variables in watch window. |
gdb-window-configuration-directory | Directory where GDB window configuration files are stored. |
gdbmi-bnf-offset | Offset in ‘gud-marker-acc’ at which the parser is reading. |
gdbmi-bnf-result-state-configs | Alist of alists, mapping the type and class of message to a handler function. |
gdbmi-bnf-state | Current GDB/MI output parser state. |
gdbmi-debug-mode | When non-nil, print the messages sent/received from GDB/MI in *Messages*. |
gud-gdb-command-name | Default command to execute an executable under the GDB debugger. |
Defined functions (275)
Defined faces (2)
breakpoint-disabled | Face for disabled breakpoint icon in fringe. |
breakpoint-enabled | Face for enabled breakpoint icon in fringe. |