This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH, v2] Share ptrace options discovery/linux native code between GDB and gdbserver
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: lgustavo at codesourcery dot com, "'gdb-patches at sourceware dot org'" <gdb-patches at sourceware dot org>
- Date: Tue, 20 Aug 2013 18:03:05 +0100
- Subject: Re: [PATCH, v2] Share ptrace options discovery/linux native code between GDB and gdbserver
- References: <5212A9E1 dot 6030707 at codesourcery dot com> <52139BBA dot 60300 at redhat dot com> <871u5oia03 dot fsf at fleche dot redhat dot com>
On 08/20/2013 05:48 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
>>> +void
>>> +linux_enable_event_reporting (ptid_t ptid)
>
> Pedro> Could you preserve gdbserver's prototype here, please? That
> Pedro> is, take a single integer pid rather than a ptid.
>
> Just a nit -- but why int and not pid_t?
Hysterical raisins, I guess.
Eheh, I purposedly said integer to avoid implying "int". :-)
The current gdbserver prototype does use int, but I don't
care whether it's int or pid_t as long as it's a single
integer.
On the core side, ptid_t holds an int for pid, so code that
faces the core would tend to use int, and we extract pids from ptids
in the target code all the time, so int tends to Just Be Used.
In this particular case, given this is native code, there's
nothing stopping it from using pid_t.
> (Not a typo for ptid_t, that one I understand :)
--
Pedro Alves