From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16754 invoked by alias); 30 Sep 2011 14:36:39 -0000 Received: (qmail 16438 invoked by uid 22791); 30 Sep 2011 14:36:37 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Sep 2011 14:36:23 +0000 Received: by wwf27 with SMTP id 27so2239134wwf.12 for ; Fri, 30 Sep 2011 07:36:22 -0700 (PDT) Received: by 10.216.89.139 with SMTP id c11mr13915248wef.37.1317393382169; Fri, 30 Sep 2011 07:36:22 -0700 (PDT) Received: from anchor.twiddle.net (c-71-227-161-214.hsd1.wa.comcast.net. [71.227.161.214]) by mx.google.com with ESMTPS id fd4sm9397003wbb.21.2011.09.30.07.36.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Sep 2011 07:36:19 -0700 (PDT) Message-ID: <4E85D3DF.7070307@twiddle.net> Date: Fri, 30 Sep 2011 14:36:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: Jan Kiszka CC: qemu-devel@nongnu.org, gdb@sourceware.org Subject: Re: [PATCH] tcg: Use the GDB JIT debugging interface. References: <1317339968-16212-1-git-send-email-rth@twiddle.net> <4E856BDE.80904@web.de> In-Reply-To: <4E856BDE.80904@web.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00138.txt.bz2 On 09/30/2011 12:12 AM, Jan Kiszka wrote: >> Breakpoint 1, __ldb_mmu (addr=1001716, mmu_idx=0) >> at /home/rth/work/qemu/qemu/softmmu_template.h:86 >> 86 { >> (gdb) where >> #0 __ldb_mmu (addr=1001716, mmu_idx=0) >> at /home/rth/work/qemu/qemu/softmmu_template.h:86 >> #1 0x0000000040000afc in ?? () ... > Would it be possible to tag translated code as well? At TB or maybe even > input instruction level? Only in debugging mode of course. I don't know. A couple of points on that: (1) I was rather expecting frame 1 above to be marked "code_gen_buffer" rather than "??". I *did* install that symbol in the generated ELF image as a function covering the entire buffer. So I'm not quite sure why GDB didn't use it. (2) If we wanted to mark stuff individually, then we would have to manipulate the symbol table presented to GDB. One could do this either via separate ELF images for each TB (overhead ~600 bytes per TB, more if we mark input insns), or via un-registering and re-registering the "main" ELF image after having manipulated the symbol table. Of course, in the later case the layout of the ELF image would get tricky, as the symbol table expands and overruns existing TBs. So, "probably not" is my answer. >> +/* Begin GDB interface. The following must match the docs. */ ... >> +void __jit_debug_register_code(void); >> +void __attribute__((noinline)) __jit_debug_register_code(void) > > Leading '_' are reserved for the system and tabu for the application (we > have some other violations, yes). We have no choice here -- we must use exactly what GDB documents. >> +#if 0 > > #ifdef DEBUG_ELF_GENERATION or so? Sure. r~