Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c
Date: Mon, 03 Aug 2015 19:35:00 -0000	[thread overview]
Message-ID: <CADPb22TtLZz0+ts_Fd5RqKJKRPME9Dx-Nmkg9WhJsP=az+7puQ@mail.gmail.com> (raw)
In-Reply-To: <55BFC0D8.7040309@redhat.com>

On Mon, Aug 3, 2015 at 12:28 PM, Pedro Alves <palves@redhat.com> wrote:
> On 08/03/2015 07:54 PM, Doug Evans wrote:
>
>> Nit: Can we put all the typedefs in a common header?
>
> Good idea.  How about this?
>
> From 387898b86474ca9647ca8a498a68d521033555e1 Mon Sep 17 00:00:00 2001
> From: Pedro Alves <palves@redhat.com>
> Date: Mon, 3 Aug 2015 20:23:59 +0100
> Subject: [PATCH v2] C++: dlsym casts in gdb/linux-thread-db.c and
>  gdb/gdbserver/thread-db.c
>
> Implicit void * -> function pointer conversion doesn't work in C++, so
> in C++, we need to cast the result of dlsym.  This adds a few typedefs
> and macros that make this easy.  GDBserver's version already had the
> CHK macro, so I added it to GDB too.
>
> Tested on x86_64 Fedora 20, native and gdbserver.
>
> gdb/gdbserver/ChangeLog:
> 2015-08-03  Pedro Alves  <palves@redhat.com>
>
>         * thread-db.c (struct thread_db): Use new typedefs.
>         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
>         CHK calls.
>         (disable_thread_event_reporting): Cast result of dlsym to
>         destination function pointer type.
>         (thread_db_mourn): Use td_ta_delete_ftype.
>
> gdb/ChangeLog:
> 2015-08-03  Pedro Alves  <palves@redhat.com>
>
>         * nat/gdb_thread_db.h (td_init_ftype, td_ta_new_ftype)
>         (td_ta_map_lwp2thr_ftype, td_ta_thr_iter_ftype)
>         (td_ta_event_addr_ftype, td_ta_set_event_ftype)
>         (td_ta_clear_event_ftype, td_ta_event_getmsg_ftype)
>         (td_thr_validate_ftype, td_thr_get_info_ftype)
>         (td_thr_event_enable_ftype, td_thr_tls_get_addr_ftype)
>         (td_thr_tlsbase_ftype, td_symbol_list_ftype, td_ta_delete_ftype):
>         New typedefs.
>         * linux-thread-db.c (struct thread_db_info): Use new typedefs.
>         (try_thread_db_load_1): Define TDB_VERBOSE_DLSYM, TDB_DLSYM , CHK
>         local macros and use them instead of verbose_dlsym and dlsym
>         calls.

"works for me"
[FAOD, I have no other comments on the patch.]


  reply	other threads:[~2015-08-03 19:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 18:49 [PATCH] " Pedro Alves
2015-08-03 18:54 ` Doug Evans
2015-08-03 19:28   ` [PATCH v2] " Pedro Alves
2015-08-03 19:35     ` Doug Evans [this message]
2015-08-04  8:47       ` Pedro Alves
2015-08-05 13:34     ` Ulrich Weigand
2015-08-05 13:51       ` Pedro Alves
2015-08-05 14:35         ` Ulrich Weigand
2015-08-05 14:36           ` 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='CADPb22TtLZz0+ts_Fd5RqKJKRPME9Dx-Nmkg9WhJsP=az+7puQ@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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