This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] procfs.c tweak
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 8 Aug 2004 03:03:17 +0200 (CEST)
- Subject: [PATCH] procfs.c tweak
The testsuite (attach.exp) expects us to print process without a
capital. This also cleans up the functions a bit.
This doesn't make the test pass though, at least on Solaris. There
we're printing "LWP 1" instead of "process 4523". Looks like it is
time to revisit the whole thread/LWP/PID mess again.
Committed as obvious,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* procfs.c (procfs_pid_to_str): Remove redundant and unused
variables. Incapitalized "process".
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.54
diff -u -p -r1.54 procfs.c
--- procfs.c 25 May 2004 14:58:30 -0000 1.54
+++ procfs.c 8 Aug 2004 00:59:09 -0000
@@ -5122,29 +5122,19 @@ procfs_thread_alive (ptid_t ptid)
return 1;
}
-/*
- * Function: target_pid_to_str
- *
- * Return a string to be used to identify the thread in
- * the "info threads" display.
- */
+/* Convert PTID to a string. Returns the string in a static buffer. */
char *
procfs_pid_to_str (ptid_t ptid)
{
static char buf[80];
- int proc, thread;
- procinfo *pi;
-
- proc = PIDGET (ptid);
- thread = TIDGET (ptid);
- pi = find_procinfo (proc, thread);
- if (thread == 0)
- sprintf (buf, "Process %d", proc);
+ if (TIDGET (ptid) == 0)
+ sprintf (buf, "process %d", PIDGET (ptid));
else
- sprintf (buf, "LWP %d", thread);
- return &buf[0];
+ sprintf (buf, "LWP %d", TIDGET (ptid));
+
+ return buf;
}
/*