From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13422 invoked by alias); 15 Dec 2008 10:59:36 -0000 Received: (qmail 13414 invoked by uid 22791); 15 Dec 2008 10:59:35 -0000 X-Spam-Check-By: sourceware.org Received: from oden.vtab.com (HELO oden.vtab.com) (62.20.90.195) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Dec 2008 10:59:00 +0000 Received: from oden.vtab.com (oden.vtab.com [127.0.0.1]) by oden.vtab.com (Postfix) with ESMTP id 530E926F681; Mon, 15 Dec 2008 11:58:56 +0100 (CET) Received: from jessica.hq.vtech (jessica.hq.vtech [10.0.0.70]) by oden.vtab.com (Postfix) with ESMTP id 3DC3E26F67F; Mon, 15 Dec 2008 11:58:56 +0100 (CET) Message-ID: <49463870.6080302@virtutech.com> Date: Mon, 15 Dec 2008 10:59:00 -0000 From: Tomas Holmberg User-Agent: Thunderbird 2.0.0.18 (X11/20081119) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , Michael Snyder Subject: reverse for GDB/MI Content-Type: multipart/mixed; boundary="------------030705090108050602050808" 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: 2008-12/txt/msg00276.txt.bz2 This is a multi-part message in MIME format. --------------030705090108050602050808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 326 Hi, I have looked at the new reverse functionality in GDB and I think that it looks really good. I would like to see the reverse commands in the GDB/MI interface as well. I have attached two patches with the same purpose, to add reverse commands to the MI interface, as I am not sure which one that is best. /Tomas Holmberg --------------030705090108050602050808 Content-Type: text/x-patch; name="mi_reverse_ver0.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mi_reverse_ver0.diff" Content-length: 1078 Index: gdb/mi/mi-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmds.c,v retrieving revision 1.37 diff -c -p -r1.37 mi-cmds.c *** gdb/mi/mi-cmds.c 17 Nov 2008 16:37:35 -0000 1.37 --- gdb/mi/mi-cmds.c 15 Dec 2008 09:54:10 -0000 *************** struct mi_cmd mi_cmds[] = *** 70,75 **** --- 70,81 ---- { "exec-step", { NULL, 0 }, mi_cmd_exec_step}, { "exec-step-instruction", { NULL, 0 }, mi_cmd_exec_step_instruction}, { "exec-until", { "until", 1 }, NULL}, + { "exec-reverse-continue", { "reverse-continue", 1 }, NULL}, + { "exec-reverse-finish", { "reverse-finish", 1 }, NULL}, + { "exec-reverse-next", { "reverse-next", 1 }, NULL}, + { "exec-reverse-next-instruction", { "reverse-next-instruction", 1 }, NULL}, + { "exec-reverse-step", { "reverse-step", 1 }, NULL}, + { "exec-reverse-step-instruction", { "reverse-step-instruction", 1 }, NULL}, { "file-clear", { NULL, 0 }, NULL }, { "file-exec-and-symbols", { "file", 1 }, NULL }, { "file-exec-file", { "exec-file", 1 }, NULL }, --------------030705090108050602050808 Content-Type: text/x-patch; name="mi_reverse_ver1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mi_reverse_ver1.diff" Content-length: 4040 Index: gdb/mi/mi-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmds.c,v retrieving revision 1.37 diff -c -p -r1.37 mi-cmds.c *** gdb/mi/mi-cmds.c 17 Nov 2008 16:37:35 -0000 1.37 --- gdb/mi/mi-cmds.c 15 Dec 2008 09:57:08 -0000 *************** struct mi_cmd mi_cmds[] = *** 70,75 **** --- 70,81 ---- { "exec-step", { NULL, 0 }, mi_cmd_exec_step}, { "exec-step-instruction", { NULL, 0 }, mi_cmd_exec_step_instruction}, { "exec-until", { "until", 1 }, NULL}, + { "exec-reverse-continue", { NULL, 0 }, mi_cmd_exec_reverse_continue}, + { "exec-reverse-finish", { NULL, 0 }, mi_cmd_exec_reverse_finish}, + { "exec-reverse-next", { NULL, 0 }, mi_cmd_exec_reverse_next}, + { "exec-reverse-next-instruction", { NULL, 0 }, mi_cmd_exec_reverse_next_instruction}, + { "exec-reverse-step", { NULL, 0 }, mi_cmd_exec_reverse_step}, + { "exec-reverse-step-instruction", { NULL, 0 }, mi_cmd_exec_reverse_step_instruction}, { "file-clear", { NULL, 0 }, NULL }, { "file-exec-and-symbols", { "file", 1 }, NULL }, { "file-exec-file", { "exec-file", 1 }, NULL }, Index: gdb/mi/mi-cmds.h =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmds.h,v retrieving revision 1.35 diff -c -p -r1.35 mi-cmds.h *** gdb/mi/mi-cmds.h 17 Nov 2008 16:37:35 -0000 1.35 --- gdb/mi/mi-cmds.h 15 Dec 2008 09:57:08 -0000 *************** extern mi_cmd_argv_ftype mi_cmd_exec_ret *** 59,64 **** --- 59,70 ---- extern mi_cmd_argv_ftype mi_cmd_exec_step; extern mi_cmd_argv_ftype mi_cmd_exec_step_instruction; extern mi_cmd_argv_ftype mi_cmd_exec_interrupt; + extern mi_cmd_argv_ftype mi_cmd_exec_reverse_continue; + extern mi_cmd_argv_ftype mi_cmd_exec_reverse_finish; + extern mi_cmd_argv_ftype mi_cmd_exec_reverse_next; + extern mi_cmd_argv_ftype mi_cmd_exec_reverse_next_instruction; + extern mi_cmd_argv_ftype mi_cmd_exec_reverse_step; + extern mi_cmd_argv_ftype mi_cmd_exec_reverse_step_instruction; extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file; extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_files; extern mi_cmd_argv_ftype mi_cmd_gdb_exit; Index: gdb/mi/mi-main.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.139 diff -c -p -r1.139 mi-main.c *** gdb/mi/mi-main.c 2 Dec 2008 15:52:15 -0000 1.139 --- gdb/mi/mi-main.c 15 Dec 2008 09:57:09 -0000 *************** mi_cmd_exec_interrupt (char *command, ch *** 261,266 **** --- 261,308 ---- error ("Usage: -exec-interrupt [--all|--thread-group id]"); } + void + mi_cmd_exec_reverse_continue (char *command, char **argv, int argc) + { + /* FIXME: Should call a libgdb function, not a cli wrapper. */ + mi_execute_async_cli_command ("reverse-continue", argv, argc); + } + + void + mi_cmd_exec_reverse_finish (char *command, char **argv, int argc) + { + /* FIXME: Should call a libgdb function, not a cli wrapper. */ + mi_execute_async_cli_command ("reverse-finish", argv, argc); + } + + void + mi_cmd_exec_reverse_next (char *command, char **argv, int argc) + { + /* FIXME: Should call a libgdb function, not a cli wrapper. */ + mi_execute_async_cli_command ("reverse-next", argv, argc); + } + + void + mi_cmd_exec_reverse_next_instruction (char *command, char **argv, int argc) + { + /* FIXME: Should call a libgdb function, not a cli wrapper. */ + mi_execute_async_cli_command ("reverse-nexti", argv, argc); + } + + void + mi_cmd_exec_reverse_step (char *command, char **argv, int argc) + { + /* FIXME: Should call a libgdb function, not a cli wrapper. */ + mi_execute_async_cli_command ("reverse-step", argv, argc); + } + + void + mi_cmd_exec_reverse_step_instruction (char *command, char **argv, int argc) + { + /* FIXME: Should call a libgdb function, not a cli wrapper. */ + mi_execute_async_cli_command ("reverse-stepi", argv, argc); + } + static int find_thread_of_process (struct thread_info *ti, void *p) { --------------030705090108050602050808--