* [RFA] Process record and replay, 4/10
@ 2008-11-06 7:48 teawater
2008-11-07 15:12 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: teawater @ 2008-11-06 7:48 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1614 bytes --]
The process record and replay target has six function pointers
record_beneath_to_resume, record_beneath_to_wait,
record_beneath_to_prepare_to_store, record_beneath_to_xfer_partial,
record_beneath_to_insert_breakpoint and
record_beneath_to_remove_breakpoint.
This patch add code to function "update_current_target" make these
pointers always point to the function of lower strata target than
process record and replay target.
When GDB in record mode, we need to call the really debug function in
low strata target because process record and replay target need call
this function to control the inferior.
Struct target_ops already has a pointer "beneath" point to low strata
target, but process record and replay target doesn't use it. Because
if low strata target doesn't set some function pointers, process
record and replay target will need to call the function pointers of
the target that is low strata target of this target. If this target
doesn't set them too, it will need to call anothers. So use "beneath"
is not a good choice and "multi-thread" target that need function
pointers of low strata target doesn't use "beneath" too.
2008-11-06 Hui Zhu <teawater@gmail.com>
* target.c (update_current_target): Set function points
record_beneath_to_resume,
record_beneath_to_wait,
record_beneath_to_prepare_to_store,
record_beneath_to_xfer_partial,
record_beneath_to_insert_breakpoint
and record_beneath_to_remove_breakpoint point to the function
of target that lower than process record and replay target.
target.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
[-- Attachment #2: target_record_beneath.txt --]
[-- Type: text/plain, Size: 1836 bytes --]
--- a/target.c
+++ b/target.c
@@ -41,6 +41,7 @@
#include "target-descriptions.h"
#include "gdbthread.h"
#include "solib.h"
+#include "record.h"
static void target_info (char *, int);
@@ -387,6 +388,12 @@ update_current_target (void)
if (!current_target.FIELD) \
current_target.FIELD = (TARGET)->FIELD
+ record_beneath_to_resume = NULL;
+ record_beneath_to_store_registers = NULL;
+ record_beneath_to_xfer_partial = NULL;
+ record_beneath_to_insert_breakpoint = NULL;
+ record_beneath_to_remove_breakpoint = NULL;
+
for (t = target_stack; t; t = t->beneath)
{
INHERIT (to_shortname, t);
@@ -476,6 +483,35 @@ update_current_target (void)
/* Do not inherit to_memory_map. */
/* Do not inherit to_flash_erase. */
/* Do not inherit to_flash_done. */
+
+ /* Set the real beneath function pointers. */
+ if (t != &record_ops)
+ {
+ if (!record_beneath_to_resume)
+ {
+ record_beneath_to_resume = t->to_resume;
+ }
+ if (!record_beneath_to_wait)
+ {
+ record_beneath_to_wait = t->to_wait;
+ }
+ if (!record_beneath_to_store_registers)
+ {
+ record_beneath_to_store_registers = t->to_store_registers;
+ }
+ if (!record_beneath_to_xfer_partial)
+ {
+ record_beneath_to_xfer_partial = t->to_xfer_partial;
+ }
+ if (!record_beneath_to_insert_breakpoint)
+ {
+ record_beneath_to_insert_breakpoint = t->to_insert_breakpoint;
+ }
+ if (!record_beneath_to_remove_breakpoint)
+ {
+ record_beneath_to_remove_breakpoint = t->to_remove_breakpoint;
+ }
+ }
}
#undef INHERIT
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA] Process record and replay, 4/10
2008-11-06 7:48 [RFA] Process record and replay, 4/10 teawater
@ 2008-11-07 15:12 ` Eli Zaretskii
2008-11-08 6:29 ` teawater
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2008-11-07 15:12 UTC (permalink / raw)
To: teawater; +Cc: gdb-patches
> Date: Thu, 6 Nov 2008 15:47:45 +0800
> From: teawater <teawater@gmail.com>
>
> + /* Set the real beneath function pointers. */
Could you please rephrase this comment? I don't understand what it
tries to say.
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] Process record and replay, 4/10
2008-11-07 15:12 ` Eli Zaretskii
@ 2008-11-08 6:29 ` teawater
2008-11-08 9:28 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: teawater @ 2008-11-08 6:29 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Fri, Nov 7, 2008 at 23:10, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Thu, 6 Nov 2008 15:47:45 +0800
>> From: teawater <teawater@gmail.com>
>>
>> + /* Set the real beneath function pointers. */
>
> Could you please rephrase this comment? I don't understand what it
> tries to say.
>
> Thanks.
>
What about change it to "Update the function pointers that process record use."
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] Process record and replay, 4/10
2008-11-08 6:29 ` teawater
@ 2008-11-08 9:28 ` Eli Zaretskii
2008-11-11 5:50 ` teawater
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2008-11-08 9:28 UTC (permalink / raw)
To: teawater; +Cc: gdb-patches
> Date: Sat, 8 Nov 2008 14:28:56 +0800
> From: teawater <teawater@gmail.com>
> Cc: gdb-patches@sourceware.org
>
> On Fri, Nov 7, 2008 at 23:10, Eli Zaretskii <eliz@gnu.org> wrote:
> >> Date: Thu, 6 Nov 2008 15:47:45 +0800
> >> From: teawater <teawater@gmail.com>
> >>
> >> + /* Set the real beneath function pointers. */
> >
> > Could you please rephrase this comment? I don't understand what it
> > tries to say.
> >
> > Thanks.
> >
>
> What about change it to "Update the function pointers that process record use."
Maybe, but you use the word "beneath" in many more places, and also in
symbol names, so that word should probably not be removed from the
comment.
Could you explain what is meant by "beneath function pointers" in this
case? I could then suggest a better wording for this particular
comment.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA] Process record and replay, 4/10
2008-11-08 9:28 ` Eli Zaretskii
@ 2008-11-11 5:50 ` teawater
2008-11-13 15:09 ` teawater
2008-11-14 15:56 ` Eli Zaretskii
0 siblings, 2 replies; 10+ messages in thread
From: teawater @ 2008-11-11 5:50 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Thanks Eli.
On Sat, Nov 8, 2008 at 17:27, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Sat, 8 Nov 2008 14:28:56 +0800
>> From: teawater <teawater@gmail.com>
>> Cc: gdb-patches@sourceware.org
>>
>> On Fri, Nov 7, 2008 at 23:10, Eli Zaretskii <eliz@gnu.org> wrote:
>> >> Date: Thu, 6 Nov 2008 15:47:45 +0800
>> >> From: teawater <teawater@gmail.com>
>> >>
>> >> + /* Set the real beneath function pointers. */
>> >
>> > Could you please rephrase this comment? I don't understand what it
>> > tries to say.
>> >
>> > Thanks.
>> >
>>
>> What about change it to "Update the function pointers that process record use."
>
> Maybe, but you use the word "beneath" in many more places, and also in
> symbol names, so that word should probably not be removed from the
> comment.
I use "beneath" because:
struct target_ops
{
struct target_ops *beneath; /* To the target under this one. */
>
> Could you explain what is meant by "beneath function pointers" in this
> case? I could then suggest a better wording for this particular
> comment.
>
Great! It will help me a lot. :)
When GDB in record mode, we need to call the really debug function in
low strata target because process record and replay target need call
this function to control the inferior.
Struct target_ops already has a pointer "beneath" point to low strata
target, but process record and replay target doesn't use it. Because
if low strata target doesn't set some function pointers, process
record and replay target will need to call the function pointers of
the target that is low strata target of this target. If this target
doesn't set them too, it will need to call anothers. So use "beneath"
is not a good choice and "multi-thread" target that need function
pointers of low strata target doesn't use "beneath" too.
The process record and replay target has 6 function pointers
record_beneath_to_resume, record_beneath_to_wait,
record_beneath_to_prepare_to_store, record_beneath_to_xfer_partial,
record_beneath_to_insert_breakpoint and
record_beneath_to_remove_breakpoint.
They are set in function "update_current_target". They are always
point to the function of low strata target.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA] Process record and replay, 4/10
2008-11-11 5:50 ` teawater
@ 2008-11-13 15:09 ` teawater
2008-11-14 0:27 ` Eli Zaretskii
2008-11-14 15:56 ` Eli Zaretskii
1 sibling, 1 reply; 10+ messages in thread
From: teawater @ 2008-11-13 15:09 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Hi Eli,
Could you help me on them?
http://sourceware.org/ml/gdb-patches/2008-11/msg00206.html
http://sourceware.org/ml/gdb-patches/2008-11/msg00205.html
http://sourceware.org/ml/gdb-patches/2008-11/msg00202.html
http://sourceware.org/ml/gdb-patches/2008-11/msg00169.html
Thanks,
Hui
On Tue, Nov 11, 2008 at 13:34, teawater <teawater@gmail.com> wrote:
>
> Thanks Eli.
>
> On Sat, Nov 8, 2008 at 17:27, Eli Zaretskii <eliz@gnu.org> wrote:
> >> Date: Sat, 8 Nov 2008 14:28:56 +0800
> >> From: teawater <teawater@gmail.com>
> >> Cc: gdb-patches@sourceware.org
> >>
> >> On Fri, Nov 7, 2008 at 23:10, Eli Zaretskii <eliz@gnu.org> wrote:
> >> >> Date: Thu, 6 Nov 2008 15:47:45 +0800
> >> >> From: teawater <teawater@gmail.com>
> >> >>
> >> >> + /* Set the real beneath function pointers. */
> >> >
> >> > Could you please rephrase this comment? I don't understand what it
> >> > tries to say.
> >> >
> >> > Thanks.
> >> >
> >>
> >> What about change it to "Update the function pointers that process record use."
> >
> > Maybe, but you use the word "beneath" in many more places, and also in
> > symbol names, so that word should probably not be removed from the
> > comment.
>
> I use "beneath" because:
> struct target_ops
> {
> struct target_ops *beneath; /* To the target under this one. */
>
> >
> > Could you explain what is meant by "beneath function pointers" in this
> > case? I could then suggest a better wording for this particular
> > comment.
> >
>
> Great! It will help me a lot. :)
>
> When GDB in record mode, we need to call the really debug function in
> low strata target because process record and replay target need call
> this function to control the inferior.
>
> Struct target_ops already has a pointer "beneath" point to low strata
> target, but process record and replay target doesn't use it. Because
> if low strata target doesn't set some function pointers, process
> record and replay target will need to call the function pointers of
> the target that is low strata target of this target. If this target
> doesn't set them too, it will need to call anothers. So use "beneath"
> is not a good choice and "multi-thread" target that need function
> pointers of low strata target doesn't use "beneath" too.
>
> The process record and replay target has 6 function pointers
> record_beneath_to_resume, record_beneath_to_wait,
> record_beneath_to_prepare_to_store, record_beneath_to_xfer_partial,
> record_beneath_to_insert_breakpoint and
> record_beneath_to_remove_breakpoint.
> They are set in function "update_current_target". They are always
> point to the function of low strata target.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA] Process record and replay, 4/10
2008-11-11 5:50 ` teawater
2008-11-13 15:09 ` teawater
@ 2008-11-14 15:56 ` Eli Zaretskii
2008-11-14 16:29 ` teawater
1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2008-11-14 15:56 UTC (permalink / raw)
To: teawater; +Cc: gdb-patches
> Date: Tue, 11 Nov 2008 13:34:10 +0800
> From: teawater <teawater@gmail.com>
> Cc: gdb-patches@sourceware.org
>
> >> >> + /* Set the real beneath function pointers. */
> >> >
> >> > Could you please rephrase this comment? I don't understand what it
> >> > tries to say.
> >> >
> >> > Thanks.
> >> >
> >>
> >> What about change it to "Update the function pointers that process record use."
> >
> > Maybe, but you use the word "beneath" in many more places, and also in
> > symbol names, so that word should probably not be removed from the
> > comment.
>
> I use "beneath" because:
> struct target_ops
> {
> struct target_ops *beneath; /* To the target under this one. */
>
Then how about "Set pointers to functions in the target beneath us."?
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA] Process record and replay, 4/10
2008-11-14 15:56 ` Eli Zaretskii
@ 2008-11-14 16:29 ` teawater
0 siblings, 0 replies; 10+ messages in thread
From: teawater @ 2008-11-14 16:29 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Fri, Nov 14, 2008 at 19:44, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Tue, 11 Nov 2008 13:34:10 +0800
>> From: teawater <teawater@gmail.com>
>> Cc: gdb-patches@sourceware.org
>>
>> >> >> + /* Set the real beneath function pointers. */
>> >> >
>> >> > Could you please rephrase this comment? I don't understand what it
>> >> > tries to say.
>> >> >
>> >> > Thanks.
>> >> >
>> >>
>> >> What about change it to "Update the function pointers that process record use."
>> >
>> > Maybe, but you use the word "beneath" in many more places, and also in
>> > symbol names, so that word should probably not be removed from the
>> > comment.
>>
>> I use "beneath" because:
>> struct target_ops
>> {
>> struct target_ops *beneath; /* To the target under this one. */
>>
>
> Then how about "Set pointers to functions in the target beneath us."?
>
Great! I will use it. :)
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-11-14 13:51 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06 7:48 [RFA] Process record and replay, 4/10 teawater
2008-11-07 15:12 ` Eli Zaretskii
2008-11-08 6:29 ` teawater
2008-11-08 9:28 ` Eli Zaretskii
2008-11-11 5:50 ` teawater
2008-11-13 15:09 ` teawater
2008-11-14 0:27 ` Eli Zaretskii
2008-11-14 15:06 ` teawater
2008-11-14 15:56 ` Eli Zaretskii
2008-11-14 16:29 ` teawater
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox