diff -purN gdb-5.2.1.orig/gdb/remote.c gdb-5.2.1/gdb/remote.c --- gdb-5.2.1.orig/gdb/remote.c.orig Mon Jun 24 21:29:49 2002 +++ gdb-5.2.1/gdb/remote.c Mon Jun 24 21:32:58 2002 @@ -2429,6 +2429,12 @@ remote_attach (args, from_tty) putpkt (buf); } +static void +remote_post_attach (from_tty) + int from_tty; +{ + remote_check_symbols (symfile_objfile); +} #endif /* This takes a program previously attached to and detaches it. After this is done, GDB can be used to debug some other program. We @@ -2957,6 +2963,8 @@ remote_wait (ptid_t ptid, struct target_ { unsigned char *buf = alloca (PBUFSIZ); int thread_num = -1; + int new_thread; + int dead_thread; status->kind = TARGET_WAITKIND_EXITED; status->value.integer = 0; @@ -3150,6 +3158,23 @@ Packet Dropped"); case 'O': /* Console output */ remote_console_output (buf + 1); continue; + /* The next two are not a part of GDB protocol yet. */ + case 'n': + new_thread = strtol ((const char *) &buf[1], NULL, 16); + if(! in_thread_list (pid_to_ptid(new_thread))) { + add_thread(pid_to_ptid(new_thread)); + printf_filtered ("[New %s]\n", + target_pid_or_tid_to_str (pid_to_ptid(new_thread))); + } + continue; + case 'x': + dead_thread = strtol ((const char *) &buf[1], NULL, 16); + if( in_thread_list (pid_to_ptid(dead_thread))) { + delete_thread(pid_to_ptid(dead_thread)); + printf_filtered ("[%s exited]\n", + target_pid_or_tid_to_str (pid_to_ptid(dead_thread))); + } + continue; case '\0': if (last_sent_signal != TARGET_SIGNAL_0) { @@ -5338,6 +5363,7 @@ Specify the serial device it is connecte remote_ops.to_close = remote_close; #ifdef HAVE_TARGET_ATTACH remote_ops.to_attach = remote_attach; + remote_ops.to_post_attach = remote_post_attach; #endif #ifdef HAVE_TARGET_SHELL remote_ops.to_exec_shellcmd = remote_exec_shellcmd;