From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5886 invoked by alias); 30 Jul 2009 15:13:10 -0000 Received: (qmail 5867 invoked by uid 22791); 30 Jul 2009 15:13:09 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Jul 2009 15:12:58 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6UFCsUE002960; Thu, 30 Jul 2009 11:12:54 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6UFCrqj004882; Thu, 30 Jul 2009 11:12:53 -0400 Received: from opsy.redhat.com (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 n6UFCq9q002018; Thu, 30 Jul 2009 11:12:52 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 6554C5081C4; Thu, 30 Jul 2009 09:12:51 -0600 (MDT) To: Reid Kleckner Cc: gdb-patches@sourceware.org, unladen-swallow@googlegroups.com Subject: Re: [RFA] Add interface for registering JITed code References: <9a9942200907221615o570e749fh5cb186c1600f159c@mail.gmail.com> <9a9942200907240946q1546646ft6e9112f263bcefdf@mail.gmail.com> <9a9942200907241639o4e4b1d4ema22bac7bb6db9e35@mail.gmail.com> From: Tom Tromey Reply-To: Tom Tromey Date: Thu, 30 Jul 2009 16:30:00 -0000 In-Reply-To: <9a9942200907241639o4e4b1d4ema22bac7bb6db9e35@mail.gmail.com> (Reid Kleckner's message of "Fri\, 24 Jul 2009 16\:39\:19 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-07/txt/msg00741.txt.bz2 >>>>> "Reid" == Reid Kleckner writes: Tom> Yeah. This would work if you had two JITs in a process, say loaded Tom> dynamically, and the various __jit symbols had hidden visibility. Reid> I think if someone has that use case, then they can write a client Reid> side library that wraps the __jit symbols and make the two JITs call Reid> that. Yeah, I changed my mind, let's not worry about it. If it ever comes up, we can deal with it then without breaking compatibility. Reid> + /* Remember a mapping from entry_addr to objfile. */ Reid> + set_objfile_data (objfile, jit_objfile_data, (void*) entry_addr); Tom> I don't think you need the cast here. There are a few of these. Reid> Actually, it is, because entry_addr is a CORE_ADDR. CORE_ADDR fits Reid> into a void* right? I'm just doing it to avoid mallocing a single Reid> CORE_ADDR. Oh, I see. It is better to just do the allocation; I think we try to avoid casting between CORE_ADDR and void*. Reid> + case BPSTAT_WHAT_CHECK_JIT: Reid> + if (debug_infrun) Reid> + fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_CHECK_JIT\n"); Reid> + Reid> + /* Switch terminal for any messages produced by breakpoint_re_set. */ Reid> + target_terminal_ours_for_output (); Is the comment here really valid? I think it should probably mention jit_event_handler, not breakpoint_re_set. Reid> +//#include "assert.h" Reid> +//#include "string.h" Just delete these. (And just FYI, gdb doesn't allow "//" comments.) Reid> +/* Openning the file is a no-op. */ Typo, should be "opening". Reid> + /* If we already found the symbols and successfully set the breakpoint, don't Reid> + do it again. */ Reid> + if (jit_descriptor_addr != 0) Reid> + return; I'm sorry I didn't notice this before. This approach won't work if you have address space randomization enabled and you re-run the inferior. Tom