This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] gnu-nat: Delete target_stop "not implemented" implemention


This bit was split out from:
 https://sourceware.org/ml/gdb-patches/2015-04/msg00841.html

target_stop is used to implement the CLI "interrupt" and "attach&"
commands, and MI's -exec-interrupt.

However, with the CLI's "interrupt" command, if the target cannot
async, then the target_stop method isn't ever reached
(interrupt_target checks target_can_async_p).  It's not reached for
"attach&" either, as prepare_execution_command errors out if the
target can't async.  It's reachable with MI's -exec-interrupt though
(calls interrupt_target_1 directly), but iff the program is already
stopped, otherwise, without async support, MI can't issue any commands
until the program stops.  But then it seems pointless for this target
to behave differently from other targets that don't do async either.
Better let target.h decide what the fallback should be (through the
TARGET_DEFAULT_xxx macros).  Currently, the default is "ignore", I
guess with the reasoning that if the target can't async, then the
target must be already stopped when target_stop is called, so there's
nothing for the target method to do.

Untested.

gdb/ChangeLog:
2015-04-22  Pedro Alves  <palves@redhat.com>

	* gnu-nat.c (gnu_stop): Delete.
	(gnu_target): Don't install gnu_stop.
---
 gdb/gnu-nat.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index d830773..4753634 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2271,12 +2271,6 @@ gnu_terminal_init (struct target_ops *self)
   child_terminal_init_with_pgrp (gnu_current_inf->pid);
 }
 
-static void
-gnu_stop (struct target_ops *self, ptid_t ptid)
-{
-  error (_("to_stop target function not implemented"));
-}
-
 static int
 gnu_thread_alive (struct target_ops *ops, ptid_t ptid)
 {
@@ -2686,7 +2680,6 @@ gnu_target (void)
   t->to_mourn_inferior = gnu_mourn_inferior;
   t->to_thread_alive = gnu_thread_alive;
   t->to_pid_to_str = gnu_pid_to_str;
-  t->to_stop = gnu_stop;
 
   return t;
 }
-- 
1.9.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]