From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13282 invoked by alias); 15 Jun 2009 15:37:05 -0000 Received: (qmail 13254 invoked by uid 22791); 15 Jun 2009 15:37:02 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_39,SPF_PASS X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Jun 2009 15:36:54 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id n5FFaoMN025852; Mon, 15 Jun 2009 10:36:50 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Mon, 15 Jun 2009 10:36:50 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [RFA] Patch to fix "reverse-next" command error Date: Mon, 15 Jun 2009 15:37:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA079760F1@ecamlmw720.eamcs.ericsson.se> In-Reply-To: References: <4A35B5CD.1030004@vmware.com> From: "Marc Khouzam" To: "Hui Zhu" , "Michael Snyder" Cc: 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-06/txt/msg00390.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org=20 > [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Hui Zhu > Sent: June-15-09 2:47 AM > To: Michael Snyder; Marc Khouzam > Cc: gdb-patches@sourceware.org > Subject: Re: [RFA] Patch to fix "reverse-next" command error >=20 > On Mon, Jun 15, 2009 at 10:45, Michael=20 > Snyder wrote: > > Hui Zhu wrote: > >> > >> Ping. > > > > Hui, I rewrote your patch a little bit. =A0I think we can use > > gdbarch_skip_trampoline_code to detect the fact that we have > > stepped into a trampoline (ie. "plt"). =A0This is more general. > > > > Mark, please tell me if this patch fixes your original problem, > > and Hui, please tell me if the patch is OK with you. > > >=20 > This patch is OK with me. I also tested this one and it works great for me as well. Thanks >=20 > BTW, the patch that you sent include the prev one. >=20 >=20 > Thanks, > Hui >=20 > >> On Mon, May 11, 2009 at 15:07, Hui Zhu wrote: > >>> > >>> PING > >>> > >>> On Wed, May 6, 2009 at 14:00, Hui Zhu wrote: > >>>> > >>>> Hi Michael, > >>>> > >>>> I try this issue with cvs-head. =A0It still affect cvs-head. > >>>> And I try the patch, it can fix this issue. =A0It's time=20 > close to 7.0 > >>>> branch. =A0So could you please help me review it? > >>>> > >>>> The attachment is the new patch follow cvs-head. > >>>> > >>>> 2009-05-06 =A0Hui Zhu =A0 > >>>> > >>>> =A0 =A0 =A0* infrun.c (handle_inferior_event): Make inferior step if= it > >>>> =A0 =A0 =A0stepping over a function call in reverse , and stop at the > >>>> =A0 =A0 =A0start address of the function. > >>>> > >>>> Thanks, > >>>> Hui > >>>> > >>>> On Thu, Jan 22, 2009 at 17:00, teawater=20 > wrote: > >>>>> > >>>>> Hi guys, > >>>>> > >>>>> This patch is for bug in > >>>>> http://sourceware.org/ml/gdb/2009-01/msg00146.html > >>>>> > >>>>> This issue is because sometime the inferior is already=20 > in function > >>>>> start address (i.e. plt), set a breakpoint and continue=20 > will make > >>>>> "reverse-next" work error. > >>>>> > >>>>> This patch make inferior step if it reverse step and stop at the > >>>>> function start address. > >>>>> It tested OK with process record patch and testsuite=20 > gdb.twreverse in > >>>>> branch reverse-20081226-branch. > >>>>> > >>>>> 2009-01-22 =A0Hui Zhu =A0 > >>>>> > >>>>> =A0 =A0 =A0 * infrun.c (handle_inferior_event): Make inferior=20 > step if it > >>>>> =A0 =A0 =A0 stepping over a function call in reverse , and stop at = the > >>>>> =A0 =A0 =A0 start address of the function. > >>>>> > >>>>> OK for mainline? > >>>>> > >>>>> Thanks, > >>>>> Hui > >>>>> > >> > > > > > > 2009-06-14 =A0Hui Zhu =A0 > > =A0 =A0 =A0 =A0 =A0 =A0Michael Snyder =A0 > > > > =A0 =A0 =A0 =A0* infrun.c (handle_inferior_event): Reverse-next=20 > through trampoline. > > > > Index: infrun.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/infrun.c,v > > retrieving revision 1.387 > > diff -u -p -r1.387 infrun.c > > --- infrun.c =A0 =A011 Jun 2009 11:57:46 -0000 =A0 =A0 =A01.387 > > +++ infrun.c =A0 =A015 Jun 2009 02:39:51 -0000 > > @@ -3623,9 +3623,17 @@ infrun: not switching back to stepped th > > > > =A0 =A0 =A0Note that step_range_end is the address of the first=20 > instruction > > =A0 =A0 =A0beyond the step range, and NOT the address of the last=20 > instruction > > - =A0 =A0 within it! */ > > + =A0 =A0 within it! > > + > > + =A0 =A0 Note also that during reverse execution, we may be stepping > > + =A0 =A0 through a function epilogue and therefore must detect when > > + =A0 =A0 the current-frame changes in the middle of a line. =A0*/ > > + > > =A0 if (stop_pc >=3D ecs->event_thread->step_range_start > > - =A0 =A0 =A0&& stop_pc < ecs->event_thread->step_range_end) > > + =A0 =A0 =A0&& stop_pc < ecs->event_thread->step_range_end > > + =A0 =A0 =A0&& (execution_direction !=3D EXEC_REVERSE > > + =A0 =A0 =A0 =A0 || frame_id_eq (get_frame_id (get_current_frame ()), > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ecs->event_thread->st= ep_frame_id))) > > =A0 =A0 { > > =A0 =A0 =A0 if (debug_infrun) > > =A0 =A0 =A0 =A0fprintf_unfiltered (gdb_stdlog, "infrun: stepping=20 > inside range > > [0x%s-0x%s]\n", > > @@ -3762,10 +3770,21 @@ infrun: not switching back to stepped th > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0keep_going (ecs); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > > - =A0 =A0 =A0 =A0 =A0 =A0 /* Normal (staticly linked) function call ret= urn. =A0*/ > > - =A0 =A0 =A0 =A0 =A0 =A0 init_sal (&sr_sal); > > - =A0 =A0 =A0 =A0 =A0 =A0 sr_sal.pc =3D ecs->stop_func_start; > > - =A0 =A0 =A0 =A0 =A0 =A0 insert_step_resume_breakpoint_at_sal (sr_sal,= =20 > null_frame_id); > > + =A0 =A0 =A0 =A0 =A0 =A0 if (gdbarch_skip_trampoline_code(current_gdba= rch, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0get_current_frame (), > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0stop_pc)) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* We are in a function call trampoli= ne. > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Keep stepping backward to get = to the=20 > caller. =A0*/ > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ecs->event_thread->stepping_over_brea= kpoint =3D 1; > > + =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 /* Normal function call return (stati= c or=20 > dynamic). =A0*/ > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 init_sal (&sr_sal); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sr_sal.pc =3D ecs->stop_func_start; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 insert_step_resume_breakpoint_at_sal = (sr_sal, > > null_frame_id); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0 =A0else > > =A0 =A0 =A0 =A0 =A0 =A0insert_step_resume_breakpoint_at_caller=20 > (get_current_frame ()); > > > > >=20