From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21907 invoked by alias); 20 May 2010 06:21:53 -0000 Received: (qmail 21897 invoked by uid 22791); 20 May 2010 06:21:52 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,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; Thu, 20 May 2010 06:21:45 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4K6LaZR011563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 May 2010 02:21:36 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4K6LZog006880; Thu, 20 May 2010 02:21:36 -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 o4K6LZZo025905; Thu, 20 May 2010 02:21:35 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id A9BD437818E; Thu, 20 May 2010 00:21:34 -0600 (MDT) From: Tom Tromey To: Stan Shebs Cc: gdb-patches@sourceware.org, Jan Kratochvil Subject: Re: RFC: implement DW_OP_bit_piece References: <4BF327D2.3000802@codesourcery.com> <4BF48941.4090500@codesourcery.com> Reply-To: Tom Tromey Date: Thu, 20 May 2010 07:12:00 -0000 In-Reply-To: (Tom Tromey's message of "Wed, 19 May 2010 21:28:46 -0600") 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-05/txt/msg00408.txt.bz2 Tom> But it seems like this can probably be done without that. Though, I Tom> haven't looked enough at ax.h to know whether it can represent all of Tom> DWARF... which reminds me, how much trouble is it to add to AX? Is it Tom> versioned so we can detect old remotes? I looked a little. I didn't see explicit versioning in the agent expressions but I gather from remote.c that we could add a new remote feature and query it. I looked at DWARF->AX translation. I see how most of it can be done, except: DW_OP_implicit_value can be arbitrarily wide. It seems strange to even want to upload a constant, but this could be used as part of a bigger expression. However in practice it is probably ok. Some stack ops are missing: DW_OP_pick, DW_OP_rot, DW_OP_over. I think 'over' is emitted by gcc, but maybe we could recognize the particular bytecode sequence and generate a signed modulus directly. (Yuck.) DW_OP_call_frame_cfa seems to require some gyrations, I didn't trace all the way down to see if it is reasonably possible. DW_OP_GNU_push_tls_address. Maybe possible, but I don't know enough. DW_OP_piece and DW_OP_bit_piece. These are problems in some contexts, but not others. A few cases I've considered: * As the terminus of a trace expression they ought to be ok. This means a simple expression, like a variable, which is made of pieces. In this case I think we can probably trace the various parts and discard each result until the final one. * They might be ok as part of an aggregate which is then "sliced" at a constant offset. So, something like "struct.field" or "array[5]". However, I think they are not ok, or at least difficult to compile, if the expression is something like "array[i]". Even the possible case here will probably lead to ridiculous bytecode in some cases. Tom