* [RFA] Submit process record and replay fourth time, 5/8
@ 2009-03-21 16:03 Hui Zhu
2009-03-25 7:23 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2009-03-21 16:03 UTC (permalink / raw)
To: gdb-patches
Cc: Pedro Alves, Marc Khouzam, Michael Snyder, Thiago Jung Bauermann,
Eli Zaretskii, paawan1982
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
This patch to add some process record and replay to infrun.c.
Code for function "use_displaced_stepping" is make sure that displaced
stepping function will disable when process record and replay target
is opened. Because process record and replay target doesn't support
displaced stepping function.
Code for function "proceed" is call function "record_not_record_set"
to set process record and replay target doesn't record the execute
log. Because when GDB resume the inferior, process record and replay
target doesn't need to record the memory and register store operation
of GDB.
2009-03-21 Hui Zhu <teawater@gmail.com>
* infrun.c (use_displaced_stepping): Return false if process
record and replay target is used.
(proceed): Call function "record_not_record_set" if pocess
record and replay target is used.
2008-12-26 Michael Snyder <msnyder@vmware.com>
* infrun.c (proceed): Don't call record_not_record_set.
[-- Attachment #2: 5-infrun.txt --]
[-- Type: text/plain, Size: 1595 bytes --]
---
infrun.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- a/infrun.c
+++ b/infrun.c
@@ -49,6 +49,8 @@
#include "mi/mi-common.h"
#include "event-top.h"
+#include "record.h"
+
/* Prototypes for local functions */
static void signals_info (char *, int);
@@ -603,7 +605,8 @@ use_displaced_stepping (struct gdbarch *
return (((can_use_displaced_stepping == can_use_displaced_stepping_auto
&& non_stop)
|| can_use_displaced_stepping == can_use_displaced_stepping_on)
- && gdbarch_displaced_step_copy_insn_p (gdbarch));
+ && gdbarch_displaced_step_copy_insn_p (gdbarch)
+ && current_target.to_stratum != record_stratum);
}
/* Clean out any stray displaced stepping state. */
@@ -2108,6 +2111,10 @@ adjust_pc_after_break (struct execution_
if (software_breakpoint_inserted_here_p (breakpoint_pc)
|| (non_stop && moribund_breakpoint_here_p (breakpoint_pc)))
{
+ struct cleanup *old_cleanups = NULL;
+ if (current_target.to_stratum == record_stratum)
+ old_cleanups = record_gdb_operation_disable_set ();
+
/* When using hardware single-step, a SIGTRAP is reported for both
a completed single-step and a software breakpoint. Need to
differentiate between the two, as the latter needs adjusting
@@ -2131,6 +2138,9 @@ adjust_pc_after_break (struct execution_
|| !currently_stepping (ecs->event_thread)
|| ecs->event_thread->prev_pc == breakpoint_pc)
regcache_write_pc (regcache, breakpoint_pc);
+
+ if (current_target.to_stratum == record_stratum)
+ do_cleanups (old_cleanups);
}
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Submit process record and replay fourth time, 5/8
2009-03-21 16:03 [RFA] Submit process record and replay fourth time, 5/8 Hui Zhu
@ 2009-03-25 7:23 ` Hui Zhu
2009-04-15 17:04 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2009-03-25 7:23 UTC (permalink / raw)
To: gdb-patches
Cc: Pedro Alves, Marc Khouzam, Michael Snyder, Thiago Jung Bauermann,
Eli Zaretskii, paawan1982
[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]
Update follow "3-record_target.txt".
Thanks,
Hui
On Sun, Mar 22, 2009 at 00:02, Hui Zhu <teawater@gmail.com> wrote:
> This patch to add some process record and replay to infrun.c.
>
> Code for function "use_displaced_stepping" is make sure that displaced
> stepping function will disable when process record and replay target
> is opened. Because process record and replay target doesn't support
> displaced stepping function.
>
> Code for function "proceed" is call function "record_not_record_set"
> to set process record and replay target doesn't record the execute
> log. Because when GDB resume the inferior, process record and replay
> target doesn't need to record the memory and register store operation
> of GDB.
>
> 2009-03-21 Hui Zhu <teawater@gmail.com>
>
> * infrun.c (use_displaced_stepping): Return false if process
> record and replay target is used.
> (proceed): Call function "record_not_record_set" if pocess
> record and replay target is used.
>
> 2008-12-26 Michael Snyder <msnyder@vmware.com>
> * infrun.c (proceed): Don't call record_not_record_set.
>
[-- Attachment #2: 5-infrun.txt --]
[-- Type: text/plain, Size: 1564 bytes --]
---
infrun.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- a/infrun.c
+++ b/infrun.c
@@ -49,6 +49,8 @@
#include "mi/mi-common.h"
#include "event-top.h"
+#include "record.h"
+
/* Prototypes for local functions */
static void signals_info (char *, int);
@@ -603,7 +605,8 @@ use_displaced_stepping (struct gdbarch *
return (((can_use_displaced_stepping == can_use_displaced_stepping_auto
&& non_stop)
|| can_use_displaced_stepping == can_use_displaced_stepping_on)
- && gdbarch_displaced_step_copy_insn_p (gdbarch));
+ && gdbarch_displaced_step_copy_insn_p (gdbarch)
+ && current_target.to_stratum != record_stratum);
}
/* Clean out any stray displaced stepping state. */
@@ -2109,6 +2112,10 @@ adjust_pc_after_break (struct execution_
if (software_breakpoint_inserted_here_p (breakpoint_pc)
|| (non_stop && moribund_breakpoint_here_p (breakpoint_pc)))
{
+ struct cleanup *old_cleanups = NULL;
+ if (current_target.to_stratum == record_stratum)
+ old_cleanups = record_gdb_operation_disable_set ();
+
/* When using hardware single-step, a SIGTRAP is reported for both
a completed single-step and a software breakpoint. Need to
differentiate between the two, as the latter needs adjusting
@@ -2132,6 +2139,9 @@ adjust_pc_after_break (struct execution_
|| !currently_stepping (ecs->event_thread)
|| ecs->event_thread->prev_pc == breakpoint_pc)
regcache_write_pc (regcache, breakpoint_pc);
+
+ if (old_cleanups)
+ do_cleanups (old_cleanups);
}
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Submit process record and replay fourth time, 5/8
2009-03-25 7:23 ` Hui Zhu
@ 2009-04-15 17:04 ` Hui Zhu
2009-04-21 13:32 ` Pedro Alves
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2009-04-15 17:04 UTC (permalink / raw)
To: gdb-patches
Cc: Pedro Alves, Marc Khouzam, Michael Snyder, Thiago Jung Bauermann,
Eli Zaretskii, paawan1982, Mark Kettenis
Add RECORD_IS_USED.
---
infrun.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/infrun.c
+++ b/infrun.c
@@ -48,6 +48,7 @@
#include "gdb_assert.h"
#include "mi/mi-common.h"
#include "event-top.h"
+#include "record.h"
/* Prototypes for local functions */
@@ -603,7 +604,8 @@ use_displaced_stepping (struct gdbarch *
return (((can_use_displaced_stepping == can_use_displaced_stepping_auto
&& non_stop)
|| can_use_displaced_stepping == can_use_displaced_stepping_on)
- && gdbarch_displaced_step_copy_insn_p (gdbarch));
+ && gdbarch_displaced_step_copy_insn_p (gdbarch)
+ && !RECORD_IS_USED);
}
/* Clean out any stray displaced stepping state. */
@@ -2130,6 +2132,10 @@ adjust_pc_after_break (struct execution_
if (software_breakpoint_inserted_here_p (breakpoint_pc)
|| (non_stop && moribund_breakpoint_here_p (breakpoint_pc)))
{
+ struct cleanup *old_cleanups = NULL;
+ if (RECORD_IS_USED)
+ old_cleanups = record_gdb_operation_disable_set ();
+
/* When using hardware single-step, a SIGTRAP is reported for both
a completed single-step and a software breakpoint. Need to
differentiate between the two, as the latter needs adjusting
@@ -2153,6 +2159,9 @@ adjust_pc_after_break (struct execution_
|| !currently_stepping (ecs->event_thread)
|| ecs->event_thread->prev_pc == breakpoint_pc)
regcache_write_pc (regcache, breakpoint_pc);
+
+ if (old_cleanups)
+ do_cleanups (old_cleanups);
}
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Submit process record and replay fourth time, 5/8
2009-04-15 17:04 ` Hui Zhu
@ 2009-04-21 13:32 ` Pedro Alves
2009-04-22 9:09 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Pedro Alves @ 2009-04-21 13:32 UTC (permalink / raw)
To: gdb-patches
Cc: Hui Zhu, Marc Khouzam, Michael Snyder, Thiago Jung Bauermann,
Eli Zaretskii, paawan1982, Mark Kettenis
On Wednesday 15 April 2009 18:04:48, Hui Zhu wrote:
>
> /* Clean out any stray displaced stepping state. */
> @@ -2130,6 +2132,10 @@ adjust_pc_after_break (struct execution_
> if (software_breakpoint_inserted_here_p (breakpoint_pc)
> || (non_stop && moribund_breakpoint_here_p (breakpoint_pc)))
> {
> + struct cleanup *old_cleanups = NULL;
> + if (RECORD_IS_USED)
> + old_cleanups = record_gdb_operation_disable_set ();
> +
> /* When using hardware single-step, a SIGTRAP is reported for both
> a completed single-step and a software breakpoint. Need to
> differentiate between the two, as the latter needs adjusting
> @@ -2153,6 +2159,9 @@ adjust_pc_after_break (struct execution_
> || !currently_stepping (ecs->event_thread)
> || ecs->event_thread->prev_pc == breakpoint_pc)
> regcache_write_pc (regcache, breakpoint_pc);
> +
> + if (old_cleanups)
> + do_cleanups (old_cleanups);
> }
> }
Is this in the last version? This still has the problem with the
NULL cleanup I've just explained.
--
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Submit process record and replay fourth time, 5/8
2009-04-21 13:32 ` Pedro Alves
@ 2009-04-22 9:09 ` Hui Zhu
2009-04-27 22:22 ` Pedro Alves
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2009-04-22 9:09 UTC (permalink / raw)
To: Pedro Alves
Cc: gdb-patches, Marc Khouzam, Michael Snyder, Thiago Jung Bauermann,
Eli Zaretskii, paawan1982, Mark Kettenis
>
> Is this in the last version? This still has the problem with the
> NULL cleanup I've just explained.
>
The following fix it, this is the new version:
---
infrun.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/infrun.c
+++ b/infrun.c
@@ -48,6 +48,7 @@
#include "gdb_assert.h"
#include "mi/mi-common.h"
#include "event-top.h"
+#include "record.h"
/* Prototypes for local functions */
@@ -603,7 +604,8 @@ use_displaced_stepping (struct gdbarch *
return (((can_use_displaced_stepping == can_use_displaced_stepping_auto
&& non_stop)
|| can_use_displaced_stepping == can_use_displaced_stepping_on)
- && gdbarch_displaced_step_copy_insn_p (gdbarch));
+ && gdbarch_displaced_step_copy_insn_p (gdbarch)
+ && !RECORD_IS_USED);
}
/* Clean out any stray displaced stepping state. */
@@ -2130,6 +2132,10 @@ adjust_pc_after_break (struct execution_
if (software_breakpoint_inserted_here_p (breakpoint_pc)
|| (non_stop && moribund_breakpoint_here_p (breakpoint_pc)))
{
+ struct cleanup *old_cleanups = NULL;
+ if (RECORD_IS_USED)
+ old_cleanups = record_gdb_operation_disable_set ();
+
/* When using hardware single-step, a SIGTRAP is reported for both
a completed single-step and a software breakpoint. Need to
differentiate between the two, as the latter needs adjusting
@@ -2153,6 +2159,9 @@ adjust_pc_after_break (struct execution_
|| !currently_stepping (ecs->event_thread)
|| ecs->event_thread->prev_pc == breakpoint_pc)
regcache_write_pc (regcache, breakpoint_pc);
+
+ if (RECORD_IS_USED)
+ do_cleanups (old_cleanups);
}
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Submit process record and replay fourth time, 5/8
2009-04-22 9:09 ` Hui Zhu
@ 2009-04-27 22:22 ` Pedro Alves
2009-04-28 10:03 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Pedro Alves @ 2009-04-27 22:22 UTC (permalink / raw)
To: gdb-patches
Cc: Hui Zhu, Marc Khouzam, Michael Snyder, Thiago Jung Bauermann,
Eli Zaretskii, paawan1982, Mark Kettenis
On Wednesday 22 April 2009 10:08:53, Hui Zhu wrote:
> >
> > Is this in the last version? This still has the problem with the
> > NULL cleanup I've just explained.
> >
>
> The following fix it, this is the new version:
Thanks, this is approved. (ahem, again, ChangeLog entry.)
--
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Submit process record and replay fourth time, 5/8
2009-04-27 22:22 ` Pedro Alves
@ 2009-04-28 10:03 ` Hui Zhu
0 siblings, 0 replies; 7+ messages in thread
From: Hui Zhu @ 2009-04-28 10:03 UTC (permalink / raw)
To: Pedro Alves
Cc: gdb-patches, Marc Khouzam, Michael Snyder, Thiago Jung Bauermann,
Eli Zaretskii, paawan1982, Mark Kettenis
2009-04-28 Hui Zhu <teawater@gmail.com>
* infrun.c (use_displaced_stepping): Return false if process
record and replay target is used.
(proceed): Call function "record_not_record_set" if pocess
record and replay target is used.
2008-12-26 Michael Snyder <msnyder@vmware.com>
* infrun.c (proceed): Don't call record_not_record_set.
Thanks,
Hui
On Tue, Apr 28, 2009 at 06:22, Pedro Alves <pedro@codesourcery.com> wrote:
> On Wednesday 22 April 2009 10:08:53, Hui Zhu wrote:
>> >
>> > Is this in the last version? This still has the problem with the
>> > NULL cleanup I've just explained.
>> >
>>
>> The following fix it, this is the new version:
>
> Thanks, this is approved. (ahem, again, ChangeLog entry.)
>
>
> --
> Pedro Alves
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-04-28 10:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-21 16:03 [RFA] Submit process record and replay fourth time, 5/8 Hui Zhu
2009-03-25 7:23 ` Hui Zhu
2009-04-15 17:04 ` Hui Zhu
2009-04-21 13:32 ` Pedro Alves
2009-04-22 9:09 ` Hui Zhu
2009-04-27 22:22 ` Pedro Alves
2009-04-28 10:03 ` Hui Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox