From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8223 invoked by alias); 20 Jun 2010 18:31:33 -0000 Received: (qmail 8215 invoked by uid 22791); 20 Jun 2010 18:31:33 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_CP,TW_QE,T_RP_MATCHES_RCVD 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; Sun, 20 Jun 2010 18:31:29 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5KIVEUG029880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 20 Jun 2010 14:31:14 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5KIVEtp026480; Sun, 20 Jun 2010 14:31:14 -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 o5KIVCIY007187; Sun, 20 Jun 2010 14:31:13 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id B1895378850; Sun, 20 Jun 2010 12:31:12 -0600 (MDT) From: Tom Tromey To: Hui Zhu Cc: Pedro Alves , Stan Shebs , Doug Evans , "gdb-patches\@sourceware.org" , Eli Zaretskii , Michael Snyder Subject: Re: [NEWS/RFA] Re: [gdbserver] x86 agent expression bytecode compiler (speed up conditional tracepoints) References: <201006071700.28706.pedro@codesourcery.com> <4C19222C.2000208@codesourcery.com> <201006162016.18181.pedro@codesourcery.com> <4C19265B.7090502@codesourcery.com> <4C1A6362.3020306@vmware.com> Reply-To: tromey@redhat.com Date: Sun, 20 Jun 2010 18:31:00 -0000 In-Reply-To: (Hui Zhu's message of "Sun, 20 Jun 2010 00:12:41 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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: 2010-06/txt/msg00446.txt.bz2 >>>>> ">" == Hui Zhu writes: >> In dbct, I get the binary code like what you do in this patch. >> define a functon, get binary code from this function, and use it for >> other thing. >> Because Gcc's optimization will compile the function that support the >> code to some asm code that we don't want it to be. In this case I think the code is only using GCC as a sort of glorified assembler. From what I can see it is not taking the qemu approach of having GCC compile C, then memcpying around the resulting object code. Instead it is just using inline assembler, like: EMIT_ASM32 (i386_prologue, "push %ebp\n\t" "mov %esp,%ebp"); This seems more reliable than the write-it-in-C approach. Tom