Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix for 15072: stopped response missing for reverse-finish
@ 2013-04-22 14:01 Andreas Kaufmann
  2013-04-22 14:54 ` Abid, Hafiz
  2013-04-25  8:19 ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Kaufmann @ 2013-04-22 14:01 UTC (permalink / raw)
  To: gdb-patches

Hi!

The following patch fixes the issue with "*stopped" response missing (for MI interface) when 
"reverse-finish" command hits a breakpoint. Please see http://sourceware.org/bugzilla/show_bug.cgi?id=15072
This is quite nasty bug when using reverse debugging with Eclipse. Basically, without "*stopped" 
response Eclipse will show state as "running" and the user has to restart the 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);
. . . 
  
static void
finish_command_continuation (void *arg, int err)
{
. . .
observer_notify_normal_stop (bs, 1 /* print frame */);
 
The above is not done (and nor needed) for "reverse-finish". So I added additional
check  "execution_direction != EXEC_REVERSE" to ensure that observer_notify_normal_stop()
is called for "reverse-finish" from normal_stop() in gdb/infrun.c.

Please let me know if you have any comments! 

Thanks,
Andreas Kaufmann
Synopsys Inc



2013-04-18 Andreas Kaufmann <Andreas.Kaufmann@synopsys.com>

    PR gdb/15072
    * infrun.c (normal_stop): Ensure "observer_notify_normal_stop" is called
      when "reverse-finish" command hits a breakpoint.


Index: infrun.c
===================================================================
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 != EXEC_REVERSE)
                 && !inferior_thread ()->control.in_infcall))
     {
       if (!ptid_equal (inferior_ptid, null_ptid))



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-15 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-22 14:01 [PATCH] Fix for 15072: stopped response missing for reverse-finish Andreas Kaufmann
2013-04-22 14:54 ` Abid, Hafiz
2013-04-25  8:19 ` Tom Tromey
2013-05-15 15:49   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox