Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* In async mode, use target_stop to stop the inferior
@ 2008-03-14  8:02 Pedro Alves
  2008-03-14 14:39 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2008-03-14  8:02 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

We do have a target method for this now.  Obviouly for every
async target other than "target (extended-)async", this wasn't
working.

Installed as obvious (after testing with a local gdbserver with
the testsuite and manually).

-- 
Pedro Alves

[-- Attachment #2: use_target_stop.diff --]
[-- Type: text/x-diff, Size: 1885 bytes --]

2008-03-14  Pedro Alves  <pedro@codesourcery.com>

	* inf-loop.c (inferior_event_handler): Don't include remote.h.
	Call target_stop in the INF_QUIT_REQ case.
	* Makefile.in (inf-loop.o): Update.

---
 gdb/Makefile.in |    2 +-
 gdb/inf-loop.c  |    8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

Index: src/gdb/inf-loop.c
===================================================================
--- src.orig/gdb/inf-loop.c	2008-03-14 07:01:53.000000000 +0000
+++ src/gdb/inf-loop.c	2008-03-14 07:11:33.000000000 +0000
@@ -23,7 +23,6 @@
 #include "event-loop.h"
 #include "event-top.h"
 #include "inf-loop.h"
-#include "remote.h"
 #include "exceptions.h"
 
 static int fetch_inferior_event_wrapper (gdb_client_data client_data);
@@ -83,11 +82,8 @@ inferior_event_handler (enum inferior_ev
       do_all_intermediate_continuations ();
       break;
 
-    case INF_QUIT_REQ: 
-      /* FIXME: ezannoni 1999-10-04. This call should really be a
-	 target vector entry, so that it can be used for any kind of
-	 targets. */
-      async_remote_interrupt_twice (NULL);
+    case INF_QUIT_REQ:
+      target_stop ();
       break;
 
     case INF_TIMER:
Index: src/gdb/Makefile.in
===================================================================
--- src.orig/gdb/Makefile.in	2008-03-14 07:01:53.000000000 +0000
+++ src/gdb/Makefile.in	2008-03-14 07:11:25.000000000 +0000
@@ -2293,7 +2293,7 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_strin
 	$(solib_h) $(gdb_assert_h) $(observer_h) $(target_descriptions_h) \
 	$(user_regs_h)
 inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
-	$(event_top_h) $(inf_loop_h) $(remote_h) $(exceptions_h)
+	$(event_top_h) $(inf_loop_h) $(exceptions_h)
 inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
 	$(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) \
 	$(inflow_h) $(gdb_select_h)

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

* Re: In async mode, use target_stop to stop the inferior
  2008-03-14  8:02 In async mode, use target_stop to stop the inferior Pedro Alves
@ 2008-03-14 14:39 ` Daniel Jacobowitz
  2008-03-14 15:19   ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2008-03-14 14:39 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Mar 14, 2008 at 08:02:01AM +0000, Pedro Alves wrote:
> We do have a target method for this now.  Obviouly for every
> async target other than "target (extended-)async", this wasn't
> working.
> 
> Installed as obvious (after testing with a local gdbserver with
> the testsuite and manually).

Sorry, but I don't think this is right.  Or else it deserves a better
explanation :-)  async_remote_interrupt_twice didn't stop the target;
it was used to escape from a hung remote target (see interrupt_query).

You can trace the twisty path that got here through
sigint_remote_twice_token.  I'm not sure what INF_QUIT_REQ should do,
or if it's necessary - I find inferior_event_handler a bit weird.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: In async mode, use target_stop to stop the inferior
  2008-03-14 14:39 ` Daniel Jacobowitz
@ 2008-03-14 15:19   ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2008-03-14 15:19 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]

A Friday 14 March 2008 14:38:45, Daniel Jacobowitz wrote:
> On Fri, Mar 14, 2008 at 08:02:01AM +0000, Pedro Alves wrote:
> > We do have a target method for this now.  Obviouly for every
> > async target other than "target (extended-)async", this wasn't
> > working.
> >
> > Installed as obvious (after testing with a local gdbserver with
> > the testsuite and manually).
>
> Sorry, but I don't think this is right.  Or else it deserves a better
> explanation :-)  async_remote_interrupt_twice didn't stop the target;
> it was used to escape from a hung remote target (see interrupt_query).
>
> You can trace the twisty path that got here through
> sigint_remote_twice_token.  I'm not sure what INF_QUIT_REQ should do,
> or if it's necessary - I find inferior_event_handler a bit weird.

Uuugh, I'm the one who has to say sorry.
In fact, the twisted maze that got me to needing this was a local hack
I used to have that is no longer needed.  My patch was definitelly
wrong.

I reverted the patch with the attached.  (I even had missed
Makefile.in that's why you don't see it in this patch.  Sigh...)

-- 
Pedro Alves

[-- Attachment #2: target_stop_revert.diff --]
[-- Type: text/x-diff, Size: 1945 bytes --]

2008-03-14  Pedro Alves  <pedro@codesourcery.com>

	revert:
	2008-03-14  Pedro Alves  <pedro@codesourcery.com>
	* inf-loop.c (inferior_event_handler): Don't include remote.h.
	Call target_stop in the INF_QUIT_REQ case.
	* Makefile.in (inf-loop.o): Update.

---
 gdb/Makefile.in |    2 +-
 gdb/inf-loop.c  |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

Index: src/gdb/Makefile.in
===================================================================
--- src.orig/gdb/Makefile.in	2008-03-14 15:09:18.000000000 +0000
+++ src/gdb/Makefile.in	2008-03-14 15:09:34.000000000 +0000
@@ -2293,7 +2293,7 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_strin
 	$(solib_h) $(gdb_assert_h) $(observer_h) $(target_descriptions_h) \
 	$(user_regs_h)
 inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
-	$(event_top_h) $(inf_loop_h) $(exceptions_h)
+	$(event_top_h) $(inf_loop_h) $(remote_h) $(exceptions_h)
 inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
 	$(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) \
 	$(inflow_h) $(gdb_select_h)
Index: src/gdb/inf-loop.c
===================================================================
--- src.orig/gdb/inf-loop.c	2008-03-14 15:09:15.000000000 +0000
+++ src/gdb/inf-loop.c	2008-03-14 15:09:34.000000000 +0000
@@ -23,6 +23,7 @@
 #include "event-loop.h"
 #include "event-top.h"
 #include "inf-loop.h"
+#include "remote.h"
 #include "exceptions.h"
 
 static int fetch_inferior_event_wrapper (gdb_client_data client_data);
@@ -82,8 +83,11 @@ inferior_event_handler (enum inferior_ev
       do_all_intermediate_continuations ();
       break;
 
-    case INF_QUIT_REQ:
-      target_stop ();
+    case INF_QUIT_REQ: 
+      /* FIXME: ezannoni 1999-10-04. This call should really be a
+	 target vector entry, so that it can be used for any kind of
+	 targets. */
+      async_remote_interrupt_twice (NULL);
       break;
 
     case INF_TIMER:

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

end of thread, other threads:[~2008-03-14 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14  8:02 In async mode, use target_stop to stop the inferior Pedro Alves
2008-03-14 14:39 ` Daniel Jacobowitz
2008-03-14 15:19   ` Pedro Alves

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