From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15560 invoked by alias); 22 Apr 2013 07:34:31 -0000 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 Received: (qmail 15540 invoked by uid 89); 22 Apr 2013 07:34:29 -0000 X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from kiruna.synopsys.com (HELO kiruna.synopsys.com) (198.182.44.80) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 22 Apr 2013 07:34:28 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by kiruna.synopsys.com (Postfix) with ESMTP id B118BF560 for ; Mon, 22 Apr 2013 00:34:26 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 99552EDF for ; Mon, 22 Apr 2013 00:34:26 -0700 (PDT) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 92EC5EDD for ; Mon, 22 Apr 2013 00:34:26 -0700 (PDT) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.28) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 22 Apr 2013 00:33:41 -0700 Received: from DE02WEMBXB.internal.synopsys.com ([fe80::95ce:118a:8321:a099]) by DE02WEHTCB.internal.synopsys.com ([::1]) with mapi id 14.02.0298.004; Mon, 22 Apr 2013 09:33:38 +0200 From: Andreas Kaufmann To: "gdb-patches@sourceware.org" Subject: [PATCH] Fix for 15072: stopped response missing for reverse-finish Date: Mon, 22 Apr 2013 14:01:00 -0000 Message-ID: <5570CCEF7886EE48BAAD632645A58FDA12829B3A@DE02WEMBXB.internal.synopsys.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg00656.txt.bz2 Hi! The following patch fixes the issue with "*stopped" response missing (for M= I interface) when=20 "reverse-finish" command hits a breakpoint. Please see http://sourceware.or= g/bugzilla/show_bug.cgi?id=3D15072 This is quite nasty bug when using reverse debugging with Eclipse. Basicall= y, without "*stopped"=20 response Eclipse will show state as "running" and the user has to restart t= he debug session. Here is explanation why this change is needed. GDB code has special handling for "forward finish", since returned value is= included in the response: static void finish_forward (struct symbol *function, struct frame_info *frame) { . . . add_continuation (tp, finish_command_continuation, cargs, finish_command_continuation_free_arg); . . .=20 =20=20 static void finish_command_continuation (void *arg, int err) { . . . observer_notify_normal_stop (bs, 1 /* print frame */); =20 The above is not done (and nor needed) for "reverse-finish". So I added add= itional check "execution_direction !=3D EXEC_REVERSE" to ensure that observer_noti= fy_normal_stop() is called for "reverse-finish" from normal_stop() in gdb/infrun.c. Please let me know if you have any comments!=20 Thanks, Andreas Kaufmann Synopsys Inc 2013-04-18 Andreas Kaufmann PR gdb/15072 * infrun.c (normal_stop): Ensure "observer_notify_normal_stop" is called when "reverse-finish" command hits a breakpoint. 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.577 diff -u -p -r1.577 infrun.c --- infrun.c 13 Mar 2013 18:34:53 -0000 1.577 +++ infrun.c 18 Apr 2013 13:45:09 -0000 @@ -6149,7 +6149,8 @@ done: || (!(inferior_thread ()->step_multi && inferior_thread ()->control.stop_step) && !(inferior_thread ()->control.stop_bpstat - && inferior_thread ()->control.proceed_to_finish) + && inferior_thread ()->control.proceed_to_finish + && execution_direction !=3D EXEC_REVERSE) && !inferior_thread ()->control.in_infcall)) { if (!ptid_equal (inferior_ptid, null_ptid))