From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17925 invoked by alias); 10 Aug 2011 20:57:04 -0000 Received: (qmail 17913 invoked by uid 22791); 10 Aug 2011 20:57:03 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Aug 2011 20:56:43 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7AKugYM007938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Aug 2011 16:56:42 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7AKuguZ022274; Wed, 10 Aug 2011 16:56:42 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p7AKueQe004908; Wed, 10 Aug 2011 16:56:41 -0400 From: Tom Tromey To: Sanjoy Das Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/7] Introduce header (jit-reader.h.in) and modify build system. References: <1312903509-25132-1-git-send-email-sanjoy@playingwithpointers.com> <1312903509-25132-2-git-send-email-sanjoy@playingwithpointers.com> Date: Wed, 10 Aug 2011 20:57:00 -0000 In-Reply-To: <1312903509-25132-2-git-send-email-sanjoy@playingwithpointers.com> (Sanjoy Das's message of "Tue, 9 Aug 2011 20:55:03 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-SW-Source: 2011-08/txt/msg00226.txt.bz2 >>>>> "Sanjoy" == Sanjoy Das writes: Sanjoy> jit-reader.h.in will host the interface to be implemented and the API Sanjoy> to be used by the reader. The file needs to be processed by Sanjoy> ./configure to produce `jit.reader.h'; so that GDB_CORE_ADDR is Sanjoy> defined correctly. This looks pretty good. Sanjoy> + -DLOCALEDIR="\"$(localedir)\"" $(DEFS) -DLIBDIR="\"@libdir@\"" I want to note that LIBDIR should be relocated at runtime. Sanjoy> +#define GDB_DECLARE_GPL_COMPATIBLE_READER \ Sanjoy> + extern "C" { \ Sanjoy> + extern int plugin_is_GPL_compatible (void) \ Sanjoy> + { \ Sanjoy> + return 0; \ Sanjoy> + } \ Sanjoy> + } This define isn't ok, because the including source code might be C. You can just make two separate defines, one for C and one for C++. Sanjoy> +struct gdb_reader_funcs Sanjoy> +{ Sanjoy> + gdb_read_debug_info *read; Sanjoy> + gdb_unwind_frame *unwind; Sanjoy> + gdb_get_frame_id *get_frame_id; Sanjoy> + gdb_destroy_reader *destroy; Sanjoy> + /* Must be set to GDB_READER_INTERFACE_VERSION */ Sanjoy> + int reader_version; Put the version first. That gives maximum freedom for rearranging the structure in future versions. Tom