From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1882 invoked by alias); 5 Aug 2009 01:26:23 -0000 Received: (qmail 1868 invoked by uid 22791); 5 Aug 2009 01:26:22 -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-gx0-f222.google.com (HELO mail-gx0-f222.google.com) (209.85.217.222) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Aug 2009 01:26:13 +0000 Received: by gxk22 with SMTP id 22so8694117gxk.0 for ; Tue, 04 Aug 2009 18:26:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.19.205 with SMTP id c13mr2517860ibb.53.1249435571096; Tue, 04 Aug 2009 18:26:11 -0700 (PDT) In-Reply-To: <4A787B79.40901@vmware.com> References: <4A74C90D.4040004@vmware.com> <4A766F30.2030000@vmware.com> <4A771EA8.80002@vmware.com> <4A787B79.40901@vmware.com> From: Hui Zhu Date: Wed, 05 Aug 2009 01:26: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/msg00064.txt.bz2 Thanks. Hui On Wed, Aug 5, 2009 at 02:18, Michael Snyder wrote: > Hui Zhu wrote: >> >> On Tue, Aug 4, 2009 at 01:30, Michael Snyder wrote: >>> >>> Hui Zhu wrote: >>>> >>>> The record_exec_entry don't have big contact with core dump patch. >>>> >>>> I think the new version is more clear. >>> >>> But we had this patch all worked out, and now you've added >>> a bunch of new stuff to it. =A0It's not a "new version" of the >>> "add not_replay" patch, it's a whole new change. >>> >>> That's not the way we do it. =A0If you want to add new stuff, >>> you start a new thread, you don't add it into a thread that's >>> already in review. >>> >>> >> >> OK. =A0I got it. >> >> So the patch http://sourceware.org/ml/gdb-patches/2009-08/msg00006.html >> looks OK. >> Could you check it in? >> >> I will update dump patch after this patch in. >> >> Thanks, >> Hui > > Thanks. =A0Added some comments, and it's in as attached here. > > > > 2009-08-04 =A0Hui Zhu =A0 > =A0 =A0 =A0 =A0 =A0 =A0Michael Snyder =A0 > > =A0 =A0 =A0 =A0* record.c (record_mem_entry): New field 'mem_entry_not_ac= cessible'. > =A0 =A0 =A0 =A0(record_arch_list_add_mem): Initialize 'mem_entry_not_acce= ssible'. > =A0 =A0 =A0 =A0(record_wait): Set 'mem_entry_not_accessible' flag if targ= et > =A0 =A0 =A0 =A0memory not readable. =A0Don't try to change target memory = if > =A0 =A0 =A0 =A0'mem_entry_not_accessible' is set. > > 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 =A04 Aug 2009 18:17:15 -0000 > @@ -51,6 +51,9 @@ struct record_mem_entry > =A0{ > =A0 CORE_ADDR addr; > =A0 int len; > + =A0/* Set this flag if target memory for this entry > + =A0 =A0 can no longer be accessed. =A0*/ > + =A0int mem_entry_not_accessible; > =A0 gdb_byte *val; > =A0}; > > @@ -275,6 +278,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 { > @@ -727,32 +731,55 @@ record_wait (struct target_ops *ops, > =A0 =A0 =A0 =A0 =A0else if (record_list->type =3D=3D record_mem) > =A0 =A0 =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.le= n); > - =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 "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 =A0 hos= t_address_to_string (record_list), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pad= dress (gdbarch, > record_list->u.mem.addr), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rec= ord_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_l= ist->u.mem.len)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record: error reading mem= ory 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_li= st->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 writ= ing 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_li= st->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_lis= t->u.mem.len); > + =A0 =A0 =A0 =A0 =A0 =A0 /* Nothing to do if the entry is flagged not_ac= cessible. =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 if (!record_list->u.mem.mem_entry_not_accessibl= e) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gdb_byte *mem =3D alloca (record_list->= 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, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 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 EX= EC_REVERSE) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process record: e= rror 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 (gd= barch, record_list->u.mem.addr), > + =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 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Read failed -- > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flag entry as not_ac= cessible. =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 record_list->u.mem.mem_entr= y_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 (record= _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_direction= !=3D EXEC_REVERSE) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 error (_("Process r= ecord: 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 =A0padd= ress (gdbarch, > record_list->u.mem.addr), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reco= rd_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 /* Write failed -- > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flag entry a= s not_accessible. =A0*/ > + =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 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 record_= 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 =A0 =A0else > =A0 =A0 =A0 =A0 =A0 =A0{ > >