# GDB/MI library

This document describes the functions of libmigdb library

This document applies to version 0.8.10 of the GDB/Machine interface library.

Most of the C++ interface is fully documented. But not all the C interface is docummented.

The name of the high level C functions are derived from the corresponding GDB/MI command. For this reason I recommend using the chapter 'GDB/MI' of gdb documentation as main reference. As an example: The gdb command '-thread-list-ids' is implemented in the gmi_thread_list_ids function. This function uses the lowlevel function mi_thread_list_ids.

The mi_gdb.h header contains a lot of comments about what does each function. And the examples show how to them together.

- Alphabetical list of functions
- List by classes
- List by modules
- List by files
- List by GDB/MI command

  # Alphabetical List

- BreakDelete (MIDebugger)
- Breakpoint (MIDebugger)
- Breakpoint (MIDebugger) <1>
- BreakpointFull (MIDebugger)
- CallStack (MIDebugger)
- Connect (MIDebugger)
- Continue (MIDebugger)
- Disconnect (MIDebugger)
- EvalExpression (MIDebugger)
- FillTypeVal (MIDebugger)
- FinishFun (MIDebugger)
- gmi_break_delete
- gmi_break_insert
- gmi_break_insert_full
- gmi_break_insert_full_fl
- gmi_break_set_condition
- gmi_break_set_times
- gmi_break_state
- gmi_break_watch
- gmi_data_evaluate_expression
- gmi_dir
- gmi_end_aux_term
- gmi_end_pty
- gmi_exec_continue
- gmi_exec_finish
- gmi_exec_interrupt
- gmi_exec_kill
- gmi_exec_next
- gmi_exec_next_cnt
- gmi_exec_next_instruction
- gmi_exec_return
- gmi_exec_run
- gmi_exec_step
- gmi_exec_step_cnt
- gmi_exec_step_instruction
- gmi_exec_until
- gmi_exec_until_addr
- gmi_file_symbol_file
- gmi_full_var_create
- gmi_gdb_exit
- gmi_gdb_set
- gmi_gdb_show
- gmi_gdb_version
- gmi_look_for_free_pty
- gmi_look_for_free_vt
- gmi_set_exec
- gmi_stack_info_depth
- gmi_stack_info_depth_get
- gmi_stack_info_frame
- gmi_stack_list_arguments
- gmi_stack_list_arguments_r
- gmi_stack_list_frames
- gmi_stack_list_frames_r
- gmi_stack_list_locals
- gmi_stack_select_frame
- gmi_start_xterm
- gmi_target_attach
- gmi_target_detach
- gmi_target_select
- gmi_target_terminal
- gmi_thread_list_all_threads
- gmi_thread_list_ids
- gmi_thread_select
- gmi_var_assign
- gmi_var_create
- gmi_var_create_nm
- gmi_var_delete
- gmi_var_evaluate_expression
- gmi_var_info_expression
- gmi_var_info_num_children
- gmi_var_info_type
- gmi_var_list_children
- gmi_var_set_format
- gmi_var_show_attributes
- gmi_var_show_format
- gmi_var_update
- GoTo (MIDebugger)
- GoTo (MIDebugger) <1>
- Kill (MIDebugger)
- mi_connect_local
- mi_disconnect
- mi_force_version
- mi_get_error_str
- mi_get_workaround
- mi_look_for_free_pty
- mi_look_for_free_vt
- mi_set_workaround
- MIDebugger (MIDebugger)
- ModifyExpression (MIDebugger)
- Poll (MIDebugger)
- ReturnNow (MIDebugger)
- Run (MIDebugger)
- RunOrContinue (MIDebugger)
- RunToMain (MIDebugger)
- SelectTargetLinux (MIDebugger)
- SelectTargetPID (MIDebugger)
- SelectTargetRemote (MIDebugger)
- SelectTargetTTY (MIDebugger)
- SelectTargetX11 (MIDebugger)
- Send (MIDebugger)
- StepOver (MIDebugger)
- Stop (MIDebugger)
- TargetUnselect (MIDebugger)
- TraceInto (MIDebugger)
- WatchDelete (MIDebugger)
- Watchpoint (MIDebugger)
- ~MIDebugger (MIDebugger)

  # Classes

- MIDebugger

  # MIDebugger

- BreakDelete (MIDebugger)
- Breakpoint (MIDebugger)
- Breakpoint (MIDebugger) <1>
- BreakpointFull (MIDebugger)
- CallStack (MIDebugger)
- Connect (MIDebugger)
- Continue (MIDebugger)
- Disconnect (MIDebugger)
- EvalExpression (MIDebugger)
- FillTypeVal (MIDebugger)
- FinishFun (MIDebugger)
- GoTo (MIDebugger)
- GoTo (MIDebugger) <1>
- Kill (MIDebugger)
- MIDebugger (MIDebugger)
- ModifyExpression (MIDebugger)
- Poll (MIDebugger)
- ReturnNow (MIDebugger)
- Run (MIDebugger)
- RunOrContinue (MIDebugger)
- RunToMain (MIDebugger)
- SelectTargetLinux (MIDebugger)
- SelectTargetPID (MIDebugger)
- SelectTargetRemote (MIDebugger)
- SelectTargetTTY (MIDebugger)
- SelectTargetX11 (MIDebugger)
- Send (MIDebugger)
- StepOver (MIDebugger)
- Stop (MIDebugger)
- TargetUnselect (MIDebugger)
- TraceInto (MIDebugger)
- WatchDelete (MIDebugger)
- Watchpoint (MIDebugger)
- ~MIDebugger (MIDebugger)

  # Modules

- Allocator.
- Breakpoint table commands.
- C++ Interface.
- Connect.
- Data manipulation.
- Error. Comment: Translates error numbers into messages.
- Linux VT.
- Miscellaneous commands.
- Parser.
- Program control.
- pseudo terminal
- Stack manipulation.
- Symbol query.
- Target manipulation.
- Thread commands.
- Variable objects.

  # Allocator.

  Most alloc/free routines are here. Free routines must accept NULL pointers. Alloc functions must set mi_error.

  # Breakpoint table commands.

  GDB/MI commands for the "Breakpoint Table Commands" section.

      gdb command:          Implemented?

      -break-after          Yes
      -break-condition      Yes
      -break-delete         Yes
      -break-disable        Yes
      -break-enable         Yes
      -break-info           N.A. (info break NUMBER) (*)
      -break-insert         Yes
      -break-list           No (*)
      -break-watch          Yes

  (*) I think the program should keep track of the breakpoints, so it will be implemented when I have more time.

- gmi_break_delete
- gmi_break_insert
- gmi_break_insert_full
- gmi_break_insert_full_fl
- gmi_break_set_condition
- gmi_break_set_times
- gmi_break_state
- gmi_break_watch

  # C++ Interface.

  Implements a very simple (naive ;-) C++ wrapper.

- BreakDelete (MIDebugger)
- Breakpoint (MIDebugger)
- Breakpoint (MIDebugger) <1>
- BreakpointFull (MIDebugger)
- CallStack (MIDebugger)
- Connect (MIDebugger)
- Continue (MIDebugger)
- Disconnect (MIDebugger)
- EvalExpression (MIDebugger)
- FillTypeVal (MIDebugger)
- FinishFun (MIDebugger)
- GoTo (MIDebugger)
- GoTo (MIDebugger) <1>
- Kill (MIDebugger)
- MIDebugger (MIDebugger)
- ModifyExpression (MIDebugger)
- Poll (MIDebugger)
- ReturnNow (MIDebugger)
- Run (MIDebugger)
- RunOrContinue (MIDebugger)
- RunToMain (MIDebugger)
- SelectTargetLinux (MIDebugger)
- SelectTargetPID (MIDebugger)
- SelectTargetRemote (MIDebugger)
- SelectTargetTTY (MIDebugger)
- SelectTargetX11 (MIDebugger)
- Send (MIDebugger)
- StepOver (MIDebugger)
- Stop (MIDebugger)
- TargetUnselect (MIDebugger)
- TraceInto (MIDebugger)
- WatchDelete (MIDebugger)
- Watchpoint (MIDebugger)
- ~MIDebugger (MIDebugger)

  # Connect.

  This module handles the dialog with gdb, including starting and stopping gdb.

  GDB Bug workaround for "file -readnow": I tried to workaround a bug using it but looks like this option also have bugs!!!! so I have to use the command line option --readnow. It also have a bug!!!! when the binary is changed and gdb must reload it this option is ignored. So it looks like we have no solution but 3 gdb bugs in a row.

- gmi_end_aux_term
- gmi_start_xterm
- mi_connect_local
- mi_disconnect
- mi_force_version
- mi_get_workaround
- mi_set_workaround

  # Data manipulation.

  GDB/MI commands for the "Data manipulation" section.

      gdb command:                       Implemented?

      -data-disassemble                  Yes
      -data-evaluate-expression          Yes
      -data-list-changed-registers       No
      -data-list-register-names          Yes
      -data-list-register-values         No
      -data-read-memory                  No
      -display-delete                    N.A. (delete display)
      -display-disable                   N.A. (disable display)
      -display-enable                    N.A. (enable display)
      -display-insert                    N.A. (display)
      -display-list                      N.A. (info display)
      -environment-cd                    No
      -environment-directory             Yes, MI v1 implementation
      -environment-path                  No

  Notes:

  1) -display* aren't implemented. You can use CLI command display, but the results are sent to the console. So it looks like the best is to manually use -data-evaluate-expression to emulate it.

  2) GDB bug mi/1770: Affects gdb<=6.2, when you ask for the names of the registers you get it plus the name of the "pseudo-registers", but if you try to get the value of a pseudo-register you get an error saying the register number is invalid. I reported to gdb-patches@sources.redhat.com on 2004/08/25 and as I didn't get any answer I filled a bug report on 2004/09/02. The patch to fix this annoying bug is: Index: gdb/mi/mi-main.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.64 diff -u -r1.64 mi-main.c --- gdb/mi/mi-main.c 3 Aug 2004 00:57:27 -0000 1.64 +++ gdb/mi/mi-main.c 25 Aug 2004 14:12:50 -0000 @ -423,7 +423,7 @ case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. - numregs = NUM_REGS; + numregs = NUM_REGS + NUM_PSEUDO_REGS; if (argc == 0) { ---- Note I had to remove an end of comment in the patch to include it here. This bug forced me to create another set of functions. The only way is to first get the values and then the names. Fixed by Changelog entry: 2004-09-12 Salvador E. Tropea <set@users.sf.net> Andrew Cagney <cagney@gnu.org> * mi/mi-main.c (mi_cmd_data_list_changed_registers) (mi_cmd_data_list_register_values) (mi_cmd_data_write_register_values): Include the PSEUDO_REGS in the register number computation.

- gmi_data_evaluate_expression
- gmi_dir

  # Error. Comment: Translates error numbers into messages.

- mi_get_error_str

  # Linux VT.

  Helper to find a free VT. That's 100% Linux specific.

  The code comes from "lconsole.c" from Allegro project and was originally created by Marek Habersack and then modified by George Foot. I addapted it to my needs and changed license from giftware to GPL.

- gmi_look_for_free_vt
- mi_look_for_free_vt

  # Miscellaneous commands.

  GDB/MI commands for the "Miscellaneous Commands" section.

      gdb command:       Implemented?

      -gdb-exit          Yes
      -gdb-set           Yes
      -gdb-show          Yes
      -gdb-version       Yes

- gmi_gdb_exit
- gmi_gdb_set
- gmi_gdb_show
- gmi_gdb_version

  # Parser.

  Parses the output of gdb. It basically converts the text from gdb into a tree (could be a complex one) that we can easily interpret using C code.

  # Program control.

  GDB/MI commands for the "Program Control" section.

      gdb command:                   Implemented?

      -exec-abort                    N.A. (*) (kill, but with non-interactive options)
      -exec-arguments                Yes
      -exec-continue                 Yes  ASYNC
      -exec-finish                   Yes  ASYNC
      -exec-interrupt                Yes  ASYNC
      -exec-next                     Yes  ASYNC
      -exec-next-instruction         Yes  ASYNC
      -exec-return                   Yes
      -exec-run                      Yes  ASYNC
      -exec-show-arguments           N.A. (show args) see gmi_stack_info_frame
      -exec-step                     Yes  ASYNC
      -exec-step-instruction         Yes  ASYNC
      -exec-until                    Yes  ASYNC
      -file-exec-and-symbols         Yes
      -file-exec-file                No
      -file-list-exec-sections       N.A. (info file)
      -file-list-exec-source-files   N.A.
      -file-list-shared-libraries    N.A.
      -file-list-symbol-files        N.A.
      -file-symbol-file              Yes

  (*) gmi_exec_kill implements it, but you should ensure that gmi_gdb_set("confirm","off") was called.

  GDB Bug workaround for -file-exec-and-symbols and -file-symbol-file: This is complex, but a real bug. When you set a breakpoint you never know the name of the file as it appears in the debug info. So you can be specifying an absolute file name or a relative file name. The reference point could be different than the one used in the debug info. To solve all the combinations gdb does a search trying various combinations. GDB isn't very smart so you must at least specify the working directory and the directory where the binary is located to get a good chance (+ user options to solve the rest). Once you did it gdb can find the file by doing transformations to the "canonical" filename. This search works OK for already loaded symtabs (symbol tables), but it have a bug when the search is done for psymtabs (partial symtabs). The bug is in the use of source_full_path_of (source.c). This function calls openp indicating try_cwd_first. It makes the search file if the psymtab file name have at least one dirseparator. It means that psymtabs for files compiled with relative paths will fail. The search for symtabs uses symtab_to_filename, it calls open_source_file which finally calls openp without try_cwd_first.
  To workaround this bug we must ensure gdb loads *all* the symtabs to memory. And here comes another problem -file-exec-and-symbols doesn't support it according to docs. In real life that's a wrapper for "file", but as nobody can say it won't change we must use the CLI command.

- gmi_exec_continue
- gmi_exec_finish
- gmi_exec_interrupt
- gmi_exec_kill
- gmi_exec_next
- gmi_exec_next_cnt
- gmi_exec_next_instruction
- gmi_exec_return
- gmi_exec_run
- gmi_exec_step
- gmi_exec_step_cnt
- gmi_exec_step_instruction
- gmi_exec_until
- gmi_exec_until_addr
- gmi_file_symbol_file
- gmi_set_exec
- gmi_target_terminal

  # pseudo terminal

  Helper to find a free pseudo terminal. Use this if you need to manage input *and* output to the target process. If you just need output then define a handler for target output stream records (assuming that this is working for your particular version of gdb). Usage: mi_pty *pty = gmi_look_for_free_pty(); if (pty) gmi_target_terminal(mih, pty->slave); ... * reading from pty->master will get stdout from target * * writing to pty->master will send to target stdin * Note: Contributed by Greg Watson (gwatson lanl gov)
- gmi_end_pty
- gmi_look_for_free_pty
- mi_look_for_free_pty

  # Stack manipulation.

  GDB/MI commands for the "Stack Manipulation" section.

      gdb command:              Implemented?

      -stack-info-frame         Yes, implemented as "frame"
      -stack-info-depth         Yes
      -stack-list-arguments     Yes
      -stack-list-frames        Yes
      -stack-list-locals        Yes
      -stack-select-frame       Yes

- gmi_stack_info_depth
- gmi_stack_info_depth_get
- gmi_stack_info_frame
- gmi_stack_list_arguments
- gmi_stack_list_arguments_r
- gmi_stack_list_frames
- gmi_stack_list_frames_r
- gmi_stack_list_locals
- gmi_stack_select_frame

  # Symbol query.

  GDB/MI commands for the "Symbol Query" section.

      gdb command:              Implemented?
      -symbol-info-address      N.A. (info address, human readable)
      -symbol-info-file         N.A.
      -symbol-info-function     N.A.
      -symbol-info-line         N.A. (info line, human readable)
      -symbol-info-symbol       N.A. (info symbol, human readable)
      -symbol-list-functions    N.A. (info functions, human readable)
      -symbol-list-types        N.A. (info types, human readable)
      -symbol-list-variables    N.A. (info variables, human readable)
      -symbol-list-lines        No (gdb 6.x)
      -symbol-locate            N.A.
      -symbol-type              N.A. (ptype, human readable)

  Note:

  Only one is implemented and not in gdb 5.x.

  # Target manipulation.

  GDB/MI commands for the "Target Manipulation" section.

      -target-attach                  Yes (implemented using attach)
      -target-compare-sections        N.A. (compare-sections)
      -target-detach                  Yes
      -target-download                No
      -target-exec-status             N.A.
      -target-list-available-targets  N.A. (help target)
      -target-list-current-targets    N.A. (info file among other things)
      -target-list-parameters         N.A.
      -target-select                  Yes

- gmi_target_attach
- gmi_target_detach
- gmi_target_select

  # Thread commands.

  GDB/MI commands for the "Thread Commands" section.

      gdb command:              Implemented?
      -thread-info              N.A.
      -thread-list-all-threads  Yes, implemented as "info threads"
      -thread-list-ids          Yes
      -thread-select            Yes

- gmi_thread_list_all_threads
- gmi_thread_list_ids
- gmi_thread_select

  # Variable objects.

  GDB/MI commands for the "Variable Objects" section.

      gdb command:              Imp? Description:
      -var-create               Yes  create a variable object
      -var-delete               Yes  delete the variable object and its children
      -var-set-format           Yes  set the display format of this variable
      -var-show-format          Yes  show the display format of this variable
      -var-info-num-children    Yes  tells how many children this object has
      -var-list-children        Yes* return a list of the object's children
      -var-info-type            Yes  show the type of this variable object
      -var-info-expression      Yes  print what this variable object represents
      -var-show-attributes      Yes  is this variable editable?
      -var-evaluate-expression  Yes  get the value of this variable
      -var-assign               Yes  set the value of this variable
      -var-update               Yes* update the variable and its children

  Notes:

  1) I suggest letting gdb to choose the names for the variables.
  2) -var-list-children supports an optional "show values" argument in MI v2. It isn't implemented.

  * MI v1 and v2 result formats supported.

- gmi_full_var_create
- gmi_var_assign
- gmi_var_create
- gmi_var_create_nm
- gmi_var_delete
- gmi_var_evaluate_expression
- gmi_var_info_expression
- gmi_var_info_num_children
- gmi_var_info_type
- gmi_var_list_children
- gmi_var_set_format
- gmi_var_show_attributes
- gmi_var_show_format
- gmi_var_update

  # Files

- breakpoint.c
- connect.c
- cpp_int.cc
- data_man.c
- error.c
- get_free_pty.c
- get_free_vt.c
- misc.c
- prg_control.c
- stack_man.c
- target_man.c
- thread.c
- var_obj.c

  # breakpoint.c

- gmi_break_delete
- gmi_break_insert
- gmi_break_insert_full
- gmi_break_insert_full_fl
- gmi_break_set_condition
- gmi_break_set_times
- gmi_break_state
- gmi_break_watch

  # connect.c

- gmi_end_aux_term
- gmi_start_xterm
- mi_connect_local
- mi_disconnect
- mi_force_version
- mi_get_workaround
- mi_set_workaround

  # cpp_int.cc

- BreakDelete (MIDebugger)
- Breakpoint (MIDebugger)
- Breakpoint (MIDebugger) <1>
- BreakpointFull (MIDebugger)
- CallStack (MIDebugger)
- Connect (MIDebugger)
- Continue (MIDebugger)
- Disconnect (MIDebugger)
- EvalExpression (MIDebugger)
- FillTypeVal (MIDebugger)
- FinishFun (MIDebugger)
- GoTo (MIDebugger)
- GoTo (MIDebugger) <1>
- Kill (MIDebugger)
- MIDebugger (MIDebugger)
- ModifyExpression (MIDebugger)
- Poll (MIDebugger)
- ReturnNow (MIDebugger)
- Run (MIDebugger)
- RunOrContinue (MIDebugger)
- RunToMain (MIDebugger)
- SelectTargetLinux (MIDebugger)
- SelectTargetPID (MIDebugger)
- SelectTargetRemote (MIDebugger)
- SelectTargetTTY (MIDebugger)
- SelectTargetX11 (MIDebugger)
- Send (MIDebugger)
- StepOver (MIDebugger)
- Stop (MIDebugger)
- TargetUnselect (MIDebugger)
- TraceInto (MIDebugger)
- WatchDelete (MIDebugger)
- Watchpoint (MIDebugger)
- ~MIDebugger (MIDebugger)

  # data_man.c

- gmi_data_evaluate_expression
- gmi_dir

  # error.c

- mi_get_error_str

  # get_free_pty.c

- gmi_end_pty
- gmi_look_for_free_pty
- mi_look_for_free_pty

  # get_free_vt.c

- gmi_look_for_free_vt
- mi_look_for_free_vt

  # misc.c

- gmi_gdb_exit
- gmi_gdb_set
- gmi_gdb_show
- gmi_gdb_version

  # prg_control.c

- gmi_exec_continue
- gmi_exec_finish
- gmi_exec_interrupt
- gmi_exec_kill
- gmi_exec_next
- gmi_exec_next_cnt
- gmi_exec_next_instruction
- gmi_exec_return
- gmi_exec_run
- gmi_exec_step
- gmi_exec_step_cnt
- gmi_exec_step_instruction
- gmi_exec_until
- gmi_exec_until_addr
- gmi_file_symbol_file
- gmi_set_exec
- gmi_target_terminal

  # stack_man.c

- gmi_stack_info_depth
- gmi_stack_info_depth_get
- gmi_stack_info_frame
- gmi_stack_list_arguments
- gmi_stack_list_arguments_r
- gmi_stack_list_frames
- gmi_stack_list_frames_r
- gmi_stack_list_locals
- gmi_stack_select_frame

  # target_man.c

- gmi_target_attach
- gmi_target_detach
- gmi_target_select

  # thread.c

- gmi_thread_list_all_threads
- gmi_thread_list_ids
- gmi_thread_select

  # var_obj.c

- gmi_full_var_create
- gmi_var_assign
- gmi_var_create
- gmi_var_create_nm
- gmi_var_delete
- gmi_var_evaluate_expression
- gmi_var_info_expression
- gmi_var_info_num_children
- gmi_var_info_type
- gmi_var_list_children
- gmi_var_set_format
- gmi_var_show_attributes
- gmi_var_show_format
- gmi_var_update

  # Command

- -break-after
- -break-condition
- -break-delete
- -break-enable + -break-disable
- -break-insert
- -break-insert [ops] file:line
- -break-insert file:line
- -break-watch
- -data-evaluate-expression
- -environment-directory
- -exec-abort [using kill]
- -exec-continue
- -exec-finish
- -exec-interrupt [replacement]
- -exec-next
- -exec-next count
- -exec-next-instruction
- -exec-return
- -exec-run
- -exec-step
- -exec-step count
- -exec-step-instruction
- -exec-until
- -exec-until (using *address)
- -file-exec-and-symbols + -exec-arguments
- -file-symbol-file
- -gdb-exit
- -gdb-set
- -gdb-show
- -gdb-version
- -stack-info-depth
- -stack-info-depth [no args]
- -stack-info-frame [using frame]
- -stack-list-arguments
- -stack-list-frames
- -stack-list-locals
- -stack-select-frame
- -target-attach [using attach]
- -target-detach
- -target-select
- -thread-list-all-threads
- -thread-list-ids
- -thread-select
- -var-assign
- -var-create
- -var-create + -var-info-expression + -var-show-attributes
- -var-create [auto name]
- -var-delete
- -var-evaluate-expression
- -var-info-expression
- -var-info-num-children
- -var-info-type
- -var-list-children
- -var-set-format
- -var-show-attributes
- -var-show-format
- -var-update
- tty

  # -break-after

- gmi_break_set_times

  # -break-condition

- gmi_break_set_condition

  # -break-delete

- gmi_break_delete

  # -break-enable + -break-disable

- gmi_break_state

  # -break-insert

- gmi_break_insert_full

  # -break-insert [ops] file:line

- gmi_break_insert_full_fl

  # -break-insert file:line

- gmi_break_insert

  # -break-watch

- gmi_break_watch

  # -data-evaluate-expression

- gmi_data_evaluate_expression

  # -environment-directory

- gmi_dir

  # -exec-abort [using kill]

- gmi_exec_kill

  # -exec-continue

- gmi_exec_continue

  # -exec-finish

- gmi_exec_finish

  # -exec-interrupt [replacement]

- gmi_exec_interrupt

  # -exec-next

- gmi_exec_next

  # -exec-next count

- gmi_exec_next_cnt

  # -exec-next-instruction

- gmi_exec_next_instruction

  # -exec-return

- gmi_exec_return

  # -exec-run

- gmi_exec_run

  # -exec-step

- gmi_exec_step

  # -exec-step count

- gmi_exec_step_cnt

  # -exec-step-instruction

- gmi_exec_step_instruction

  # -exec-until

- gmi_exec_until

  # -exec-until (using *address)

- gmi_exec_until_addr

  # -file-exec-and-symbols + -exec-arguments

- gmi_set_exec

  # -file-symbol-file

- gmi_file_symbol_file

  # -gdb-exit

- gmi_gdb_exit

  # -gdb-set

- gmi_gdb_set

  # -gdb-show

- gmi_gdb_show

  # -gdb-version

- gmi_gdb_version

  # -stack-info-depth

- gmi_stack_info_depth

  # -stack-info-depth [no args]

- gmi_stack_info_depth_get

  # -stack-info-frame [using frame]

- gmi_stack_info_frame

  # -stack-list-arguments

- gmi_stack_list_arguments
- gmi_stack_list_arguments_r

  # -stack-list-frames

- gmi_stack_list_frames
- gmi_stack_list_frames_r

  # -stack-list-locals

- gmi_stack_list_locals

  # -stack-select-frame

- gmi_stack_select_frame

  # -target-attach [using attach]

- gmi_target_attach

  # -target-detach

- gmi_target_detach

  # -target-select

- gmi_target_select

  # -thread-list-all-threads

- gmi_thread_list_all_threads

  # -thread-list-ids

- gmi_thread_list_ids

  # -thread-select

- gmi_thread_select

  # -var-assign

- gmi_var_assign

  # -var-create

- gmi_var_create_nm

  # -var-create + -var-info-expression + -var-show-attributes

- gmi_full_var_create

  # -var-create [auto name]

- gmi_var_create

  # -var-delete

- gmi_var_delete

  # -var-evaluate-expression

- gmi_var_evaluate_expression

  # -var-info-expression

- gmi_var_info_expression

  # -var-info-num-children

- gmi_var_info_num_children

  # -var-info-type

- gmi_var_info_type

  # -var-list-children

- gmi_var_list_children

  # -var-set-format

- gmi_var_set_format

  # -var-show-attributes

- gmi_var_show_attributes

  # -var-show-format

- gmi_var_show_format

  # -var-update

- gmi_var_update

  # tty

- gmi_target_terminal

  gmi_break_insert (breakpoint.c 133)
  Syntax

       gmi_break_insert(mi_h *h, const char *file, int line);

  Description

  Insert a breakpoint at file:line.

  Return Value

  A new mi_bkpt structure with info about the breakpoint. NULL on error.

  gmi_break_insert_full (breakpoint.c 150)
  Syntax

       gmi_break_insert_full(mi_h *h, int temporary, int hard_assist, const char *cond, int count, int thread, const char *where);

  Description

  Insert a breakpoint, all available options.

  Return Value

  A new mi_bkpt structure with info about the breakpoint. NULL on error.

  gmi_break_insert_full_fl (breakpoint.c 169)
  Syntax

       gmi_break_insert_full_fl(mi_h *h, const char *file, int line, int temporary, int hard_assist, const char *cond, int count, int thread);

  Description

  Insert a breakpoint, all available options.

  Return Value

  A new mi_bkpt structure with info about the breakpoint. NULL on error.

  gmi_break_delete (breakpoint.c 188)
  Syntax

       gmi_break_delete(mi_h *h, int number);

  Description

  Remove a breakpoint.

  Return Value

  !=0 OK. Note that gdb always says OK, but errors can be sent to the console.

  gmi_break_set_times (breakpoint.c 205)
  Syntax

       gmi_break_set_times(mi_h *h, int number, int count);

  Description

  Modify the "ignore" count for a breakpoint.

  Return Value

  !=0 OK. Note that gdb always says OK, but errors can be sent to the console.

  gmi_break_set_condition (breakpoint.c 221)
  Syntax

       gmi_break_set_condition(mi_h *h, int number, const char *condition);

  Description

  Associate a condition with the breakpoint.

  Return Value

  !=0 OK

  gmi_break_state (breakpoint.c 238)
  Syntax

       gmi_break_state(mi_h *h, int number, int enable);

  Description

  Enable or disable a breakpoint.

  Return Value

  !=0 OK. Note that gdb always says OK, but errors can be sent to the console.

  gmi_break_watch (breakpoint.c 258)
  Syntax

       gmi_break_watch(mi_h *h, enum mi_wp_mode mode, const char *exp);

  Description

  Set a watchpoint. It doesn't work for remote targets!

  Return Value

  A new mi_wp structure with info about the watchpoint. NULL on error.

  mi_connect_local (connect.c 330)
  Syntax

       mi_connect_local();

  Description

  Connect to a local copy of gdb. Note that the mi_h structure is something similar to a "FILE *" for stdio.

  Return Value

  A new mi_h structure or NULL on error.

  mi_disconnect (connect.c 410)
  Syntax

       mi_disconnect(mi_h *h);

  Description

  Close connection. You should ask gdb to quit first gmi_gdb_exit.

  gmi_start_xterm (connect.c 647)
  Syntax

       gmi_start_xterm();

  Description

  Opens a new xterm to be used by the child process to debug.

  Return Value

  A new mi_aux_term structure, you can use gmi_end_aux_term to release it.

  gmi_end_aux_term (connect.c 764)
  Syntax

       gmi_end_aux_term(mi_aux_term *t);

  Description

  Closes the auxiliar terminal and releases the allocated memory.

  mi_force_version (connect.c 781)
  Syntax

       mi_force_version(mi_h *h, unsigned vMajor, unsigned vMiddle, unsigned vMinor);

  Description

  Forces the MI version. Currently the library can't detect it so you must force it manually. GDB 5.x implemented MI v1 and 6.x v2.

  mi_set_workaround (connect.c 794)
  Syntax

       mi_set_workaround(unsigned wa, int enable);

  Description

  Dis/Enables the @var{wa} workaround for a bug in gdb.

  mi_get_workaround (connect.c 813)
  Syntax

       mi_get_workaround(unsigned wa);

  Description

  Finds if the @var{wa} workaround for a bug in gdb is enabled.

  Return Value

  !=0 if enabled.

  MIDebugger (cpp_int.cc 22)
  Syntax

       MIDebugger::MIDebugger();

  Member of the class: MIDebugger

  Description

  Initializes a debugger object. It starts in the "disconnected" state. Use Connect after it.

  ~MIDebugger (cpp_int.cc 40)
  Syntax

       MIDebugger::~MIDebugger();

  Member of the class: MIDebugger

  Description

  This is the destructor for the class. It tries to change the state to "disconnected" doing the needed actions.

  Connect (cpp_int.cc 79)
  Syntax

       MIDebugger::Connect(bool);

  Member of the class: MIDebugger

  Description

  Connects to gdb. Currently only local connections are supported, that's a gdb limitation. Call it when in "unconnected" state, on success it will change to the "connected" state. After it you should call one of the SelectTarget members. SelectTargetX11, SelectTargetLinux or SelectTargetRemote. To finish the connection use Disconnect.

  Return Value

  !=0 OK.

  Disconnect (cpp_int.cc 105)
  Syntax

       MIDebugger::Disconnect();

  Member of the class: MIDebugger

  Description

  Finishes the connection to gdb. Call when in "connected" state, on success it will change to "disconnected" state. This function first tries to exit from gdb and then close the connection. But if gdb fails to exit it will be killed.

  Return Value

  !=0 OK

  SelectTargetTTY (cpp_int.cc 127)
  Syntax

       MIDebugger::SelectTargetTTY(const char *exec, const char *args, const char *auxtty, dMode m);

  Member of the class: MIDebugger

  Description

  Protected member that implements SelectTargetX11 and SelectTargetLinux.

  Return Value

  !=0 OK.

  SelectTargetX11 (cpp_int.cc 180)
  Syntax

       MIDebugger::SelectTargetX11(const char *exec, const char *args, const char *auxtty);

  Member of the class: MIDebugger

  Description

  Starts a debug session for X11. It opens an xterm console for the program to debug and tells gdb which executable to debug and the command line options to pass. You can specify an already existing tty console to be used. Can be called when the state is "connected". On success will change to the "target_specified" state. After it you can use Run or use the members to define breakpoints and similar stuff. To finish it use TargetUnselect.

  Return Value

  !=0 OK.

  SelectTargetLinux (cpp_int.cc 202)
  Syntax

       MIDebugger::SelectTargetLinux(const char *exec, const char *args, const char *auxtty);

  Member of the class: MIDebugger

  Description

  Starts a debug session for Linux console. It selects an empty VT for the program to debug and tells gdb which executable to debug and the command line options to pass. You can specify an already existing tty console to be used. Can be called when the state is "connected". On success will change to the "target_specified" state. After it you can use Run or use the members to define breakpoints and similar stuff. To finish it use TargetUnselect.

  Return Value

  !=0 OK.

  SelectTargetRemote (cpp_int.cc 228)
  Syntax

       MIDebugger::SelectTargetRemote(const char *exec, const char *rparams, const char *rtype);

  Member of the class: MIDebugger

  Description

  Starts a remote session. The other end should be running gdbserver. You must specify a local copy of the program to debug with debug info. The remote copy can be stripped. The @var{rtype} and @var{rparams} selects the protocol and the remote machine. Read gdb docs to know more about the available options. If @var{rtype} is omitted "extended-remote" protocol is used. Can be called when the state is "connected". On success will change to the "target_specified" state. After it you can use Run or use the members to define breakpoints and similar stuff. To finish it use TargetUnselect. Note that when gdb uses remote debugging the remote program starts running. The Run member knows about it.

  Return Value

  !=0 OK.

  Example

  o->SelectTargetRemote("./exec_file","192.168.1.65:5000");

  SelectTargetPID (cpp_int.cc 258)
  Syntax

       MIDebugger::SelectTargetPID(const char *exec, int pid);

  Member of the class: MIDebugger

  Description

  Starts a local session using an already running process.

  Return Value

  !=0 OK.

  TargetUnselect (cpp_int.cc 295)
  Syntax

       MIDebugger::TargetUnselect();

  Member of the class: MIDebugger

  Description

  Used to unselect the current target. When X11 mode it closes the auxiliar terminal. For remote debugging it uses "detach". Can be called when in "target_specified" state. On success it changes to "connected" state.

  Return Value

  !=0 OK

  Run (cpp_int.cc 335)
  Syntax

       MIDebugger::Run();

  Member of the class: MIDebugger

  Description

  Starts running the program. You should set breakpoint before it. Can be called when state is "target_specified". On success will change to "running" state. After it you should poll for async responses using Poll. The program can stop for many reasons asynchronously and also exit. This information is known using Poll. You can stop the program using Stop.

  Return Value

  !=0 OK.

  Stop (cpp_int.cc 365)
  Syntax

       MIDebugger::Stop();

  Member of the class: MIDebugger

  Description

  Stops the program execution. GDB sends an interrupt signal to the program. Can be called when the state is "running". It won't switch to "stopped" state automatically. Instead you must poll for async events and wait for a stopped notification. After it you can call Continue to resume execution.

  Return Value

  Example

  !=0 OK

  Poll (cpp_int.cc 386)
  Syntax

       MIDebugger::Poll(mi_stop *&rs);

  Member of the class: MIDebugger

  Description

  Polls gdb looking for async responses. Currently it just looks for "stopped" messages. You must call it when the state is "running". But the function will poll gdb even if the state isn't "running". When a stopped message is received the state changes to stopped or target_specified (the last is when we get some exit).

  Return Value

  !=0 if we got a response. The @var{rs} pointer will point to an mi_stop structure if we got it or will be NULL if we didn't.

  Continue (cpp_int.cc 432)
  Syntax

       MIDebugger::Continue();

  Member of the class: MIDebugger

  Description

  Resumes execution after the program "stopped". Can be called when the state is stopped. On success will change to "running" state.

  Return Value

  !=0 OK

  RunOrContinue (cpp_int.cc 454)
  Syntax

       MIDebugger::RunOrContinue();

  Member of the class: MIDebugger

  Description

  Starts program execution or resumes it. When the state is target_specified it calls Run otherwise it uses Continue. Can be called when the state is "target_specified" or "stopped". On success will change to "running" state.

  Return Value

  !=0 OK

  Kill (cpp_int.cc 473)
  Syntax

       MIDebugger::Kill();

  Member of the class: MIDebugger

  Description

  Kills the program you are debugging. Can be called when the state is "stopped" or "running". On success changes the state to "target_specified". Note that if you want to restart the program you can just call Run and if you want to just stop the program call Stop.

  Return Value

  !=0 OK

  Breakpoint (cpp_int.cc 520)
  Syntax

       MIDebugger::Breakpoint(const char *file, int line);

  Member of the class: MIDebugger

  Description

  Inserts a breakpoint at @var{file} and @var{line}. Can be called when the state is "stopped" or "target_specified".

  Return Value

  An mi_bkpt structure or NULL if error.

  Breakpoint (cpp_int.cc 537)
  Syntax

       MIDebugger::Breakpoint(const char *where, bool temporary, const char *cond, int count, int thread, bool hard_assist);

  Member of the class: MIDebugger

  Description

  Inserts a breakpoint at @var{where}, all options available. Can be called when the state is "stopped" or "target_specified".

  Return Value

  An mi_bkpt structure or NULL if error.

  BreakpointFull (cpp_int.cc 585)
  Syntax

       MIDebugger::BreakpointFull(const char *file, int line, bool temporary, const char *cond, int count, int thread, bool hard_assist);

  Member of the class: MIDebugger

  Description

  Inserts a breakpoint at @var{file} and @var{line} all options available. Can be called when the state is "stopped" or "target_specified".

  Return Value

  An mi_bkpt structure or NULL if error.

  BreakDelete (cpp_int.cc 605)
  Syntax

       MIDebugger::BreakDelete(mi_bkpt *b);

  Member of the class: MIDebugger

  Description

  Removes the specified breakpoint. It doesn't free the structure. Can be called when the state is "stopped" or "target_specified".

  Return Value

  !=0 OK

  Watchpoint (cpp_int.cc 622)
  Syntax

       MIDebugger::Watchpoint(enum mi_wp_mode mode, const char *exp);

  Member of the class: MIDebugger

  Description

  Inserts a watchpoint for the specified expression. Can be called when the state is "stopped" or "target_specified".

  Return Value

  An mi_wp structure or NULL if error.

  WatchDelete (cpp_int.cc 639)
  Syntax

       MIDebugger::WatchDelete(mi_wp *w);

  Member of the class: MIDebugger

  Description

  Removes the specified watchpoint. It doesn't free the structure. Can be called when the state is "stopped" or "target_specified".

  Return Value

  !=0 OK

  RunToMain (cpp_int.cc 657)
  Syntax

       MIDebugger::RunToMain();

  Member of the class: MIDebugger

  Description

  Puts a temporal breakpoint in main function and starts running. Can be called when the state is "target_specified". If successful the state will change to "running".

  Return Value

  !=0 OK

  StepOver (cpp_int.cc 681)
  Syntax

       MIDebugger::StepOver(bool inst);

  Member of the class: MIDebugger

  Description

  Executes upto the next line, doesn't follow function calls. The @var{inst} argument is for assembler. If the state is "target_specified" it will go to the first line in the main function. If the state is "stopped" will use the next command. If successfully the state will change to "running".

  Return Value

  !=0 OK

  GoTo (cpp_int.cc 713)
  Syntax

       MIDebugger::GoTo(const char *file, int line);

  Member of the class: MIDebugger

  Description

  Executes until the specified point. If the state is "target_specified" it uses a temporal breakpoint. If the state is "stopped" it uses -exec-until. Fails for any other state.

  Return Value

  !=0 OK

  GoTo (cpp_int.cc 751)
  Syntax

       MIDebugger::GoTo(void *addr);

  Member of the class: MIDebugger

  Description

  Executes until the specified point. If the state is "target_specified" it uses a temporal breakpoint. If the state is "stopped" it uses -exec-until. Fails for any other state.

  Return Value

  !=0 OK

  FinishFun (cpp_int.cc 788)
  Syntax

       MIDebugger::FinishFun();

  Member of the class: MIDebugger

  Description

  Resumes execution until the end of the current funtion is reached. Only usable when we are in the "stopped" state.

  Return Value

  !=0 OK

  ReturnNow (cpp_int.cc 808)
  Syntax

       MIDebugger::ReturnNow();

  Member of the class: MIDebugger

  Description

  Return Value

  !=NULL OK, the returned frame is the current location. That's a synchronous function.

  CallStack (cpp_int.cc 824)
  Syntax

       MIDebugger::CallStack(bool args);

  Member of the class: MIDebugger

  Description

  Return Value

  !=NULL OK, the list of frames is returned.

  TraceInto (cpp_int.cc 860)
  Syntax

       MIDebugger::TraceInto(bool inst);

  Member of the class: MIDebugger

  Description

  Executes upto the next line, it follows function calls. The @var{inst} argument is for assembler. If the state is "target_specified" it will go to the first line in the main function. If the state is "stopped" will use the next command. If successfully the state will change to "running".

  Return Value

  !=0 OK

  EvalExpression (cpp_int.cc 892)
  Syntax

       MIDebugger::EvalExpression(const char *exp);

  Member of the class: MIDebugger

  Description

  Evaluates the provided expression. If we get an error the error description is returned instead. Can't be called if "disconnected" or "running".

  Return Value

  The result of the expression (use free) or NULL.

  ModifyExpression (cpp_int.cc 918)
  Syntax

       MIDebugger::ModifyExpression(char *exp, char *newVal);

  Member of the class: MIDebugger

  Description

  Modifies the provided expression. If we get an error the error description is returned instead. Can't be called if "disconnected" or "running".

  Return Value

  The result of the expression (use free) or NULL.

  Send (cpp_int.cc 950)
  Syntax

       MIDebugger::Send(const char *command);

  Member of the class: MIDebugger

  Description

  Sends a command to gdb.

  Return Value

  !=0 OK

  FillTypeVal (cpp_int.cc 970)
  Syntax

       MIDebugger::FillTypeVal(mi_gvar *var);

  Member of the class: MIDebugger

  Description

  Fills the type and value fields of the mi_gvar provided list.

  Return Value

  !=0 OK

  gmi_data_evaluate_expression (data_man.c 163)
  Syntax

       gmi_data_evaluate_expression(mi_h *h, const char *expression);

  Description

  Evaluate an expression. Returns a parsed tree.

  Return Value

  The resulting value (as plain text) or NULL on error.

  gmi_dir (data_man.c 180)
  Syntax

       gmi_dir(mi_h *h, const char *path);

  Description

  Path for sources. You must use it to indicate where are the sources for the program to debug. Only the MI v1 implementation is available.

  Return Value

  !=0 OK

  mi_get_error_str (error.c 10)
  Syntax

       mi_get_error_str();

  mi_look_for_free_pty (get_free_pty.c 41)
  Syntax

       mi_look_for_free_pty(int *master, char **slave);

  Description

  Look for a free and usable pseudo terminal. Low level, use gmi_look_for_free_pty.

  Return Value

  A file descriptor connected to the master pty and the name of the slave device, or <0 on error.

  gmi_look_for_free_pty (get_free_pty.c 92)
  Syntax

       gmi_look_for_free_pty();

  Description

  Look for a free and usable pseudo terminal to be used by the child.

  Return Value

  A new mi_pty structure, you can use gmi_end_pty to release it.

  gmi_end_pty (get_free_pty.c 124)
  Syntax

       gmi_end_pty(mi_pty *p);

  Description

  Closes the pseudo termial master and releases the allocated memory.

  mi_look_for_free_vt (get_free_vt.c 51)
  Syntax

       mi_look_for_free_vt() 53;

  Description

  Look for a free and usable Linux VT. Low level, use gmi_look_for_free_vt.

  Return Value

  The VT number or <0 on error.

  gmi_look_for_free_vt (get_free_vt.c 135)
  Syntax

       gmi_look_for_free_vt() 137;

  Description

  Look for a free and usable Linux VT to be used by the child.

  Return Value

  A new mi_aux_term structure, you can use gmi_end_aux_term to release it.

  gmi_gdb_exit (misc.c 54)
  Syntax

       gmi_gdb_exit(mi_h *h);

  Description

  Exit gdb killing the child is it is running.

  gmi_gdb_version (misc.c 70)
  Syntax

       gmi_gdb_version(mi_h *h);

  Description

  Send the version to the console.

  Return Value

  !=0 OK

  gmi_gdb_set (misc.c 86)
  Syntax

       gmi_gdb_set(mi_h *h, const char *var, const char *val);

  Description

  Set a gdb variable.

  Return Value

  !=0 OK

  gmi_gdb_show (misc.c 102)
  Syntax

       gmi_gdb_show(mi_h *h, const char *var);

  Description

  Get a gdb variable.

  Return Value

  The current value of the variable or NULL on error.

  gmi_set_exec (prg_control.c 172)
  Syntax

       gmi_set_exec(mi_h *h, const char *file, const char *args);

  Description

  Specify the executable and arguments for local debug.

  Return Value

  !=0 OK

  gmi_exec_run (prg_control.c 193)
  Syntax

       gmi_exec_run(mi_h *h);

  Description

  Start running the executable. Remote sessions starts running.

  Return Value

  !=0 OK

  gmi_exec_continue (prg_control.c 209)
  Syntax

       gmi_exec_continue(mi_h *h);

  Description

  Continue the execution after a "stop".

  Return Value

  !=0 OK

  gmi_target_terminal (prg_control.c 226)
  Syntax

       gmi_target_terminal(mi_h *h, const char *tty_name);

  Description

  Indicate which terminal will use the target program. For local sessions.

  Return Value

  !=0 OK

  Example

  gmi_file_symbol_file (prg_control.c 242)
  Syntax

       gmi_file_symbol_file(mi_h *h, const char *file);

  Description

  Specify what's the local copy that have debug info. For remote sessions.

  Return Value

  !=0 OK

  gmi_exec_finish (prg_control.c 259)
  Syntax

       gmi_exec_finish(mi_h *h);

  Description

  Continue until function return, the return value is included in the async response.

  Return Value

  !=0 OK.

  gmi_exec_interrupt (prg_control.c 278)
  Syntax

       gmi_exec_interrupt(mi_h *h);

  Description

  Stop the program using SIGINT. The corresponding command should be -exec-interrupt but not even gdb 6.1.1 can do it because the "async" mode isn't really working.

  Return Value

  Always 1

  Example

  gmi_exec_next (prg_control.c 299)
  Syntax

       gmi_exec_next(mi_h *h);

  Description

  Next line of code.

  Return Value

  !=0 OK

  gmi_exec_next_cnt (prg_control.c 315)
  Syntax

       gmi_exec_next_cnt(mi_h *h, int count);

  Description

  Skip count lines of code.

  Return Value

  !=0 OK

  gmi_exec_next_instruction (prg_control.c 331)
  Syntax

       gmi_exec_next_instruction(mi_h *h);

  Description

  Next line of assembler code.

  Return Value

  !=0 OK

  gmi_exec_step (prg_control.c 347)
  Syntax

       gmi_exec_step(mi_h *h);

  Description

  Next line of code. Get inside functions.

  Return Value

  !=0 OK

  gmi_exec_step_cnt (prg_control.c 363)
  Syntax

       gmi_exec_step_cnt(mi_h *h, int count);

  Description

  Next count lines of code. Get inside functions.

  Return Value

  !=0 OK

  gmi_exec_step_instruction (prg_control.c 379)
  Syntax

       gmi_exec_step_instruction(mi_h *h);

  Description

  Next line of assembler code. Get inside calls.

  Return Value

  !=0 OK

  gmi_exec_until (prg_control.c 396)
  Syntax

       gmi_exec_until(mi_h *h, const char *file, int line);

  Description

  Execute until location is reached. If file is NULL then is until next line.

  Return Value

  !=0 OK

  gmi_exec_until_addr (prg_control.c 412)
  Syntax

       gmi_exec_until_addr(mi_h *h, void *addr);

  Description

  Execute until location is reached.

  Return Value

  !=0 OK

  gmi_exec_return (prg_control.c 429)
  Syntax

       gmi_exec_return(mi_h *h);

  Description

  Return Value

  A pointer to a new mi_frames structure indicating the current location. NULL on error.

  gmi_exec_kill (prg_control.c 447)
  Syntax

       gmi_exec_kill(mi_h *h);

  Description

  Just kill the program. That's what -exec-abort should do, but it isn't implemented by gdb. This implementation only works if the interactive mode is disabled (gmi_gdb_set("confirm","off")).

  Return Value

  !=0 OK

  gmi_stack_list_frames (stack_man.c 76)
  Syntax

       gmi_stack_list_frames(mi_h *h);

  Description

  List of frames. Arguments aren't filled.

  Return Value

  A new list of mi_frames or NULL on error.

  gmi_stack_list_frames_r (stack_man.c 93)
  Syntax

       gmi_stack_list_frames_r(mi_h *h, int from, int to);

  Description

  List of frames. Arguments aren't filled. Only the frames in the @var{from} - @var{to} range are returned.

  Return Value

  A new list of mi_frames or NULL on error.

  gmi_stack_list_arguments (stack_man.c 109)
  Syntax

       gmi_stack_list_arguments(mi_h *h, int show);

  Description

  List arguments. Only @var{level} and @var{args} filled.

  Return Value

  A new list of mi_frames or NULL on error.

  gmi_stack_list_arguments_r (stack_man.c 126)
  Syntax

       gmi_stack_list_arguments_r(mi_h *h, int show, int from, int to);

  Description

  List arguments. Only @var{level} and @var{args} filled. Only for the frames in the @var{from} - @var{to} range.

  Return Value

  A new list of mi_frames or NULL on error.

  gmi_stack_info_frame (stack_man.c 142)
  Syntax

       gmi_stack_info_frame(mi_h *h);

  Description

  Information about the current frame, including args.

  Return Value

  A new mi_frames or NULL on error.

  gmi_stack_info_depth (stack_man.c 158)
  Syntax

       gmi_stack_info_depth(mi_h *h, int max_depth);

  Description

  Stack info depth.

  Return Value

  The depth or -1 on error.

  gmi_stack_info_depth_get (stack_man.c 184)
  Syntax

       gmi_stack_info_depth_get(mi_h *h);

  Description

  Set stack info depth.

  Return Value

  The depth or -1 on error.

  Example

  gmi_stack_select_frame (stack_man.c 199)
  Syntax

       gmi_stack_select_frame(mi_h *h, int framenum);

  Description

  Change current frame.

  Return Value

  !=0 OK

  gmi_stack_list_locals (stack_man.c 215)
  Syntax

       gmi_stack_list_locals(mi_h *h, int show);

  Description

  List of local vars.

  Return Value

  A new mi_results tree containing the variables or NULL on error.

  gmi_target_select (target_man.c 54)
  Syntax

       gmi_target_select(mi_h *h, const char *type, const char *params);

  Description

  Connect to a remote gdbserver using the specified methode.

  Return Value

  !=0 OK

  gmi_target_attach (target_man.c 70)
  Syntax

       gmi_target_attach(mi_h *h, pid_t pid);

  Description

  Attach to an already running process.

  Return Value

  The frame of the current location, NULL on error.

  gmi_target_detach (target_man.c 87)
  Syntax

       gmi_target_detach(mi_h *h);

  Description

  Detach from an attached process.

  Return Value

  !=0 OK

  gmi_thread_list_ids (thread.c 49)
  Syntax

       gmi_thread_list_ids(mi_h *h, int **list);

  Description

  List available thread ids.

  Return Value

  !=0 OK

  gmi_thread_select (thread.c 65)
  Syntax

       gmi_thread_select(mi_h *h, int id);

  Description

  Select a thread.

  Return Value

  A new mi_frames or NULL on error.

  gmi_thread_list_all_threads (thread.c 82)
  Syntax

       gmi_thread_list_all_threads(mi_h *h);

  Description

  Get a list of frames for each available thread. Implemented using "info thread".

  Return Value

  A kist of frames, NULL on error

  gmi_var_create_nm (var_obj.c 122)
  Syntax

       gmi_var_create_nm(mi_h *h, const char *name, int frame, const char *exp);

  Description

  Create a variable object. I recommend using gmi_var_create and letting gdb choose the names.

  Return Value

  A new mi_gvar strcture or NULL on error.

  gmi_var_create (var_obj.c 139)
  Syntax

       gmi_var_create(mi_h *h, int frame, const char *exp);

  Description

  Create a variable object. The name is selected by gdb. Alternative: gmi_full_var_create.

  Return Value

  A new mi_gvar strcture or NULL on error.

  gmi_var_delete (var_obj.c 154)
  Syntax

       gmi_var_delete(mi_h *h, mi_gvar *var);

  Description

  Delete a variable object. Doesn't free the mi_gvar data.

  Return Value

  !=0 OK

  gmi_var_set_format (var_obj.c 170)
  Syntax

       gmi_var_set_format(mi_h *h, mi_gvar *var, enum mi_gvar_fmt format);

  Description

  Set the format used to represent the result.

  Return Value

  !=0 OK

  gmi_var_show_format (var_obj.c 191)
  Syntax

       gmi_var_show_format(mi_h *h, mi_gvar *var);

  Description

  Fill the format field with info from gdb.

  Return Value

  !=0 OK.

  gmi_var_info_num_children (var_obj.c 207)
  Syntax

       gmi_var_info_num_children(mi_h *h, mi_gvar *var);

  Description

  Fill the numchild field with info from gdb.

  Return Value

  !=0 OK

  gmi_var_info_type (var_obj.c 223)
  Syntax

       gmi_var_info_type(mi_h *h, mi_gvar *var);

  Description

  Fill the type field with info from gdb.

  Return Value

  !=0 OK

  gmi_var_info_expression (var_obj.c 240)
  Syntax

       gmi_var_info_expression(mi_h *h, mi_gvar *var);

  Description

  Fill the expression and lang fields with info from gdb. Note that lang isn't filled during creation.

  Return Value

  !=0 OK

  gmi_var_show_attributes (var_obj.c 258)
  Syntax

       gmi_var_show_attributes(mi_h *h, mi_gvar *var);

  Description

  Fill the attr field with info from gdb. Note that attr isn't filled during creation.

  Return Value

  !=0 OK

  gmi_full_var_create (var_obj.c 275)
  Syntax

       gmi_full_var_create(mi_h *h, int frame, const char *exp);

  Description

  Create the variable and also fill the lang and attr fields. The name is selected by gdb.

  Return Value

  A new mi_gvar strcture or NULL on error.

  gmi_var_update (var_obj.c 297)
  Syntax

       gmi_var_update(mi_h *h, mi_gvar *var, mi_gvar_chg **changed);

  Description

  Update variable. Use NULL for all. Note that *changed can be NULL if none updated.

  Return Value

  !=0 OK. The @var{changed} list contains the list of changed vars.

  gmi_var_assign (var_obj.c 313)
  Syntax

       gmi_var_assign(mi_h *h, mi_gvar *var, const char *expression);

  Description

  Change variable. The new value replaces the @var{value} field.

  Return Value

  !=0 OK

  gmi_var_evaluate_expression (var_obj.c 337)
  Syntax

       gmi_var_evaluate_expression(mi_h *h, mi_gvar *var);

  Description

  Fill the value field getting the current value for a variable.

  Return Value

  !=0 OK, value contains the result.

  gmi_var_list_children (var_obj.c 362)
  Syntax

       gmi_var_list_children(mi_h *h, mi_gvar *var);

  Description

  List children. It ONLY returns the first level information. :-(
  On success the child field contains the list of children.

  Return Value

  !=0 OK