From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20965 invoked by alias); 26 Aug 2009 14:38:10 -0000 Received: (qmail 20935 invoked by uid 22791); 26 Aug 2009 14:38:06 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from vtab.com (HELO oden.vtab.com) (62.20.90.195) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Aug 2009 14:37:58 +0000 Received: from oden.vtab.com (oden.vtab.com [127.0.0.1]) by oden.vtab.com (Postfix) with ESMTP id 7891626EF82 for ; Wed, 26 Aug 2009 16:37:55 +0200 (CEST) Received: from polhem (unknown [62.20.90.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by oden.vtab.com (Postfix) with ESMTP id 055BD26EEFD for ; Wed, 26 Aug 2009 16:37:55 +0200 (CEST) From: "Jakob Engblom" To: Subject: GDB MI Reverse Commands added [1 of 3] Date: Wed, 26 Aug 2009 14:38:00 -0000 Message-ID: <00ce01ca265a$ccb66ca0$662345e0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00443.txt.bz2 Here are the patches adding the MI commands for reverse execution to gdb. Changelog entry: "Added reverse debugging support to gdb MI" cvs diff: Diffing gdb/mi Index: gdb/mi/mi-main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.156 diff -c -p -r1.156 mi-main.c *** gdb/mi/mi-main.c=A0=A0=A0 2 Jul 2009 17:25:59 -0000=A0=A0=A0=A0=A0=A0 1= .156 --- gdb/mi/mi-main.c=A0=A0=A0 25 Aug 2009 14:40:18 -0000 *************** static void mi_cmd_execute (struct mi_pa *** 88,94 **** =A0 static void mi_execute_cli_command (const char *cmd, int args_p, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 const char *args); ! static void mi_execute_async_cli_command (char *cli_command, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0char **argv, int argc); =A0 static int register_changed_p (int regnum, struct regcache *, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 struct regcache *); --- 88,94 ---- =A0 static void mi_execute_cli_command (const char *cmd, int args_p, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 const char *args); ! static void mi_execute_async_cli_command (char *cli_command, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 char **argv, int argc); =A0 static int register_changed_p (int regnum, struct regcache *, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 struct regcache *); *************** void *** 119,153 **** =A0 mi_cmd_exec_next (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 mi_execute_async_cli_command ("next", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_next_instruction (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 mi_execute_async_cli_command ("nexti", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_step (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 mi_execute_async_cli_command ("step", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_step_instruction (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 mi_execute_async_cli_command ("stepi", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_finish (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 mi_execute_async_cli_command ("finish", argv, argc); =A0 } =A0 void --- 119,168 ---- =A0 mi_cmd_exec_next (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 if (argc > 0 && strcmp(argv[0], "--reverse") =3D=3D 0) !=A0=A0=A0=A0 mi_execute_async_cli_command ("reverse-next", argv + 1, argc = - 1); !=A0=A0 else !=A0=A0=A0=A0 mi_execute_async_cli_command ("next", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_next_instruction (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 if (argc > 0 && strcmp(argv[0], "--reverse") =3D=3D 0) !=A0=A0=A0=A0 mi_execute_async_cli_command ("reverse-nexti", argv + 1, argc= - 1); !=A0=A0 else ! =A0=A0=A0=A0mi_execute_async_cli_command ("nexti", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_step (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 if (argc > 0 && strcmp(argv[0], "--reverse") =3D=3D 0) !=A0 =A0=A0=A0mi_execute_async_cli_command ("reverse-step", argv + 1, argc = - 1); !=A0=A0 else !=A0=A0=A0=A0 mi_execute_async_cli_command ("step", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_step_instruction (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 if (argc > 0 && strcmp(argv[0], "--reverse") =3D=3D 0) !=A0=A0=A0=A0 mi_execute_async_cli_command ("reverse-stepi", argv + 1, argc= - 1); !=A0=A0 else !=A0=A0=A0=A0 mi_execute_async_cli_command ("stepi", argv, argc); =A0 } =A0 void =A0 mi_cmd_exec_finish (char *command, char **argv, int argc) =A0 { =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ !=A0=A0 if (argc > 0 && strcmp(argv[0], "--reverse") =3D=3D 0) !=A0=A0=A0=A0 mi_execute_async_cli_command ("reverse-finish", argv + 1, arg= c - 1); !=A0=A0 else !=A0=A0=A0=A0 mi_execute_async_cli_command ("finish", argv, argc); =A0 } =A0 void *************** mi_cmd_exec_jump (char *args, char **arg *** 175,181 **** =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ =A0=A0=A0 return mi_execute_async_cli_command ("jump", argv, argc); =A0 } ! =A0 static int =A0 proceed_thread_callback (struct thread_info *thread, void *arg) =A0 { --- 190,196 ---- =A0=A0=A0 /* FIXME: Should call a libgdb function, not a cli wrapper.=A0 */ =A0=A0=A0 return mi_execute_async_cli_command ("jump", argv, argc); =A0 } ! =A0 static int =A0 proceed_thread_callback (struct thread_info *thread, void *arg) =A0 { *************** proceed_thread_callback (struct thread_i *** 193,200 **** =A0=A0=A0 return 0; =A0 } ! void ! mi_cmd_exec_continue (char *command, char **argv, int argc) =A0 { =A0=A0=A0 if (argc =3D=3D 0) =A0=A0=A0=A0=A0 continue_1 (0); --- 208,215 ---- =A0=A0=A0 return 0; =A0 } ! static void ! exec_continue (char **argv, int argc) =A0 { =A0=A0=A0 if (argc =3D=3D 0) =A0=A0=A0=A0=A0 continue_1 (0); *************** mi_cmd_exec_continue (char *command, cha *** 212,221 **** =A0=A0=A0=A0=A0 =A0=A0old_chain =3D make_cleanup_restore_current_thread (); =A0=A0=A0=A0=A0=A0=A0 iterate_over_threads (proceed_thread_callback, &pid); !=A0=A0=A0=A0=A0=A0 do_cleanups (old_chain); =A0=A0=A0=A0=A0 } =A0=A0=A0 else !=A0=A0=A0=A0 error ("Usage: -exec-continue [--all|--thread-group id]"); =A0 } =A0 static int --- 227,276 ---- =A0=A0=A0=A0=A0=A0=A0 old_chain =3D make_cleanup_restore_current_thread (); =A0=A0=A0=A0=A0=A0=A0 iterate_over_threads (proceed_thread_callback, &pid); !=A0=A0=A0=A0=A0=A0 do_cleanups (old_chain); =A0=A0=A0=A0=A0 } =A0=A0=A0 else !=A0=A0=A0=A0 error ("Usage: -exec-continue [--reverse] [--all|--thread-gro= up id]"); ! } ! ! /* continue in reverse direction: !=A0=A0=A0 XXX: code duplicated from reverse.c */ ! ! static void ! exec_direction_default (void *notused) ! { !=A0=A0 /* Return execution direction to default state.=A0 */ !=A0=A0 execution_direction =3D EXEC_FORWARD; ! } ! ! static void ! exec_reverse_continue (char **argv, int argc) ! { !=A0=A0 enum exec_direction_kind dir =3D execution_direction; !=A0=A0 struct cleanup *old_chain; ! !=A0=A0 if (dir =3D=3D EXEC_ERROR) !=A0=A0=A0=A0 error (_("Target %s does not support this command."), target_= shortname); ! !=A0=A0 if (dir =3D=3D EXEC_REVERSE) !=A0=A0=A0=A0 error (_("Already in reverse mode.")); ! !=A0=A0 if (!target_can_execute_reverse) !=A0=A0=A0=A0 error (_("Target %s does not support this command."), target_= shortname); ! !=A0=A0 old_chain =3D make_cleanup (exec_direction_default, NULL); !=A0=A0 execution_direction =3D EXEC_REVERSE; !=A0=A0 exec_continue (argv, argc); !=A0=A0 do_cleanups (old_chain); ! } ! ! void ! mi_cmd_exec_continue (char *command, char **argv, int argc) ! { !=A0=A0 if (argc > 0 && strcmp(argv[0], "--reverse") =3D=3D 0) !=A0=A0=A0=A0 exec_reverse_continue (argv + 1, argc - 1); !=A0=A0 else !=A0=A0=A0=A0 exec_continue (argv, argc); =A0 } =A0 static int *************** mi_cmd_exec_interrupt (char *command, ch *** 252,258 **** =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 if (!any_running ()) =A0=A0=A0=A0=A0=A0=A0 error ("Inferior not running."); ! =A0=A0=A0=A0=A0=A0=A0 interrupt_target_1 (1); =A0=A0=A0=A0=A0 } =A0=A0=A0 else if (argc =3D=3D 2 && strcmp (argv[0], "--thread-group") =3D= =3D 0) --- 307,313 ---- =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 if (!any_running ()) =A0=A0=A0=A0=A0=A0=A0 error ("Inferior not running."); ! =A0=A0=A0=A0=A0=A0=A0 interrupt_target_1 (1); =A0=A0=A0=A0=A0 } =A0=A0=A0 else if (argc =3D=3D 2 && strcmp (argv[0], "--thread-group") =3D= =3D 0) *************** void *** 349,355 **** =A0 mi_cmd_thread_info (char *command, char **argv, int argc) =A0 { =A0=A0=A0 int thread =3D -1; ! =A0=A0=A0 if (argc !=3D 0 && argc !=3D 1) =A0=A0=A0=A0=A0 error ("Invalid MI command"); --- 404,410 ---- =A0 mi_cmd_thread_info (char *command, char **argv, int argc) =A0 { =A0=A0=A0 int thread =3D -1; ! =A0=A0=A0 if (argc !=3D 0 && argc !=3D 1) =A0=A0=A0=A0=A0 error ("Invalid MI command"); *************** print_one_inferior (struct inferior *inf *** 367,373 **** =A0=A0=A0 ui_out_field_fmt (uiout, "id", "%d", inferior->pid); =A0=A0=A0 ui_out_field_string (uiout, "type", "process"); =A0=A0=A0 ui_out_field_int (uiout, "pid", inferior->pid); ! =A0=A0=A0 do_cleanups (back_to); =A0=A0=A0 return 0; =A0 } --- 422,428 ---- =A0=A0=A0 ui_out_field_fmt (uiout, "id", "%d", inferior->pid); =A0=A0=A0 ui_out_field_string (uiout, "type", "process"); =A0=A0=A0 ui_out_field_int (uiout, "pid", inferior->pid); ! =A0=A0=A0 do_cleanups (back_to); =A0=A0=A0 return 0; =A0 } *************** mi_cmd_list_thread_groups (char *command *** 433,446 **** =A0=A0=A0=A0=A0=A0=A0 int pid =3D atoi (id); =A0=A0=A0=A0=A0=A0=A0 if (!in_inferior_list (pid)) =A0=A0=A0=A0=A0=A0=A0 error ("Invalid thread group id '%s'", id); !=A0=A0=A0=A0=A0=A0 print_thread_info (uiout, -1, pid); =A0=A0=A0=A0=A0 } =A0=A0=A0 else =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 make_cleanup_ui_out_list_begin_end (uiout, "groups"); =A0=A0=A0=A0=A0=A0=A0 iterate_over_inferiors (print_one_inferior, NULL); =A0=A0=A0=A0=A0 } ! =A0=A0=A0 do_cleanups (back_to); =A0 } --- 488,501 ---- =A0=A0=A0=A0=A0=A0=A0 int pid =3D atoi (id); =A0=A0=A0=A0=A0=A0=A0 if (!in_inferior_list (pid)) =A0=A0=A0=A0=A0=A0=A0 error ("Invalid thread group id '%s'", id); !=A0=A0=A0=A0=A0=A0 print_thread_info (uiout, -1, pid); =A0=A0=A0=A0=A0 } =A0=A0=A0 else =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 make_cleanup_ui_out_list_begin_end (uiout, "groups"); =A0=A0=A0=A0=A0=A0=A0 iterate_over_inferiors (print_one_inferior, NULL); =A0=A0=A0=A0=A0 } ! =A0=A0=A0 do_cleanups (back_to); =A0 } *************** get_register (struct frame_info *frame, *** 713,719 **** =A0 } =A0 /* Write given values into registers. The registers and values are !=A0=A0=A0 given as pairs.=A0 The corresponding MI command is =A0=A0=A0=A0 -data-write-register-values [ ... ]*/ =A0 void =A0 mi_cmd_data_write_register_values (char *command, char **argv, int argc) --- 768,774 ---- =A0 } =A0 /* Write given values into registers. The registers and values are !=A0=A0=A0 given as pairs.=A0 The corresponding MI command is =A0=A0=A0=A0 -data-write-register-values [ ... ]*/ =A0 void =A0 mi_cmd_data_write_register_values (char *command, char **argv, int argc) *************** mi_cmd_data_evaluate_expression (char *c *** 810,816 **** =A0 /* DATA-MEMORY-READ: =A0=A0=A0=A0 ADDR: start address of data to be dumped. !=A0=A0=A0 WORD-FORMAT: a char indicating format for the ``word''.=A0 See =A0=A0=A0=A0 the ``x'' command. =A0=A0=A0=A0 WORD-SIZE: size of each ``word''; 1,2,4, or 8 bytes. =A0=A0=A0=A0 NR_ROW: Number of rows. --- 865,871 ---- =A0 /* DATA-MEMORY-READ: =A0=A0=A0=A0 ADDR: start address of data to be dumped. !=A0=A0=A0 WORD-FORMAT: a char indicating format for the ``word''.=A0 See =A0=A0=A0=A0 the ``x'' command. =A0=A0=A0=A0 WORD-SIZE: size of each ``word''; 1,2,4, or 8 bytes. =A0=A0=A0=A0 NR_ROW: Number of rows. *************** mi_cmd_data_evaluate_expression (char *c *** 823,829 **** =A0=A0=A0=A0 {addr=3D"...",rowN=3D{wordN=3D"..." ,... [,ascii=3D"..."]}, ..= .} !=A0=A0=A0 Returns: =A0=A0=A0=A0 The number of bytes read is SIZE*ROW*COL. */ =A0 void --- 878,884 ---- =A0=A0=A0=A0 {addr=3D"...",rowN=3D{wordN=3D"..." ,... [,ascii=3D"..."]}, ..= .} !=A0=A0=A0 Returns: =A0=A0=A0=A0 The number of bytes read is SIZE*ROW*COL. */ =A0 void *************** mi_cmd_data_read_memory (char *command, *** 1019,1025 **** =A0=A0=A0=A0 ADDR: start address of the row in the memory grid where the me= mory =A0=A0=A0=A0 cell is, if OFFSET_COLUMN is specified.=A0 Otherwise, the addr= ess of =A0=A0=A0=A0 the location to write to. !=A0=A0=A0 FORMAT: a char indicating format for the ``word''.=A0 See =A0=A0=A0=A0 the ``x'' command. =A0=A0=A0=A0 WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes =A0=A0=A0=A0 VALUE: value to be written into the memory address. --- 1074,1080 ---- =A0=A0=A0=A0 ADDR: start address of the row in the memory grid where the me= mory =A0=A0=A0=A0 cell is, if OFFSET_COLUMN is specified.=A0 Otherwise, the addr= ess of =A0=A0=A0=A0 the location to write to. !=A0=A0=A0 FORMAT: a char indicating format for the ``word''.=A0 See =A0=A0=A0=A0 the ``x'' command. =A0=A0 =A0=A0WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes =A0=A0=A0=A0 VALUE: value to be written into the memory address. *************** mi_cmd_enable_timings (char *command, ch *** 1112,1118 **** =A0=A0=A0=A0=A0 } =A0=A0=A0 else =A0=A0=A0=A0=A0 goto usage_error; ! =A0=A0=A0 return; =A0=A0 usage_error: --- 1167,1173 ---- =A0=A0=A0=A0=A0 } =A0=A0=A0 else =A0=A0=A0=A0=A0 goto usage_error; ! =A0=A0=A0 return; =A0=A0 usage_error: *************** mi_cmd_list_features (char *command, cha *** 1125,1140 **** =A0=A0=A0 if (argc =3D=3D 0) =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 struct cleanup *cleanup =3D NULL; !=A0=A0=A0=A0=A0=A0 cleanup =3D make_cleanup_ui_out_list_begin_end (uiout, = "features"); =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "frozen-varobjs"); =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "pending-breakpoint= s"); =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "thread-info"); ! =A0 #if HAVE_PYTHON =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "python"); =A0 #endif ! =A0=A0=A0=A0=A0=A0=A0 do_cleanups (cleanup); =A0=A0=A0=A0=A0=A0=A0 return; =A0=A0=A0=A0=A0 } --- 1180,1195 ---- =A0=A0=A0 if (argc =3D=3D 0) =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 struct cleanup *cleanup =3D NULL; !=A0=A0=A0=A0=A0=A0 cleanup =3D make_cleanup_ui_out_list_begin_end (uiout, = "features"); =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "frozen-varobjs"); =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "pending-breakpoint= s"); =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "thread-info"); ! =A0 #if HAVE_PYTHON =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "python"); =A0 #endif ! =A0=A0=A0=A0=A0=A0=A0 do_cleanups (cleanup); =A0=A0=A0=A0=A0=A0=A0 return; =A0=A0=A0=A0=A0 } *************** mi_cmd_list_target_features (char *comma *** 1148,1158 **** =A0=A0=A0 if (argc =3D=3D 0) =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 struct cleanup *cleanup =3D NULL; ! =A0=A0=A0=A0=A0=A0cleanup =3D make_cleanup_ui_out_list_begin_end (uiout, = "features"); =A0=A0=A0=A0=A0=A0=A0 if (target_can_async_p ()) =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "async"); ! =A0=A0=A0=A0=A0=A0=A0 do_cleanups (cleanup); =A0=A0=A0=A0=A0=A0=A0 return; =A0=A0=A0=A0=A0 } --- 1203,1213 ---- =A0=A0=A0 if (argc =3D=3D 0) =A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0 struct cleanup *cleanup =3D NULL; !=A0=A0=A0=A0=A0=A0 cleanup =3D make_cleanup_ui_out_list_begin_end (uiout, = "features"); =A0=A0=A0=A0=A0=A0=A0 if (target_can_async_p ()) =A0=A0=A0=A0=A0=A0=A0 ui_out_field_string (uiout, NULL, "async"); ! =A0=A0=A0=A0=A0=A0=A0 do_cleanups (cleanup); =A0=A0=A0=A0=A0=A0=A0 return; =A0=A0=A0=A0=A0 } *************** captured_mi_execute_command (struct ui_o *** 1196,1203 **** =A0=A0=A0=A0=A0=A0=A0 /* Print the result if there were no errors. =A0=A0=A0=A0=A0=A0=A0=A0 Remember that on the way out of executing a comman= d, you have !=A0=A0=A0=A0=A0=A0=A0 to directly use the mi_interp's uiout, since the com= mand could !=A0=A0=A0=A0=A0=A0=A0 have reset the interpreter, in which case the curren= t uiout =A0=A0=A0=A0=A0=A0=A0=A0 will most likely crash in the mi_out_* routines.= =A0 */ =A0=A0=A0=A0=A0=A0=A0 if (!running_result_record_printed) =A0=A0=A0=A0=A0=A0=A0 { --- 1251,1258 ---- =A0=A0=A0=A0=A0=A0=A0 /* Print the result if there were no errors. =A0=A0=A0=A0=A0=A0=A0=A0 Remember that on the way out of executing a comman= d, you have !=A0=A0=A0=A0=A0=A0=A0 to directly use the mi_interp's uiout, since the com= mand could !=A0=A0=A0=A0=A0=A0=A0 have reset the interpreter, in which case the curren= t uiout =A0=A0=A0=A0=A0=A0=A0=A0 will most likely crash in the mi_out_* routines.= =A0 */ =A0=A0=A0=A0=A0=A0=A0 if (!running_result_record_printed) =A0=A0=A0=A0=A0=A0=A0 { *************** captured_mi_execute_command (struct ui_o *** 1244,1250 **** =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_out_put (uiout, raw_stdout= ); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_out_rewind (uiout); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_print_timing_maybe (); !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fputs_unfiltered ("\n", raw_std= out); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_out_rewind (uiout); --- 1299,1305 ---- =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_out_put (uiout, raw_stdout= ); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_out_rewind (uiout); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_print_timing_maybe (); !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fputs_unfiltered ("\n", raw_std= out); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_out_rewind (uiout); *************** mi_execute_command (char *cmd, int from_ *** 1302,1310 **** =A0=A0=A0=A0=A0=A0=A0 } =A0=A0=A0=A0=A0=A0=A0 if (/* The notifications are only output when the top= -level !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 interpreter (specified on the command li= ne) is MI.=A0 */ =A0=A0=A0=A0=A0=A0=A0=A0=A0 ui_out_is_mi_like_p (interp_ui_out (top_level_i= nterpreter ())) !=A0=A0=A0=A0=A0=A0=A0=A0 /* Don't try report anything if there are no thre= ads -- =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 the program is dead.=A0 */ =A0=A0=A0=A0=A0=A0=A0=A0=A0 && thread_count () !=3D 0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 /* -thread-select explicitly changes thread. If= frontend uses that --- 1357,1365 ---- =A0=A0=A0=A0=A0=A0=A0 } =A0=A0=A0=A0=A0=A0=A0 if (/* The notifications are only output when the top= -level !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 interpreter (specified on the command li= ne) is MI.=A0 */ =A0=A0=A0=A0=A0=A0=A0=A0=A0 ui_out_is_mi_like_p (interp_ui_out (top_level_i= nterpreter ())) !=A0=A0=A0=A0=A0=A0=A0=A0 /* Don't try report anything if there are no thre= ads -- =A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0the program is dead.=A0 */ =A0=A0=A0=A0=A0=A0=A0=A0=A0 && thread_count () !=3D 0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 /* -thread-select explicitly changes thread. If= frontend uses that *************** mi_execute_command (char *cmd, int from_ *** 1328,1337 **** =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } =A0=A0=A0=A0=A0=A0=A0=A0=A0 if (report_change) !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct thread_info *ti =3D inferior= _thread (); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 target_terminal_ours (); !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fprintf_unfiltered (mi->event_channel, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 "thread-selected,id=3D\"%d\"", =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0ti->num); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 gdb_flush (mi->event_channel); --- 1383,1392 ---- =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } =A0=A0=A0=A0=A0=A0=A0=A0=A0 if (report_change) !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct thread_info *ti =3D inferior= _thread (); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 target_terminal_ours (); !=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0fprintf_unfiltered (mi->event_channel, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 "thread-selected,id=3D\"%d\"", =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 ti->num); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 gdb_flush (mi->event_channel); *************** mi_execute_async_cli_command (char *cli_ *** 1446,1452 **** =A0=A0=A0=A0=A0 run =3D xstrprintf ("%s %s&", cli_command, argc ? *argv : "= "); =A0=A0=A0 else =A0=A0=A0=A0=A0 run =3D xstrprintf ("%s %s", cli_command, argc ? *argv : ""= ); !=A0=A0 old_cleanups =3D make_cleanup (xfree, run); =A0=A0=A0 execute_command ( /*ui */ run, 0 /*from_tty */ ); --- 1501,1507 ---- =A0=A0=A0=A0=A0 run =3D xstrprintf ("%s %s&", cli_command, argc ? *argv : "= "); =A0=A0=A0 else =A0=A0=A0=A0=A0 run =3D xstrprintf ("%s %s", cli_command, argc ? *argv : ""= ); !=A0=A0 old_cleanups =3D make_cleanup (xfree, run); =A0=A0=A0 execute_command ( /*ui */ run, 0 /*from_tty */ ); *************** mi_load_progress (const char *section_na *** 1551,1557 **** =A0=A0=A0 uiout =3D saved_uiout; =A0 } ! static void =A0 timestamp (struct mi_timestamp *tv) =A0=A0=A0 { =A0=A0=A0=A0=A0 long usec; --- 1606,1612 ---- =A0=A0=A0 uiout =3D saved_uiout; =A0 } ! static void =A0 timestamp (struct mi_timestamp *tv) =A0=A0=A0 { =A0=A0=A0=A0=A0 long usec; *************** timestamp (struct mi_timestamp *tv) *** 1571,1577 **** =A0 #endif =A0=A0=A0 } ! static void =A0 print_diff_now (struct mi_timestamp *start) =A0=A0=A0 { =A0=A0=A0=A0=A0 struct mi_timestamp now; --- 1626,1632 ---- =A0 #endif =A0=A0=A0 } ! static void =A0 print_diff_now (struct mi_timestamp *start) =A0=A0=A0 { =A0=A0=A0=A0=A0 struct mi_timestamp now; *************** mi_print_timing_maybe (void) *** 1588,1607 **** =A0=A0=A0=A0=A0 print_diff_now (current_command_ts); =A0 } ! static long =A0 timeval_diff (struct timeval start, struct timeval end) =A0=A0=A0 { =A0=A0=A0=A0=A0 return ((end.tv_sec - start.tv_sec) * 1000000L) =A0=A0=A0=A0=A0=A0=A0 + (end.tv_usec - start.tv_usec); =A0=A0=A0 } ! static void =A0 print_diff (struct mi_timestamp *start, struct mi_timestamp *end) =A0=A0=A0 { =A0=A0=A0=A0=A0 fprintf_unfiltered =A0=A0=A0=A0=A0=A0=A0 (raw_stdout, !=A0=A0=A0=A0=A0=A0=A0 ",time=3D{wallclock=3D\"%0.5f\",user=3D\"%0.5f\",sys= tem=3D\"%0.5f\"}", !=A0=A0=A0=A0=A0=A0=A0 timeval_diff (start->wallclock, end->wallclock) / 10= 00000.0, !=A0=A0=A0=A0=A0=A0=A0 timeval_diff (start->utime, end->utime) / 1000000.0, =A0=A0=A0=A0=A0=A0=A0=A0 timeval_diff (start->stime, end->stime) / 1000000.= 0); =A0=A0=A0 } --- 1643,1662 ---- =A0=A0=A0=A0=A0 print_diff_now (current_command_ts); =A0 } ! static long =A0 timeval_diff (struct timeval start, struct timeval end) =A0=A0=A0 { =A0=A0=A0=A0=A0 return ((end.tv_sec - start.tv_sec) * 1000000L) =A0=A0=A0=A0=A0=A0=A0 + (end.tv_usec - start.tv_usec); =A0=A0=A0 } ! static void =A0 print_diff (struct mi_timestamp *start, struct mi_timestamp *end) =A0=A0=A0 { =A0=A0=A0=A0=A0 fprintf_unfiltered =A0=A0=A0=A0=A0=A0=A0 (raw_stdout, !=A0=A0=A0=A0=A0=A0=A0 ",time=3D{wallclock=3D\"%0.5f\",user=3D\"%0.5f\",sys= tem=3D\"%0.5f\"}", ! =A0=A0=A0=A0=A0=A0=A0timeval_diff (start->wallclock, end->wallclock) / 10= 00000.0, !=A0=A0=A0=A0=A0=A0=A0 timeval_diff (start->utime, end->utime) / 1000000.0, =A0=A0=A0=A0=A0=A0=A0=A0 timeval_diff (start->stime, end->stime) / 1000000.= 0); =A0=A0=A0 } Best regards, /jakob _______________________________________________________ Jakob Engblom, PhD, Technical Marketing Manager Virtutech=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Direct: +46= 8 690 07 47=A0=A0=A0 Drottningholmsv=E4gen 22=A0=A0=A0=A0=A0 Mobile: +46 709 242 646=A0=A0 11243 Stockholm=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Web:=A0=A0=A0 www.virtu= tech.com=A0 Sweden ________________________________________________________ =A0=20