From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2793 invoked by alias); 14 Jul 2011 17:25:06 -0000 Received: (qmail 2775 invoked by uid 22791); 14 Jul 2011 17:25:04 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_DB 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; Thu, 14 Jul 2011 17:24:35 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6EHOXjh027533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Jul 2011 13:24:33 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6EHOWQ2023501; Thu, 14 Jul 2011 13:24:33 -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 p6EHOV3i014553; Thu, 14 Jul 2011 13:24:31 -0400 From: Tom Tromey To: Sanjoy Das Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] jit-reader.h: describe interface implemented by the JIT readers. References: <1310588446-23904-1-git-send-email-sanjoy@playingwithpointers.com> Date: Thu, 14 Jul 2011 17:43:00 -0000 In-Reply-To: <1310588446-23904-1-git-send-email-sanjoy@playingwithpointers.com> (Sanjoy Das's message of "Thu, 14 Jul 2011 01:50:45 +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-07/txt/msg00372.txt.bz2 >>>>> "Sanjoy" == Sanjoy Das writes: Sanjoy> Generating ELF files in memory is usually too much work for JIT Sanjoy> compilers, since they usually don't have the related routines (as Sanjoy> opposed to a regular static compiler). One way to simplify this is to Sanjoy> have the JIT vendor themselves provide a shared object which is loaded Sanjoy> and used to parse the debug information. This patch exposes a Sanjoy> simplified interface for the debug info parser. The idea makes sense to me. I'd like this to go in. Sanjoy> This patch adds a header file (`jit-reader.h') which can be included Sanjoy> and implemented in a shared object to build a working JIT Sanjoy> debug-reader. This header should be installed somewhere, I think $includedir/gdb/. The whole header should have conditional 'extern "C"' wrapping, just in case. Sanjoy> +#define GDB_JIT_SUCCESS 1 Sanjoy> +#define GDB_JIT_FAIL 0 Not an enum? Sanjoy> +#ifndef __GDB__INTERNAL /* Only defined when being compiled in GDB. */ Sanjoy> +typedef long long CORE_ADDR; Sanjoy> +#endif I think long long isn't portable. One approach would be to take the configury stuff from gdb and put it into a new header with the appropriate namespace prefixes. The auto-configured bits could be done at build time by extracting stuff from config.h. We should be namespace-safe always, so it should be GDB_CORE_ADDR or GDB_JIT_CORE_ADDR. Sanjoy> +typedef void (gdbjit_symtab_add_line_mapping) Sanjoy> +(struct gdbjit_symtab_callbacks * callbacks, struct gdbjit_symtab *symtab, Indentation. Sanjoy> +typedef struct gdbjit_reg_value (gdbjit_unwind_reg_get) Sanjoy> + (struct gdbjit_unwind_callbacks *callback, int regnum); I would have expected this to take a frame as well. Why doesn't it? Maybe I don't understand the overall plan here. Sanjoy> +/* Called once for each new inferior program. It should also initialize the Sanjoy> + private pointer (to which a pointer is passed here) if the it needs one. s/the// Sanjoy> + Should return GDB_JIT_SUCESS on success and GDB_JIT_FAIL on error. */ Typo, "GDB_JIT_SUCCESS" Sanjoy> +extern int gdbjit_read_debug_info (void *private, Sanjoy> + struct gdbjit_symtab_callbacks *callbacks, Sanjoy> + CORE_ADDR memory, long memory_sz); I don't understand the point of this one. This change needs a patch for the manual. I already forgot... did we get you started on the copyright assignment process? Tom