From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60227 invoked by alias); 3 Aug 2015 18:54:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 60209 invoked by uid 89); 3 Aug 2015 18:54:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f178.google.com Received: from mail-io0-f178.google.com (HELO mail-io0-f178.google.com) (209.85.223.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 03 Aug 2015 18:54:47 +0000 Received: by ioii16 with SMTP id i16so153742639ioi.0 for ; Mon, 03 Aug 2015 11:54:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=kfsqlp0t2qPoX8zEmg2l+IgUINCECDqZ16vbjzIsYhw=; b=T+n/I7MVXZNPFrei1p6kcUmRD1MonFitn0AViE7VWXAA9zwwd2HeRjob0Dkju/e791 9R1kBt3NBDcys2pgWACxc1mOCskQtwmilYwTylUFo5mUDS3n/YPwYOkiSE3MWGL74I+q SSIYpING7jFyz3BUDXk70RWOXR9TXkqwredddgW4J3mRXyUEZPannU8TniTq8dwUolNT rr23sgiv4IoRi396tEdjkXUa+/L2CmRzrcajXFGnvSlxo7iYTQ2uN6iAcujHQ8FtMbc3 ADmHMHDTKsKy8hTbrzn6V4WA0Oq1vcdJhH3/dt2RBySYBIThI86LrcE/HqB01UY7eWWW HrOg== X-Gm-Message-State: ALoCoQln7/NXoD08DrxJqi+PgqLiTnQQeh27s6ZplWONUH93WxCM9bhczACaQRF3uBfUZ8rRol5v X-Received: by 10.107.135.41 with SMTP id j41mr20884892iod.33.1438628085078; Mon, 03 Aug 2015 11:54:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.93.102 with HTTP; Mon, 3 Aug 2015 11:54:05 -0700 (PDT) In-Reply-To: <1438627787-30331-1-git-send-email-palves@redhat.com> References: <1438627787-30331-1-git-send-email-palves@redhat.com> From: Doug Evans Date: Mon, 03 Aug 2015 18:54:00 -0000 Message-ID: Subject: Re: [PATCH] C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c To: Pedro Alves Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00049.txt.bz2 On Mon, Aug 3, 2015 at 11:49 AM, Pedro Alves wrote: > 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. > > gdb/gdbserver/ChangeLog: > 2015-08-03 Pedro Alves > > * thread-db.c (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. > (struct thread_db): Use them. > (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 > > * linux-thread-db.c (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): New typedefs. > (struct thread_db_info): Use them. > (try_thread_db_load_1): Define TDB_VERBOSE_DLSYM, TDB_DLSYM , CHK > local macros and use them instead of verbose_dlsym and dlsym > calls. Hi. Nit: Can we put all the typedefs in a common header?