From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12559 invoked by alias); 3 Aug 2009 05:19:39 -0000 Received: (qmail 12456 invoked by uid 22791); 3 Aug 2009 05:19:36 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f197.google.com (HELO mail-pz0-f197.google.com) (209.85.222.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 Aug 2009 05:19:23 +0000 Received: by pzk35 with SMTP id 35so2553064pzk.24 for ; Sun, 02 Aug 2009 22:19:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.251.15 with SMTP id y15mr53767wfh.50.1249276761157; Sun, 02 Aug 2009 22:19:21 -0700 (PDT) In-Reply-To: <4A766F30.2030000@vmware.com> References: <4A69182D.9090004@vmware.com> <4A6B6E02.5080702@vmware.com> <4A74C90D.4040004@vmware.com> <4A766F30.2030000@vmware.com> From: Hui Zhu Date: Mon, 03 Aug 2009 05:19:00 -0000 Message-ID: Subject: Re: [PREC/RFA] Add not_replay to make precord support release memory better To: Michael Snyder Cc: gdb-patches ml 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/msg00018.txt.bz2 The record_exec_entry don't have big contact with core dump patch. I think the new version is more clear. On the other hand, there is not multithread work, core dump need record_exec_entry, it need "mem_entry_not_accessible" too. Because some lib address when work with core, cannot really access. Thanks, Hui On Mon, Aug 3, 2009 at 13:01, Michael Snyder wrote: > Oops, now this patch has parts of your newer patch from > the other thread mixed in. > > I'm sorry, we've got multiple patches going back and forth. > Partly my fault, I've sent you a couple and I'm sure its > confusing. > > Let's try to keep them separate, OK? > > If you like the last patch that I sent you on this thread, > just say OK and I'll check it in. =A0Then we can discuss > 'record_exec_entry' etc. on the other thread. > > Michael > > Hui Zhu wrote: >> >> On Sun, Aug 2, 2009 at 12:10, Hui Zhu wrote: >>> >>> I think this patch is very good. >>> >>> I a new changelog for it: >>> 2009-08-02 =A0Michael Snyder >>> =A0 =A0 =A0 =A0 =A0 Hui Zhu =A0 >>> >>> =A0 =A0 =A0 * record.c (record_mem_entry): New field >>> =A0 =A0 =A0 'mem_entry_not_accessible'. >>> =A0 =A0 =A0 (record_arch_list_add_mem): Initialize >>> =A0 =A0 =A0 'mem_entry_not_accessible' to 0. >>> =A0 =A0 =A0 (record_wait): Set 'mem_entry_not_accessible' flag if target >>> =A0 =A0 =A0 memory not readable. =A0Don't try to change target memory if >>> =A0 =A0 =A0 'mem_entry_not_accessible' is set. >>> >>> Do you think it's ok? >>> >>> Thanks, >>> Hui >>> >>> On Sun, Aug 2, 2009 at 07:00, Michael Snyder wrote: >>>> >>>> Hui Zhu wrote: >>>>> >>>>> On Sun, Jul 26, 2009 at 04:41, Michael Snyder >>>>> wrote: >>>>>> >>>>>> Hui Zhu wrote: >>>>>>> >>>>>>> On Fri, Jul 24, 2009 at 10:10, Michael Snyder >>>>>>> wrote: >>>>>>>> >>>>>>>> 1) During the recording "pass", there's no change. >>>>>>>> 2) During the reverse-replay pass, if the memory is >>>>>>>> not readable or writable, we will set this flag to TRUE. >>>>>>>> 3) Finally, during the forward-replay pass, if the flag >>>>>>>> has previously been set to TRUE, we will skip this entry >>>>>>>> (and set the flag to FALSE.) >>>>>>>> >>>>>>>> So my question is -- is there any reason to set it to FALSE here? >>>>>>>> Is there any way that the memory can ever become readable again? >>>>>>>> >>>>>>>> Seems to me, once it is set TRUE, we might as well just leave it >>>>>>>> TRUE. >>>>>>>> Am I right? >>>>>>> >>>>>>> I thought about it too. =A0I think if we don't need this entry. =A0= We can >>>>>>> delete it directly. >>>>>>> But there is a special status, after release memory, inferior alloc >>>>>>> some memory and its address is same with the memory that released >>>>>>> memory. =A0Then the memory entry will can be use in this status. = =A0User >>>>>>> can get the right value of memory before this entry. =A0So I think >>>>>>> maybe >>>>>>> we can keep it. >>>>>>> >>>>>>> What do you think about it? >>>>>> >>>>>> Let's say a program does something like this: >>>>>> >>>>>> buf =3D mmap (...); >>>>>> munmap (...); >>>>>> buf =3D mmap (...); >>>>>> munmap (...); >>>>>> buf =3D mmap (...); >>>>>> >>>>>> and so on. =A0And suppose that, for whatever reason, mmap always >>>>>> returns the same address. >>>>>> >>>>>> Then it seems to me (and please correct me if I am wrong), that >>>>>> it all depends on where we stop the recording. >>>>>> >>>>>> If we stop the recording after mmap, but before munmap, then >>>>>> the memory will be readable throughout the ENTIRE recording. >>>>>> >>>>>> But if we stop the recording after munmap, but before mmap, then >>>>>> the memory will NOT be readable (again for the entire recording). >>>>>> >>>>>> So as you replay backward and forward through the recording, the >>>>>> readability state of the memory location will never change -- it >>>>>> will remain either readable, or unreadable, depending only on >>>>>> the mapped-state when the recording ended. >>>>>> >>>>>> The only way for it to change, I think, would be if we could >>>>>> resume the process and add some more execution to the end of >>>>>> the existing recording. >>>>>> >>>>> Agree with you. =A0We can do more thing around release memory. >>>>> >>>>> But this patch make prec work OK even if inferior release some memory. >>>>> =A0Of course, the released memory we still can not access. =A0But oth= er >>>>> memory is OK. >>>>> >>>>> This is a low cost idea for release memory. =A0And we still can add >>>>> other thing about =A0release memory. >>>> >>>> Yes, I like the patch, and I want to see it go in, but >>>> you haven't really answered my question: >>>> >>>> Once we have set this flag to TRUE in a recording entry, >>>> why would we ever need to set it to FALSE? >>>> >>>> The patch is simpler and easier to understand if we simply >>>> leave the flag TRUE. =A0It worries me to see it toggling back >>>> and forth between TRUE and FALSE every time we play through >>>> the recording, if there is no benefit to doing that. =A0Plus >>>> it means that we keep trying to read the target memory even >>>> though we know it will fail. >>>> >>>> I'm attaching a diff to show what I mean, in case it isn't clear. >>>> This diff gives me the same behavior with your munmap test case >>>> as your diff does. >>>> >>>> >>>> >>>> >>>> Index: record.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/record.c,v >>>> retrieving revision 1.9 >>>> diff -u -p -r1.9 record.c >>>> --- record.c =A0 =A022 Jul 2009 05:31:26 -0000 =A0 =A0 =A01.9 >>>> +++ record.c =A0 =A01 Aug 2009 22:59:55 -0000 >>>> @@ -51,6 +51,7 @@ struct record_mem_entry >>>> =A0{ >>>> =A0CORE_ADDR addr; >>>> =A0int len; >>>> + =A0int mem_entry_not_accessible; >>>> =A0gdb_byte *val; >>>> =A0}; >>>> >>>> @@ -275,6 +276,7 @@ record_arch_list_add_mem (CORE_ADDR addr >>>> =A0rec->type =3D record_mem; >>>> =A0rec->u.mem.addr =3D addr; >>>> =A0rec->u.mem.len =3D len; >>>> + =A0rec->u.mem.mem_entry_not_accessible =3D 0; >>>> >>>> =A0if (target_read_memory (addr, rec->u.mem.val, len)) >>>> =A0 =A0{ >>>> @@ -727,32 +729,52 @@ record_wait (struct target_ops *ops, >>>> =A0 =A0 =A0 =A0 else if (record_list->type =3D=3D record_mem) >>>> =A0 =A0 =A0 =A0 =A0 { >>>> =A0 =A0 =A0 =A0 =A0 =A0 /* mem */ >>>> - =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte *mem =3D alloca (record_list->u.mem= .len); >>>> - =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = "Process record: record_mem %s to " >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = "inferior addr =3D %s len =3D %d.\n", >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = host_address_to_string >>>> (record_list), >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = paddress (gdbarch, >>>> record_list->u.mem.addr), >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = record_list->u.mem.len); >>>> - >>>> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_read_memory >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, mem, >>>> record_list->u.mem.len)) >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record: error reading = memory at " >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"addr =3D %s len =3D = %d."), >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record= _list->u.mem.addr), >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >>>> - >>>> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_write_memory >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, record_lis= t->u.mem.val, >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len)) >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_ >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0("Process record: error w= riting memory at " >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D %s len =3D %d.= "), >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record= _list->u.mem.addr), >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >>>> - >>>> - =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list->u.mem.val, mem, >>>> record_list->u.mem.len); >>>> + =A0 =A0 =A0 =A0 =A0 =A0 if (record_list->u.mem.mem_entry_not_accessi= ble =3D=3D 0) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte *mem =3D alloca (record_lis= t->u.mem.len); >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 "Process record: record_mem %s >>>> to " >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 "inferior addr =3D %s len =3D >>>> %d.\n", >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 host_address_to_string >>>> (record_list), >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 paddress (gdbarch, >>>> + >>>> record_list->u.mem.addr), >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 record_list->u.mem.len); >>>> + >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (target_read_memory (record_list-= >u.mem.addr, mem, >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 record_list->u.mem.len)) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (execution_direction !=3D= EXEC_REVERSE) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record= : error reading memory >>>> at " >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"addr= =3D %s len =3D %d."), >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress = (gdbarch, >>>> record_list->u.mem.addr), >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_li= st->u.mem.len); >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 record_list->u.mem.mem_e= ntry_not_accessible =3D 1; >>>> + =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 =A0 =A0 =A0 =A0 =A0 =A0 if (target_write_memory (rec= ord_list->u.mem.addr, >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.val, >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len)) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (execution_direct= ion !=3D EXEC_REVERSE) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Proces= s record: error writing >>>> memory >>>> at " >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0"addr =3D %s len =3D %d."), >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0p= address (gdbarch, >>>> record_list->u.mem.addr), >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0r= ecord_list->u.mem.len); >>>> + =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 { >>>> + >>>> record_list->u.mem.mem_entry_not_accessible =3D >>>> 1; >>>> + =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 else >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list-= >u.mem.val, mem, >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reco= rd_list->u.mem.len); >>>> + =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 else >>>> =A0 =A0 =A0 =A0 =A0 { >>>> >>>> >> >> Hi Michael, >> >> I make a new patch for this function. >> Please help me review it. >> >> Thanks, >> Hui >> >> >> 2009-08-03 =A0Michael Snyder =A0 >> =A0 =A0 =A0 =A0 =A0 =A0Hui Zhu =A0 >> >> =A0 =A0 =A0 =A0* record.c (record_mem_entry): New field >> =A0 =A0 =A0 =A0'mem_entry_not_accessible'. >> =A0 =A0 =A0 =A0(record_arch_list_add_mem): Initialize >> =A0 =A0 =A0 =A0'mem_entry_not_accessible' to 0. >> =A0 =A0 =A0 =A0(record_exec_entry): New function. >> =A0 =A0 =A0 =A0(record_wait): Call 'record_exec_entry'. >> >> --- >> =A0record.c | =A0133 >> +++++++++++++++++++++++++++++++++++++++++---------------------- >> =A01 file changed, 87 insertions(+), 46 deletions(-) >> >> --- a/record.c >> +++ b/record.c >> @@ -51,6 +51,7 @@ struct record_mem_entry >> =A0{ >> =A0 CORE_ADDR addr; >> =A0 int len; >> + =A0int mem_entry_not_accessible; >> =A0 gdb_byte *val; >> =A0}; >> >> @@ -275,6 +276,7 @@ record_arch_list_add_mem (CORE_ADDR addr >> =A0 rec->type =3D record_mem; >> =A0 rec->u.mem.addr =3D addr; >> =A0 rec->u.mem.len =3D len; >> + =A0rec->u.mem.mem_entry_not_accessible =3D 0; >> >> =A0 if (target_read_memory (addr, rec->u.mem.val, len)) >> =A0 =A0 { >> @@ -412,6 +414,89 @@ record_gdb_operation_disable_set (void) >> =A0 return old_cleanups; >> =A0} >> >> +static inline void >> +record_exec_entry (struct regcache *regcache, struct gdbarch *gdbarch, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct record_entry *entry) >> +{ >> + =A0switch (entry->type) >> + =A0 =A0{ >> + =A0 =A0case record_reg: /* reg */ >> + =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0gdb_byte reg[MAX_REGISTER_SIZE]; >> + >> + =A0 =A0 =A0 =A0if (record_debug > 1) >> + =A0 =A0 =A0 =A0 =A0fprintf_unfiltered (gdb_stdlog, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Process re= cord: record_reg %s to " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"inferior n= um =3D %d.\n", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0host_addres= s_to_string (entry), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0entry->u.re= g.num); >> + >> + =A0 =A0 =A0 =A0regcache_cooked_read (regcache, entry->u.reg.num, reg); >> + =A0 =A0 =A0 =A0regcache_cooked_write (regcache, entry->u.reg.num, >> entry->u.reg.val); >> + =A0 =A0 =A0 =A0memcpy (entry->u.reg.val, reg, MAX_REGISTER_SIZE); >> + =A0 =A0 =A0} >> + =A0 =A0 =A0break; >> + >> + =A0 =A0case record_mem: /* mem */ >> + =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0if (!record_list->u.mem.mem_entry_not_accessible) >> + =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0gdb_byte *mem =3D alloca (entry->u.mem.len); >> + >> + =A0 =A0 =A0 =A0 =A0 =A0if (record_debug > 1) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0fprintf_unfiltered (gdb_stdlog, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Pr= ocess record: record_mem %s to " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"in= ferior addr =3D %s len =3D %d.\n", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0hos= t_address_to_string (entry), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pad= dress (gdbarch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rec= ord_list->u.mem.len); >> + >> + =A0 =A0 =A0 =A0 =A0 =A0if (target_read_memory (entry->u.mem.addr, mem, >> entry->u.mem.len)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (execution_direction =3D=3D EXEC_REV= ERSE) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.mem_entry_no= t_accessible =3D 1; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (record_debug) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0warning (_("Process record:= error reading memory at >> " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr = =3D %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 paddress (= gdbarch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 entry->u.m= em.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error (_("Process record: error rea= ding memory at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D %s len = =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 paddress (gdbarch, ent= ry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0entry->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (target_write_memory (entry->u.mem.a= ddr, >> entry->u.mem.val, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 entry->u.mem.len)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (execution_direction =3D=3D = EXEC_REVERSE) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.mem_= entry_not_accessible =3D 1; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (record_debug) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0warning (_("Process= record: error writing >> memory at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 "addr =3D %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa= ddress (gdbarch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 en= try->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error (_("Process record: e= rror writing memory at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D = %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 paddress (gdba= rch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0entry->u.mem.le= n); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + >> + =A0 =A0 =A0 =A0 =A0 =A0memcpy (entry->u.mem.val, mem, entry->u.mem.len= ); >> + =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0} >> + =A0 =A0 =A0break; >> + =A0 =A0} >> +} >> + >> =A0static void >> =A0record_open (char *name, int from_tty) >> =A0{ >> @@ -708,53 +793,9 @@ record_wait (struct target_ops *ops, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >> =A0 =A0 =A0 =A0 =A0 =A0} >> >> - =A0 =A0 =A0 =A0 /* Set ptid, register and memory according to record_l= ist. =A0*/ >> - =A0 =A0 =A0 =A0 if (record_list->type =3D=3D record_reg) >> - =A0 =A0 =A0 =A0 =A0 { >> - =A0 =A0 =A0 =A0 =A0 =A0 /* reg */ >> - =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte reg[MAX_REGISTER_SIZE]; >> - =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "P= rocess record: record_reg %s to " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "i= nferior num =3D %d.\n", >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ho= st_address_to_string (record_list), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 re= cord_list->u.reg.num); >> - =A0 =A0 =A0 =A0 =A0 =A0 regcache_cooked_read (regcache, record_list->u= .reg.num, >> reg); >> - =A0 =A0 =A0 =A0 =A0 =A0 regcache_cooked_write (regcache, record_list->= u.reg.num, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0record_list->u.reg.val); >> - =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list->u.reg.val, reg, MAX_REGIS= TER_SIZE); >> - =A0 =A0 =A0 =A0 =A0 } >> - =A0 =A0 =A0 =A0 else if (record_list->type =3D=3D record_mem) >> - =A0 =A0 =A0 =A0 =A0 { >> - =A0 =A0 =A0 =A0 =A0 =A0 /* mem */ >> - =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte *mem =3D alloca (record_list->u.mem.l= en); >> - =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "P= rocess record: record_mem %s to " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "i= nferior addr =3D %s len =3D %d.\n", >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ho= st_address_to_string (record_list), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa= ddress (gdbarch, >> record_list->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 re= cord_list->u.mem.len); >> - >> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_read_memory >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, mem, record_= list->u.mem.len)) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record: error reading me= mory at " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"addr =3D %s len =3D %d= ."), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record_l= ist->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >> - >> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_write_memory >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, record_list-= >u.mem.val, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len)) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_ >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0("Process record: error wri= ting memory at " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D %s len =3D %d."), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record_l= ist->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0record_exec_entry (regcache, gdbarch, record_list); >> >> - =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list->u.mem.val, mem, >> record_list->u.mem.len); >> - =A0 =A0 =A0 =A0 =A0 } >> - =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 if (record_list->type =3D=3D record_end) >> =A0 =A0 =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0if (record_debug > 1) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fprintf_unfiltered (gdb_stdlog, >> >> >> ------------------------------------------------------------------------ >> >> --- >> =A0record.c | =A0133 >> +++++++++++++++++++++++++++++++++++++++++---------------------- >> =A01 file changed, 87 insertions(+), 46 deletions(-) >> >> --- a/record.c >> +++ b/record.c >> @@ -51,6 +51,7 @@ struct record_mem_entry >> =A0{ >> =A0 CORE_ADDR addr; >> =A0 int len; >> + =A0int mem_entry_not_accessible; >> =A0 gdb_byte *val; >> =A0}; >> =A0@@ -275,6 +276,7 @@ record_arch_list_add_mem (CORE_ADDR addr >> =A0 rec->type =3D record_mem; >> =A0 rec->u.mem.addr =3D addr; >> =A0 rec->u.mem.len =3D len; >> + =A0rec->u.mem.mem_entry_not_accessible =3D 0; >> =A0 =A0 if (target_read_memory (addr, rec->u.mem.val, len)) >> =A0 =A0 { >> @@ -412,6 +414,89 @@ record_gdb_operation_disable_set (void) >> =A0 return old_cleanups; >> =A0} >> =A0+static inline void >> +record_exec_entry (struct regcache *regcache, struct gdbarch *gdbarch, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct record_entry *entry) >> +{ >> + =A0switch (entry->type) >> + =A0 =A0{ >> + =A0 =A0case record_reg: /* reg */ >> + =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0gdb_byte reg[MAX_REGISTER_SIZE]; >> + >> + =A0 =A0 =A0 =A0if (record_debug > 1) >> + =A0 =A0 =A0 =A0 =A0fprintf_unfiltered (gdb_stdlog, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Process re= cord: record_reg %s to " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"inferior n= um =3D %d.\n", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0host_addres= s_to_string (entry), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0entry->u.re= g.num); >> + >> + =A0 =A0 =A0 =A0regcache_cooked_read (regcache, entry->u.reg.num, reg); >> + =A0 =A0 =A0 =A0regcache_cooked_write (regcache, entry->u.reg.num, >> entry->u.reg.val); >> + =A0 =A0 =A0 =A0memcpy (entry->u.reg.val, reg, MAX_REGISTER_SIZE); >> + =A0 =A0 =A0} >> + =A0 =A0 =A0break; >> + >> + =A0 =A0case record_mem: /* mem */ >> + =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0if (!record_list->u.mem.mem_entry_not_accessible) >> + =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0gdb_byte *mem =3D alloca (entry->u.mem.len); >> + >> + =A0 =A0 =A0 =A0 =A0 =A0if (record_debug > 1) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0fprintf_unfiltered (gdb_stdlog, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Pr= ocess record: record_mem %s to " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"in= ferior addr =3D %s len =3D %d.\n", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0hos= t_address_to_string (entry), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pad= dress (gdbarch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rec= ord_list->u.mem.len); >> + >> + =A0 =A0 =A0 =A0 =A0 =A0if (target_read_memory (entry->u.mem.addr, mem, >> entry->u.mem.len)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (execution_direction =3D=3D EXEC_REV= ERSE) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.mem_entry_no= t_accessible =3D 1; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (record_debug) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0warning (_("Process record:= error reading memory at >> " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr = =3D %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 paddress (= gdbarch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 entry->u.m= em.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error (_("Process record: error rea= ding memory at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D %s len = =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 paddress (gdbarch, ent= ry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0entry->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (target_write_memory (entry->u.mem.a= ddr, >> entry->u.mem.val, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 entry->u.mem.len)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (execution_direction =3D=3D = EXEC_REVERSE) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.mem_= entry_not_accessible =3D 1; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (record_debug) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0warning (_("Process= record: error writing >> memory at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 "addr =3D %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa= ddress (gdbarch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 en= try->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error (_("Process record: e= rror writing memory at " >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D = %s len =3D %d."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 paddress (gdba= rch, entry->u.mem.addr), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0entry->u.mem.le= n); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + >> + =A0 =A0 =A0 =A0 =A0 =A0memcpy (entry->u.mem.val, mem, entry->u.mem.len= ); >> + =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0} >> + =A0 =A0 =A0break; >> + =A0 =A0} >> +} >> + >> =A0static void >> =A0record_open (char *name, int from_tty) >> =A0{ >> @@ -708,53 +793,9 @@ record_wait (struct target_ops *ops, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >> =A0 =A0 =A0 =A0 =A0 =A0} >> =A0- =A0 =A0 =A0 =A0 /* Set ptid, register and memory according to recor= d_list. =A0*/ >> - =A0 =A0 =A0 =A0 if (record_list->type =3D=3D record_reg) >> - =A0 =A0 =A0 =A0 =A0 { >> - =A0 =A0 =A0 =A0 =A0 =A0 /* reg */ >> - =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte reg[MAX_REGISTER_SIZE]; >> - =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "P= rocess record: record_reg %s to " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "i= nferior num =3D %d.\n", >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ho= st_address_to_string (record_list), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 re= cord_list->u.reg.num); >> - =A0 =A0 =A0 =A0 =A0 =A0 regcache_cooked_read (regcache, record_list->u= .reg.num, >> reg); >> - =A0 =A0 =A0 =A0 =A0 =A0 regcache_cooked_write (regcache, record_list->= u.reg.num, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0record_list->u.reg.val); >> - =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list->u.reg.val, reg, MAX_REGIS= TER_SIZE); >> - =A0 =A0 =A0 =A0 =A0 } >> - =A0 =A0 =A0 =A0 else if (record_list->type =3D=3D record_mem) >> - =A0 =A0 =A0 =A0 =A0 { >> - =A0 =A0 =A0 =A0 =A0 =A0 /* mem */ >> - =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte *mem =3D alloca (record_list->u.mem.l= en); >> - =A0 =A0 =A0 =A0 =A0 =A0 if (record_debug > 1) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fprintf_unfiltered (gdb_stdlog, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "P= rocess record: record_mem %s to " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "i= nferior addr =3D %s len =3D %d.\n", >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ho= st_address_to_string (record_list), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pa= ddress (gdbarch, >> record_list->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 re= cord_list->u.mem.len); >> - >> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_read_memory >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, mem, record_= list->u.mem.len)) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record: error reading me= mory at " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"addr =3D %s len =3D %d= ."), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record_l= ist->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >> - >> - =A0 =A0 =A0 =A0 =A0 =A0 if (target_write_memory >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (record_list->u.mem.addr, record_list-= >u.mem.val, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len)) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_ >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0("Process record: error wri= ting memory at " >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "addr =3D %s len =3D %d."), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0paddress (gdbarch, record_l= ist->u.mem.addr), >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_list->u.mem.len); >> + =A0 =A0 =A0 =A0 =A0record_exec_entry (regcache, gdbarch, record_list); >> =A0- =A0 =A0 =A0 =A0 =A0 =A0 memcpy (record_list->u.mem.val, mem, >> record_list->u.mem.len); >> - =A0 =A0 =A0 =A0 =A0 } >> - =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 if (record_list->type =3D=3D record_end) >> =A0 =A0 =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0if (record_debug > 1) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fprintf_unfiltered (gdb_stdlog, > >