From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88610 invoked by alias); 3 Aug 2015 19:35:56 -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 88594 invoked by uid 89); 3 Aug 2015 19:35:54 -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-f182.google.com Received: from mail-io0-f182.google.com (HELO mail-io0-f182.google.com) (209.85.223.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 03 Aug 2015 19:35:53 +0000 Received: by ioea135 with SMTP id a135so154752867ioe.1 for ; Mon, 03 Aug 2015 12:35:51 -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=21njZ/eey8lfuYptyHXZpIfGhB03c9PjOcG6VP6IBC8=; b=ahNSwXeBlPIDmeOHx0BCZCDKDRP1ePvpPOyJi6MbhNSx2FMxWqb0RPCEzTOBQ1GrrF YMC/5js0gSBGhWYrlmGH72FEeO0d7T5x2bU/xSOdbwcp7hsK5F73GIJ60GSxkqucFG4d dLi7EwKP7bL1MBG8lvksnkF8iYG6VNrAsefQ9wTY7BqdBDN+xUP4gRpPfvuxBNU+LxVX s0NKPeFJGfiwg2SNX9B4+nswzwwIKt4gQRenydAA779z3F265Na3cYxx1F72wyOx0YCu UUPPUXmVxemxTMlCzmxa56I1SWsDqYOKUs8exX+qrUJnx2mz1XsZJ26M6zSEkYHgGewB PipA== X-Gm-Message-State: ALoCoQk+0rKGykaDcV3sPO1SNwSMIMhQFbfomOYSxq4JcCkyToua9RJdboDh866JnF5tgKlocC6B X-Received: by 10.107.6.231 with SMTP id f100mr21089699ioi.61.1438630551681; Mon, 03 Aug 2015 12:35:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.93.102 with HTTP; Mon, 3 Aug 2015 12:35:11 -0700 (PDT) In-Reply-To: <55BFC0D8.7040309@redhat.com> References: <1438627787-30331-1-git-send-email-palves@redhat.com> <55BFC0D8.7040309@redhat.com> From: Doug Evans Date: Mon, 03 Aug 2015 19:35:00 -0000 Message-ID: Subject: Re: [PATCH v2] 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/msg00051.txt.bz2 On Mon, Aug 3, 2015 at 12:28 PM, Pedro Alves 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 > 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 > > * 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 > > * 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.]