This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [djgpp/commit] Fix go32_pid_to_str and go32_thread_alive
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org, Eli Zaretskii <eliz at gnu dot org>
- Date: Fri, 1 May 2009 11:18:51 +0100
- Subject: Re: [djgpp/commit] Fix go32_pid_to_str and go32_thread_alive
- References: <834ow5dypg.fsf@gnu.org>
On Friday 01 May 2009 09:17:15, Eli Zaretskii wrote:
> 2009-05-01 Eli Zaretskii <eliz@gnu.org>
>
> * go32-nat.c (go32_pid_to_str): Call normal_pid_to_str instead of
> printing a bogus "Thread <main>".
I thought that the inferior's PID on DJGPP is always the
fake SOMEPID (42), an internal implementation detail, that we'd
never want to show to the user, but, normal_pid_to_str will
print "process 42" here. Isn't that bogus as well?
> (go32_thread_alive): Don't return 1 for null_ptid.
Interesting. This may be masking some other problem. How
did you get here with inferior_ptid == null_ptid? AFAICS,
when the inferior exits or is killed, the go32_ops target
is unpushed.
>
> Index: gdb/go32-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/go32-nat.c,v
> retrieving revision 1.71
> diff -u -r1.71 go32-nat.c
> --- gdb/go32-nat.c 19 Apr 2009 18:29:33 -0000 1.71
> +++ gdb/go32-nat.c 1 May 2009 08:12:36 -0000
> @@ -870,15 +870,13 @@
> static int
> go32_thread_alive (struct target_ops *ops, ptid_t ptid)
> {
> - return 1;
> + return !ptid_equal (inferior_ptid, null_ptid);
> }
>
> static char *
> go32_pid_to_str (struct target_ops *ops, ptid_t ptid)
> {
> - static char buf[64];
> - xsnprintf (buf, sizeof buf, "Thread <main>");
> - return buf;
> + return normal_pid_to_str (ptid);
> }
>
> static void
>
--
Pedro Alves