From: Doug Evans <dje@google.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] change gdbserver's pids to int
Date: Thu, 04 Dec 2008 23:02:00 -0000 [thread overview]
Message-ID: <e394668d0812041502u2c56ebdei8d28a4af9ee06822@mail.gmail.com> (raw)
In-Reply-To: <20081204131535.GC24868@caradoc.them.org>
On Thu, Dec 4, 2008 at 5:15 AM, Daniel Jacobowitz <drow@false.org> wrote:
> On Wed, Dec 03, 2008 at 05:24:16PM -0800, Doug Evans wrote:
>> gdb uses an int for a pid (see ptid.pid in defs.h),
>> and, for example, gdbserver's target_ops.create_inferior returns an int.
>> For consistency I made pid an int elsewhere in gdbserver,
>> except for "id" in struct inferior_list - it's used for more than just pids
>> although I suspect int could be used here too, left for another day.
>>
>> Plus this cleans things up by removing local decls of signal_pid.
>>
>> Ok to check in?
>
> Are you sure that every place you touched gets a system PID, not a
> thread ID? They used to be ints, but were changed to unsigned long
> because NPTL's TIDs do not fit in an int.
Ya, I specifically stuck to pids.
> Also, do Windows PIDs fit in an int? Win32 pids must, but I expect
> we'll get a Win64 port at some point.
Good question. I was in part going for consistency with what gdb uses.
Maybe it would be useful to have gdb_pid_t, gdb_tid_t types that both
gdb and gdbserver use.
> I'd like to know the advantage before moving all the deck chairs round
> again.
Consistency with gdb is good. Plus it's odd to pass an unsigned long
to linux_attach_lwp and then it pass that as the pid argument to
ptrace when linux_create_inferior is using an int for pid. And it's
odd that signal_pid is an unsigned long which is then passed to
waitpid. Compiling gdbserver with -Wconversion may have a lot of
noise (enough to warrant not making it the default anyway), but I
think we can still make an effort to be clean.
next prev parent reply other threads:[~2008-12-04 23:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-04 1:24 Doug Evans
2008-12-04 13:16 ` Daniel Jacobowitz
2008-12-04 23:02 ` Doug Evans [this message]
2008-12-04 23:30 ` Daniel Jacobowitz
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=e394668d0812041502u2c56ebdei8d28a4af9ee06822@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
/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