Re: GDB MI Reverse Commands added [1 of 3]

Michael Snyder
2009-08-27T00:46:48Z

Jakob Engblom wrote:
> Here are the patches adding the MI commands for reverse execution to gdb.
>
> Changelog entry: "Added reverse debugging support to gdb MI"

Jakob, thanks for this contribution. We need an actual
contributor's name for the changelog! Here's the format:

2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>

* mi/mi-main.c (mi_cmd_data_list_register_names): Use selected
frame architecture instead of current_gdbarch.
(mi_cmd_data_list_changed_registers): Likewise.
(mi_cmd_data_list_register_values): Likewise. Pass selected
frame to get_register.

By the way, some of these changes don't actually seem to change
anything. I guess we can apply them as is, but could you just
check to see if something went wrong or got left out?

I'm looking at for instance these...

> *************** mi_cmd_exec_interrupt (char *command, ch
> *** 252,258 ****
> {
> if (!any_running ())
> error ("Inferior not running.");
> !
> interrupt_target_1 (1);
> }
> else if (argc == 2 && strcmp (argv[0], "--thread-group") == 0)
> --- 307,313 ----
> {
> if (!any_running ())
> error ("Inferior not running.");
> !
> interrupt_target_1 (1);
> }
> else if (argc == 2 && strcmp (argv[0], "--thread-group") == 0)
> *************** void
> *** 349,355 ****
> mi_cmd_thread_info (char *command, char **argv, int argc)
> {
> int thread = -1;
> !
> if (argc != 0 && argc != 1)
> error ("Invalid MI command");
>
> --- 404,410 ----
> mi_cmd_thread_info (char *command, char **argv, int argc)
> {
> int thread = -1;
> !
> if (argc != 0 && argc != 1)
> error ("Invalid MI command");
>
> *************** print_one_inferior (struct inferior *inf
> *** 367,373 ****
> ui_out_field_fmt (uiout, "id", "%d", inferior->pid);
> ui_out_field_string (uiout, "type", "process");
> ui_out_field_int (uiout, "pid", inferior->pid);
> !
> do_cleanups (back_to);
> return 0;
> }
> --- 422,428 ----
> ui_out_field_fmt (uiout, "id", "%d", inferior->pid);
> ui_out_field_string (uiout, "type", "process");
> ui_out_field_int (uiout, "pid", inferior->pid);
> !
> do_cleanups (back_to);
> return 0;
> }
> *************** mi_cmd_list_thread_groups (char *command
> *** 433,446 ****
> int pid = atoi (id);
> if (!in_inferior_list (pid))
> error ("Invalid thread group id '%s'", id);
> ! print_thread_info (uiout, -1, pid);
> }
> else
> {
> make_cleanup_ui_out_list_begin_end (uiout, "groups");
> iterate_over_inferiors (print_one_inferior, NULL);
> }
> !
> do_cleanups (back_to);
> }
>
> --- 488,501 ----
> int pid = atoi (id);
> if (!in_inferior_list (pid))
> error ("Invalid thread group id '%s'", id);
> ! print_thread_info (uiout, -1, pid);
> }
> else
> {
> make_cleanup_ui_out_list_begin_end (uiout, "groups");
> iterate_over_inferiors (print_one_inferior, NULL);
> }
> !
> do_cleanups (back_to);
> }
>
> *************** get_register (struct frame_info *frame,
> *** 713,719 ****
> }
>
> /* Write given values into registers. The registers and values are
> ! given as pairs. The corresponding MI command is
> -data-write-register-values <format> [<regnum1> <value1>...<regnumN>
> <valueN>]*/
> void
> mi_cmd_data_write_register_values (char *command, char **argv, int argc)
> --- 768,774 ----
> }
>
> /* Write given values into registers. The registers and values are
> ! given as pairs. The corresponding MI command is
> -data-write-register-values <format> [<regnum1> <value1>...<regnumN>
> <valueN>]*/
> void
> mi_cmd_data_write_register_values (char *command, char **argv, int argc)
> *************** mi_cmd_data_evaluate_expression (char *c
> *** 810,816 ****
> /* DATA-MEMORY-READ:
>
> ADDR: start address of data to be dumped.
> ! WORD-FORMAT: a char indicating format for the ``word''. See
> the ``x'' command.
> WORD-SIZE: size of each ``word''; 1,2,4, or 8 bytes.
> NR_ROW: Number of rows.
> --- 865,871 ----
> /* DATA-MEMORY-READ:
>
> ADDR: start address of data to be dumped.
> ! WORD-FORMAT: a char indicating format for the ``word''. See
> the ``x'' command.
> WORD-SIZE: size of each ``word''; 1,2,4, or 8 bytes.
> NR_ROW: Number of rows.
> *************** mi_cmd_data_evaluate_expression (char *c
> *** 823,829 ****
>
> {addr="...",rowN={wordN="..." ,... [,ascii="..."]}, ...}
>
> ! Returns:
> The number of bytes read is SIZE*ROW*COL. */
>
> void
> --- 878,884 ----
>
> {addr="...",rowN={wordN="..." ,... [,ascii="..."]}, ...}
>
> ! Returns:
> The number of bytes read is SIZE*ROW*COL. */
>
> void
> *************** mi_cmd_data_read_memory (char *command,
> *** 1019,1025 ****
> ADDR: start address of the row in the memory grid where the memory
> cell is, if OFFSET_COLUMN is specified. Otherwise, the address of
> the location to write to.
> ! FORMAT: a char indicating format for the ``word''. See
> the ``x'' command.
> WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes
> VALUE: value to be written into the memory address.
> --- 1074,1080 ----
> ADDR: start address of the row in the memory grid where the memory
> cell is, if OFFSET_COLUMN is specified. Otherwise, the address of
> the location to write to.
> ! FORMAT: a char indicating format for the ``word''. See
> the ``x'' command.
> WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes
> VALUE: value to be written into the memory address.
> *************** mi_cmd_enable_timings (char *command, ch
> *** 1112,1118 ****
> }
> else
> goto usage_error;
> !
> return;
>
> usage_error:
> --- 1167,1173 ----
> }
> else
> goto usage_error;
> !
> return;
>
> usage_error:
> *************** mi_cmd_list_features (char *command, cha
> *** 1125,1140 ****
> if (argc == 0)
> {
> struct cleanup *cleanup = NULL;
> ! cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
>
> ui_out_field_string (uiout, NULL, "frozen-varobjs");
> ui_out_field_string (uiout, NULL, "pending-breakpoints");
> ui_out_field_string (uiout, NULL, "thread-info");
> !
> #if HAVE_PYTHON
> ui_out_field_string (uiout, NULL, "python");
> #endif
> !
> do_cleanups (cleanup);
> return;
> }
> --- 1180,1195 ----
> if (argc == 0)
> {
> struct cleanup *cleanup = NULL;
> ! cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
>
> ui_out_field_string (uiout, NULL, "frozen-varobjs");
> ui_out_field_string (uiout, NULL, "pending-breakpoints");
> ui_out_field_string (uiout, NULL, "thread-info");
> !
> #if HAVE_PYTHON
> ui_out_field_string (uiout, NULL, "python");
> #endif
> !
> do_cleanups (cleanup);
> return;
> }
> *************** mi_cmd_list_target_features (char *comma
> *** 1148,1158 ****
> if (argc == 0)
> {
> struct cleanup *cleanup = NULL;
> ! cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
>
> if (target_can_async_p ())
> ui_out_field_string (uiout, NULL, "async");
> !
> do_cleanups (cleanup);
> return;
> }
> --- 1203,1213 ----
> if (argc == 0)
> {
> struct cleanup *cleanup = NULL;
> ! cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
>
> if (target_can_async_p ())
> ui_out_field_string (uiout, NULL, "async");
> !
> do_cleanups (cleanup);
> return;
> }

... and so on...