From: Pedro Alves <palves@redhat.com>
To: Norbert Lange <nolange79@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][PR build/24805] Explicitly export symbols from gdb_proc_service
Date: Thu, 16 Jan 2020 19:56:00 -0000 [thread overview]
Message-ID: <8bcb4e8b-3623-62ff-cb44-31ca37b916db@redhat.com> (raw)
In-Reply-To: <CADYdroN_wGOg91nu+5Z=by=DPS65KiDn3NxQxSA1uDXqV99odA@mail.gmail.com>
On 1/14/20 4:56 PM, Norbert Lange wrote:
> Am Di., 14. Jan. 2020 um 16:36 Uhr schrieb Pedro Alves <palves@redhat.com>:
>>
>> We can't drop support for the glibc header, since that would mean
>> to also drop support for the Solaris version of the header, and
>> also for whatever other libcs that people build gdb with (e.g.,
>> does musl have its own version of the header with different types?).
>> Up until not so long ago, glibc didn't use to install the header,
>> that's why we keep a local copy, IIRC.
>
> No, you don't get what I am trying to say.
> Commonly you only use external headers for function calls,
> and the exact definition can vary a bit.
>
> What you are doing, for ex. in proc-service.c is implementing the function.
>
> like:
>> ps_err_e
>> ps_pdread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t size)
>
> you don't get much, if any, information from the header that's not replicated
> in the source. The only upside would be to be able to detect mismatches
> (but that could be done in a separate test_external_proc_header.c,
> potentially even during configuration).
>
> Whatever other libc's (musl doesnt provide/use this AFAIK) or OS's do,
> including their header does not help at all?
Well, there's also typedefs, enums, structures. ps_err_e, for example.
>
> You get no mismatch: Don't need it.
> You get a mismatch: you need to fix that in your c file aswell.
Or in the header, if the mismatch is in the (non-function) types.
>
>>
>> How about something like this? It's similar to your #2 at
>> <https://sourceware.org/bugzilla/show_bug.cgi?id=24805#c3>, but
>> I'm using typeof to avoid issues with different systems using
>> different prototypes.
>
> Yeah, that's better, unless typeof is not supported by the compiler
> (or its C++ mode).
AFAIK, all relevant compilers support it.
>>> How about something like this? It's similar to your #2 at
>>> <https://sourceware.org/bugzilla/show_bug.cgi?id=24805#c3>, but
>>> I'm using typeof to avoid issues with different systems using
>>> different prototypes.
>>
>> BTW, I forgot to mention why I suggested this as alternative
>> to the push/pop approach. It was that the push/pop approach
>> makes everything indirectly included by <proc_service.h>
>> have default visibility too. I don't know whether that ends
>> up being any function in practice, though.
>
> Yes I am aware of this issue, and its a latent problem I guess.
> Normally you don't implement header definitions, so you might be ok.
>
> Adding tests whether the functions are exported would be nice.
Agreed.
I've merged this to master now.
Thanks,
Pedro Alves
prev parent reply other threads:[~2020-01-16 19:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-04 20:20 Norbert Lange
2020-01-04 20:20 ` [PATCH] always export the symbols for the proc_service interface Norbert Lange
2020-01-06 16:07 ` Tom Tromey
2020-01-06 23:22 ` Norbert Lange
2020-01-06 19:21 ` [PATCH][PR build/24805] Explicitly export symbols from gdb_proc_service Pedro Alves
2020-01-06 23:39 ` Norbert Lange
2020-01-14 15:47 ` Pedro Alves
2020-01-14 16:28 ` Pedro Alves
2020-01-14 16:57 ` Norbert Lange
2020-01-16 19:56 ` Pedro Alves [this message]
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=8bcb4e8b-3623-62ff-cb44-31ca37b916db@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=nolange79@gmail.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