This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] give remote.c its own pid_to_str function
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] give remote.c its own pid_to_str function
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 26 Apr 2001 15:11:43 -0700
- Organization: Red Hat
This just eliminates an ancient hack in normal_pid_to_str.
2001-04-26 Michael Snyder <msnyder@redhat.com>
* target.c (normal_pid_to_str): Get rid of an ancient hack.
* remote.c (remote_pid_to_str): New function for remote target.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 remote.c
*** remote.c 2001/04/17 20:31:00 1.45
--- remote.c 2001/04/26 22:09:03
*************** init_remote_threadtests (void)
*** 5103,5108 ****
--- 5103,5120 ----
#endif /* 0 */
+ /* Convert a thread ID to a string. Returns the string in a static
+ buffer. */
+
+ static char *
+ remote_pid_to_str (int pid)
+ {
+ static char buf[30];
+
+ sprintf (buf, "Thread %d", pid);
+ return buf;
+ }
+
static void
init_remote_ops (void)
{
*************** Specify the serial device it is connecte
*** 5130,5135 ****
--- 5142,5148 ----
remote_ops.to_thread_alive = remote_thread_alive;
remote_ops.to_find_new_threads = remote_threads_info;
remote_ops.to_extra_thread_info = remote_threads_extra_info;
+ remote_ops.to_pid_to_str = remote_pid_to_str;
remote_ops.to_stop = remote_stop;
remote_ops.to_query = remote_query;
remote_ops.to_rcmd = remote_rcmd;
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.24
diff -c -3 -p -r1.24 target.c
*** target.c 2001/04/14 19:23:02 1.24
--- target.c 2001/04/26 22:09:03
*************** normal_pid_to_str (int pid)
*** 2166,2176 ****
{
static char buf[30];
! if (STREQ (current_target.to_shortname, "remote"))
! sprintf (buf, "thread %d", pid);
! else
! sprintf (buf, "process %d", pid);
!
return buf;
}
--- 2166,2172 ----
{
static char buf[30];
! sprintf (buf, "process %d", pid);
return buf;
}