From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [djgpp/commit] Fix go32_pid_to_str and go32_thread_alive
Date: Fri, 01 May 2009 12:57:00 -0000 [thread overview]
Message-ID: <83y6thc75n.fsf@gnu.org> (raw)
In-Reply-To: <200905011118.51917.pedro@codesourcery.com>
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Fri, 1 May 2009 11:18:51 +0100
>
> 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)
True.
> 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?
It is, to some degree. But IMO talking about threads in an
environment that doesn't support threads is a greater lie, so
to say ;-) I wanted the output to be more like when one debugs
a single-threaded program on Unix, because when I first saw
that "Thread <main>" displayed by "set debug infrun 1", I
thought there's some bug somewhere whereby GDB thinks it's
debugging a multithreaded program.
DJGPP users are already used to see 42 popping here and there; e.g.,
that's what getuid and getgid return for the only user and group they
support.
I briefly considered a possibility to add a function to more
faithfully fake the PID of the inferior (DJGPP's version of getpid
simply returns the current BIOS clock tick counter, so I could fetch
that from GDB), but eventually I decided it wasn't worth the hassle.
> > (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?
I didn't. It just seemed unclean to me to return 1 for null_ptid,
when just a little ways above, in go32_stop, we assign it when we
delete the single alive thread.
> AFAICS, when the inferior exits or is killed, the go32_ops target is
> unpushed.
I have no doubt that you are right, but at some future point this
method could potentially be called in some other context.
If you think my change may mask other problems, now or in the future,
I'm okay with adding some appropriate gdb_assert here.
Thanks for the feedback.
next prev parent reply other threads:[~2009-05-01 12:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-01 8:18 Eli Zaretskii
2009-05-01 10:19 ` Pedro Alves
2009-05-01 12:57 ` Eli Zaretskii [this message]
2009-05-01 13:32 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83y6thc75n.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox