From: "Jakob Engblom" <jakob@virtutech.com>
To: "'Vladimir Prus'" <vladimir@codesourcery.com>,
<gdb-patches@sources.redhat.com>
Subject: RE: GDB MI Reverse Commands added [1 of 3]
Date: Wed, 13 Jan 2010 20:32:00 -0000 [thread overview]
Message-ID: <002901ca948f$771a7fe0$654f7fa0$@com> (raw)
In-Reply-To: <h7l9j6$tp2$1@ger.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 740 bytes --]
Here is an updated patch for the MI reverse commands, against the latest gdb 7 from cvs.
It removes the buggy whitespace changes, and also removes the small duplication of code with reverse.c (it was really only the setting of the default direction of execution that was duplicated).
In my build, this version passes all the mi-reverse.exp tests.
Best regards,
/jakob
_______________________________________________________
Jakob Engblom, PhD, Technical Marketing Manager
Virtutech Direct: +46 8 690 07 47
Drottningholmsvägen 22 Mobile: +46 709 242 646
11243 Stockholm Web: www.virtutech.com
Sweden
________________________________________________________
[-- Attachment #2: gdb-mi-reverse-gdb7.diff --]
[-- Type: application/octet-stream, Size: 5636 bytes --]
Index: gdb/mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.163
diff -c -p -r1.163 mi-main.c
*** gdb/mi/mi-main.c 12 Jan 2010 23:05:52 -0000 1.163
--- gdb/mi/mi-main.c 13 Jan 2010 20:16:03 -0000
*************** void
*** 121,155 ****
mi_cmd_exec_next (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! mi_execute_async_cli_command ("next", argv, argc);
}
void
mi_cmd_exec_next_instruction (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! mi_execute_async_cli_command ("nexti", argv, argc);
}
void
mi_cmd_exec_step (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! mi_execute_async_cli_command ("step", argv, argc);
}
void
mi_cmd_exec_step_instruction (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! mi_execute_async_cli_command ("stepi", argv, argc);
}
void
mi_cmd_exec_finish (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! mi_execute_async_cli_command ("finish", argv, argc);
}
void
--- 121,170 ----
mi_cmd_exec_next (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
! mi_execute_async_cli_command ("reverse-next", argv + 1, argc - 1);
! else
! mi_execute_async_cli_command ("next", argv, argc);
}
void
mi_cmd_exec_next_instruction (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
! mi_execute_async_cli_command ("reverse-nexti", argv + 1, argc - 1);
! else
! mi_execute_async_cli_command ("nexti", argv, argc);
}
void
mi_cmd_exec_step (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
! mi_execute_async_cli_command ("reverse-step", argv + 1, argc - 1);
! else
! mi_execute_async_cli_command ("step", argv, argc);
}
void
mi_cmd_exec_step_instruction (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
! mi_execute_async_cli_command ("reverse-stepi", argv + 1, argc - 1);
! else
! mi_execute_async_cli_command ("stepi", argv, argc);
}
void
mi_cmd_exec_finish (char *command, char **argv, int argc)
{
/* FIXME: Should call a libgdb function, not a cli wrapper. */
! if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
! mi_execute_async_cli_command ("reverse-finish", argv + 1, argc - 1);
! else
! mi_execute_async_cli_command ("finish", argv, argc);
}
void
*************** proceed_thread_callback (struct thread_i
*** 195,202 ****
return 0;
}
! void
! mi_cmd_exec_continue (char *command, char **argv, int argc)
{
if (argc == 0)
continue_1 (0);
--- 210,217 ----
return 0;
}
! static void
! exec_continue (char **argv, int argc)
{
if (argc == 0)
continue_1 (0);
*************** mi_cmd_exec_continue (char *command, cha
*** 217,223 ****
do_cleanups (old_chain);
}
else
! error ("Usage: -exec-continue [--all|--thread-group id]");
}
static int
--- 232,271 ----
do_cleanups (old_chain);
}
else
! error ("Usage: -exec-continue [--reverse] [--all|--thread-group id]");
! }
!
! /* Function found in gdb/reverse.c */
! void exec_direction_default(void *);
!
! static void
! exec_reverse_continue (char **argv, int argc)
! {
! enum exec_direction_kind dir = execution_direction;
! struct cleanup *old_chain;
!
! if (dir == EXEC_ERROR)
! error (_("Target %s does not support this command."), target_shortname);
!
! if (dir == EXEC_REVERSE)
! error (_("Already in reverse mode."));
!
! if (!target_can_execute_reverse)
! error (_("Target %s does not support this command."), target_shortname);
!
! old_chain = make_cleanup (exec_direction_default, NULL);
! execution_direction = EXEC_REVERSE;
! exec_continue (argv, argc);
! do_cleanups (old_chain);
! }
!
! void
! mi_cmd_exec_continue (char *command, char **argv, int argc)
! {
! if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
! exec_reverse_continue (argv + 1, argc - 1);
! else
! exec_continue (argv, argc);
}
static int
Index: gdb/reverse.c
===================================================================
RCS file: /cvs/src/src/gdb/reverse.c,v
retrieving revision 1.8
diff -c -p -r1.8 reverse.c
*** gdb/reverse.c 1 Jan 2010 07:31:41 -0000 1.8
--- gdb/reverse.c 13 Jan 2010 20:16:04 -0000
***************
*** 29,35 ****
/* User interface:
reverse-step, reverse-next etc. */
! static void
exec_direction_default (void *notused)
{
/* Return execution direction to default state. */
--- 29,35 ----
/* User interface:
reverse-step, reverse-next etc. */
! void
exec_direction_default (void *notused)
{
/* Return execution direction to default state. */
next prev parent reply other threads:[~2010-01-13 20:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-26 14:38 Jakob Engblom
2009-08-27 1:13 ` Michael Snyder
2009-08-31 13:26 ` Jakob Engblom
2009-08-31 19:56 ` Michael Snyder
2009-09-01 6:37 ` Jakob Engblom
2009-09-01 19:08 ` Michael Snyder
2009-08-27 2:06 ` Michael Snyder
2009-08-31 13:15 ` Jakob Engblom
2009-08-31 20:29 ` Tom Tromey
2009-09-02 8:16 ` Vladimir Prus
2009-09-10 21:09 ` Michael Snyder
2009-09-10 21:10 ` Michael Snyder
2010-01-13 20:32 ` Jakob Engblom [this message]
2010-01-13 20:36 ` Vladimir Prus
2010-01-13 20:44 ` Michael Snyder
2009-12-15 19:39 ` Michael Snyder
2009-12-16 7:54 ` Vladimir Prus
2009-12-16 7:57 ` Vladimir Prus
2009-12-17 14:40 ` Jakob Engblom
2009-12-21 10:06 ` Vladimir Prus
2009-12-22 11:34 ` Jakob Engblom
2009-12-22 11:48 ` Vladimir Prus
2010-01-13 13:15 ` Jakob Engblom
2009-12-22 18:22 ` Michael Snyder
2010-01-13 13:16 ` Jakob Engblom
2010-02-12 21:33 ` Michael Snyder
2009-08-27 3:11 ` Hui Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002901ca948f$771a7fe0$654f7fa0$@com' \
--to=jakob@virtutech.com \
--cc=gdb-patches@sources.redhat.com \
--cc=vladimir@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox