From 43fc25c87e2e768f17030ac44ea434dfc756add0 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 13 Jul 1995 21:40:22 +0000 Subject: * inftarg.c (child_thread_alive): New function to see if a particular thread is still running. (child_ops): Add child_thread_alive entry. * remote.c (remote_thread_alive): New function to see if a particular thread is still alive. (remote_ops): Add remote_thread_alive. * target.c (dummy_target): Add dummy entry for thread_alive. (cleanup_target): de_fault thread_alive too. (update_current_target): INHERIT thread_alive too. (debug_to_thread_alive): New function. (setup_target_debug): Add debug_to_thread_alive. * target.h (struct target_ops): Add to_thread_alive. (target_thread_alive): Define. * thread.c (info_threads_command): Don't call kill; use target_thread_alive instead. * config/nm-lynx.h (CHILD_THREAD_ALIVE): Define. * gdbserver/low-lynx.c (mythread_alive): New function. (mywait): Don't restart any threads after a new thread notification, let the generic code handle it. * gdbserver/low-sparc.c (mythread_alive): Dummy version. * gdbserver/low-sun3.c (mythread_alive): Likewise. * gdbserver/server.c (main): Handle thread_alive requests. * gdbserver/server.h (mythread_alive): Declare. * corelow.c (core_ops): Add dummy entry for thread_alive. * exec.c (exec_ops): Likewise. * m3-nat.c (m3_ops): Likewise. * monitor.c (monitor_ops): Likewise. * procfs.c (procfs_ops): Likewise. * remote-arc.c (arc_ops): Likewise. * remote-array.c (array_ops): Likewise. * remote-e7000.c (e7000_ops): Likewise. * remote-es.c (es1800_ops, es1800_child_ops): Likewise. * remote-mips.c (mips_ops): Likewise. * remote-pa.c (remote_hppro_ops): Likewise. * remote-sim.c (gdbsim_ops): Likewise. * sparcl-tdep.c (sparclite_ops): Likewise. More lynx-6100 work --- gdb/remote.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'gdb/remote.c') diff --git a/gdb/remote.c b/gdb/remote.c index 98916fc..8e59d4c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -191,10 +191,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Prototypes for local functions */ static int remote_write_bytes PARAMS ((CORE_ADDR memaddr, - unsigned char *myaddr, int len)); + char *myaddr, int len)); static int remote_read_bytes PARAMS ((CORE_ADDR memaddr, - unsigned char *myaddr, int len)); + char *myaddr, int len)); static void remote_files_info PARAMS ((struct target_ops *ignore)); @@ -313,6 +313,24 @@ set_thread (th, gen) cont_thread = th; } +/* Return nonzero if the thread TH is still alive on the remote system. */ + +static int +remote_thread_alive (th) + int th; +{ + char buf[PBUFSIZ]; + + buf[0] = 'T'; + if (th < 0) + sprintf (&buf[1], "-%x", -th); + else + sprintf (&buf[1], "%x", th); + putpkt (buf); + getpkt (buf, 0); + return (buf[0] == 'O' && buf[1] == 'K'); +} + /* Clean up connection to a remote debugger. */ /* ARGSUSED */ @@ -940,7 +958,7 @@ remote_store_word (addr, word) static int remote_write_bytes (memaddr, myaddr, len) CORE_ADDR memaddr; - unsigned char *myaddr; + char *myaddr; int len; { char buf[PBUFSIZ]; @@ -988,7 +1006,7 @@ remote_write_bytes (memaddr, myaddr, len) static int remote_read_bytes (memaddr, myaddr, len) CORE_ADDR memaddr; - unsigned char *myaddr; + char *myaddr; int len; { char buf[PBUFSIZ]; @@ -1570,6 +1588,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", /* to_doc */ remote_mourn, /* to_mourn_inferior */ 0, /* to_can_run */ 0, /* to_notice_signals */ + remote_thread_alive, /* to_thread_alive */ 0, /* to_stop */ process_stratum, /* to_stratum */ NULL, /* to_next */ -- cgit v1.1