From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20264 invoked by alias); 21 May 2010 05:42:28 -0000 Received: (qmail 20157 invoked by uid 22791); 21 May 2010 05:42:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pw0-f41.google.com (HELO mail-pw0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 May 2010 05:42:21 +0000 Received: by pwi7 with SMTP id 7so625402pwi.0 for ; Thu, 20 May 2010 22:42:20 -0700 (PDT) Received: by 10.142.60.15 with SMTP id i15mr742199wfa.1.1274420540156; Thu, 20 May 2010 22:42:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.45.13 with HTTP; Thu, 20 May 2010 22:42:00 -0700 (PDT) In-Reply-To: <48573.77356.qm@web112518.mail.gq1.yahoo.com> References: <48573.77356.qm@web112518.mail.gq1.yahoo.com> From: Hui Zhu Date: Fri, 21 May 2010 05:42:00 -0000 Message-ID: Subject: Re: [Discussion/Prec] The record speed up plan (Make speed like without prec) To: paawan oza Cc: gdb@sourceware.org, Michael Snyder , Eli Zaretskii Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00063.txt.bz2 Are you use gdb-cvs-head? Hui On Fri, May 21, 2010 at 13:33, paawan oza wrote: > Hi Hui, > > would you please explain the idea of following lines ? > > if (lookup_minimal_symbol ("fork", NULL, NULL) !=3D NULL) > =C2=A0 =C2=A0fork_fn =3D find_function_in_inferior ("fork", &fork_objf); > if (!fork_fn) > =C2=A0 =C2=A0if (lookup_minimal_symbol ("_fork", NULL, NULL) !=3D NULL) > =C2=A0 =C2=A0 =C2=A0fork_fn =3D find_function_in_inferior ("fork", &fork_= objf); > =C2=A0 =C2=A0 =C2=A0if (!fork_fn) + =C2=A0 =C2=A0return -1; + =C2=A0ret = =3D value_from_longest (builtin_type (gdbarch)->builtin_int, 0); > =C2=A0/* Tell record.c that the following inferior change doesn't need re= cord. */ > =C2=A0 =C2=A0 =C2=A0old_cleanups =3D record_disable_set (); + + > =C2=A0/* Tell target that this is linux pre-record. =C2=A0*/ > =C2=A0 =C2=A0 =C2=A0self_cleanups =3D make_cleanup_restore_integer =C2=A0= =C2=A0 =C2=A0(&linux_pre_recording); + =C2=A0linux_pre_recording =3D 1; > =C2=A0 =C2=A0 =C2=A0ret =3D call_function_by_hand (fork_fn, 0, &ret); + += =C2=A0do_cleanups (self_cleanups); > > > PS: I am unable to find some definations e.g. find_function_in_inferior > > please comment. > > Regards, > Oza. > > > > > ----- Original Message ---- > From: Hui Zhu > To: gdb@sourceware.org > Cc: Michael Snyder ; paawan oza ; Eli Zaretskii > Sent: Wed, May 19, 2010 12:48:50 PM > Subject: Re: [Discussion/Prec] The record speed up plan (Make speed like = =C2=A0without prec) > > Hi, > > This is a demo. > > Still not support segment register, system call and some others. > > Thanks, > Hui > > On Fri, Apr 30, 2010 at 21:23, Hui Zhu wrote: >> Hello, >> >> I think the record speed is the biggest trouble of prec. >> After I did a long think and a lot of test around with it. =C2=A0I got a >> idea. =C2=A0Actually, I have began the code work. >> >> I found that the big trouble is prec let the inferior just step. =C2=A0It >> make inferior speed very low. =C2=A0Because the setp need a lot of conte= xt >> works. >> So I think let inferior continue can make it speed up. =C2=A0But How to >> record the change of each step? >> >> Some physicists said all the things in the world have execution rules. >> =C2=A0So use the current stat of this thing, we will get what will happen >> in the future. =C2=A0Looks most of rules are still not found. =C2=A0:) >> >> But lucky for us that insns exec rules we know. =C2=A0So most of insns >> (There a some special, I will talk it later), if we have the a >> inferior value(memory and reg), we can get the each value of next >> insn. >> So if we can record the all the value of a inferior A(or all the value >> that will be change, but to get it will need parse the insns that will >> be exec, this is not easy.) , we can let the inferior exec without >> step. =C2=A0If the user want reverse exec, get the each step value from = A. >> Then the record speed will very faster than before. >> >> But this way have a 2 question. >> 1. =C2=A0How to record all the status of a inferior=EF=BC=9F For the lin= ux, >> checkpoint already use fork to record the inferior. =C2=A0So prec will u= se >> it too. >> And when we want get the old status of inferior step by step, we can >> let the forked process step by step. =C2=A0That will easy by parse the i= nsn >> and know what will happen. >> >> 2. =C2=A0How to handle special insns that we will not know what will hap= pen >> after it exec? >> The first type of this insns is system call. =C2=A0Linux have catchpoint >> that make inferior stop before and after syscall. =C2=A0Then we can reco= rd >> the change after the system call. >> The other insn is like rdtsc, I don't know howto get the feature value >> of this type. =C2=A0My current idea with them is give up all the record >> after this insn. >> If user need, insert special breakpoint for it. =C2=A0Next time, inferior >> will stop on this insn, then prec can record the value after it exec. >> >> BTW, I call this new function pre_record, I agree with you if you said >> this name is ugly. :) >> >> Please tell me your opinions about my idea. =C2=A0That will help me a lo= t. =C2=A0Thanks. >> >> Thanks, >> Hui >> > > > > >