From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28953 invoked by alias); 14 Apr 2005 18:22:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28841 invoked from network); 14 Apr 2005 18:21:52 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 14 Apr 2005 18:21:52 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j3EILkZu013063 for ; Thu, 14 Apr 2005 14:21:51 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j3EILkO08855; Thu, 14 Apr 2005 14:21:46 -0400 Received: from [172.16.50.53] (vpn50-53.rdu.redhat.com [172.16.50.53]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j3EILjjs027740; Thu, 14 Apr 2005 14:21:46 -0400 Message-ID: <425EB411.6080109@gnu.org> Date: Thu, 14 Apr 2005 18:22:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 1.0.2-1 (X11/20050323) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [Fwd: Re: RFA: DW_OP_piece read path] Content-Type: multipart/mixed; boundary="------------010903040604090005050601" X-SW-Source: 2005-04/txt/msg00129.txt.bz2 This is a multi-part message in MIME format. --------------010903040604090005050601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 59 It appears I sent this to the wrong address, sigh. Andrew --------------010903040604090005050601 Content-Type: message/rfc822; name="Re: RFA: DW_OP_piece read path" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Re: RFA: DW_OP_piece read path" Content-length: 4584 Return-Path: X-Original-To: cagney@localhost Delivered-To: cagney@localhost.localhost.localdomain Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id 56E3E1DF53 for ; Tue, 5 Apr 2005 21:10:00 -0400 (EDT) Envelope-to: cagney@gnu.org Delivery-date: Tue, 05 Apr 2005 21:13:11 -0400 Received: from fencepost.gnu.org by localhost with IMAP (fetchmail-6.2.5) for cagney@localhost (single-drop); Tue, 05 Apr 2005 21:10:00 -0400 (EDT) Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1DIz6V-0007NI-Ql for cagney@gnu.org; Tue, 05 Apr 2005 21:13:11 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1DIz6s-0007vK-Qp for cagney@gnu.org; Tue, 05 Apr 2005 21:13:36 -0400 Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DIz6s-0007uz-BT for cagney@gnu.org; Tue, 05 Apr 2005 21:13:34 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j361DFhr030708; Tue, 5 Apr 2005 21:13:15 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j361DFO26417; Tue, 5 Apr 2005 21:13:15 -0400 Received: from [172.16.50.34] (vpn50-34.rdu.redhat.com [172.16.50.34]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j361DDec020816; Tue, 5 Apr 2005 21:13:14 -0400 Message-ID: <4253365D.2030505@gnu.org> Date: Tue, 05 Apr 2005 21:07:41 -0400 From: Andrew Cagney User-Agent: Mozilla Thunderbird 1.0-5 (X11/20050308) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Elena Zannoni CC: gdb-patches@gnu.org Subject: Re: RFA: DW_OP_piece read path References: <425309E1.2020503@gnu.org> In-Reply-To: <425309E1.2020503@gnu.org> Content-Type: multipart/mixed; boundary="------------060701060307050604070507" X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on monty-python X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 This is a multi-part message in MIME format. --------------060701060307050604070507 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 472 Andrew Cagney wrote: > Elena, > > This gets the read side of DW_OP_piece working, the write side is a lot > more work (in trying to code that side out I noticed that this tweak > would fix the immediate problem). > > Tested on ppc, the printing of long-long in register values (as found in > store.exp) now passes. > > I think with this in place we can (now that I've got some time again, > and my m/c stopped dieing) push out a quick 6.4. > > ok? > Andrew Doh! --------------060701060307050604070507 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1486 2005-04-05 Andrew Cagney * dwarf2loc.c (dwarf2_evaluate_loc_desc): Handle DW_OP_piece reads. Index: dwarf2loc.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2loc.c,v retrieving revision 1.26 diff -p -u -r1.26 dwarf2loc.c --- dwarf2loc.c 31 Mar 2005 19:58:24 -0000 1.26 +++ dwarf2loc.c 5 Apr 2005 21:56:51 -0000 @@ -305,11 +305,27 @@ dwarf2_evaluate_loc_desc (struct symbol dwarf_expr_eval (ctx, data, size); if (ctx->num_pieces > 0) { - /* We haven't implemented splicing together pieces from - arbitrary sources yet. */ - error (_("The value of variable '%s' is distributed across several\n" - "locations, and GDB cannot access its value.\n"), - SYMBOL_NATURAL_NAME (var)); + int i; + long offset = 0; + bfd_byte *contents; + retval = allocate_value (SYMBOL_TYPE (var)); + contents = value_contents_raw (retval); + for (i = 0; i < ctx->num_pieces; i++) + { + struct dwarf_expr_piece *p = &ctx->pieces[i]; + if (p->in_reg) + { + bfd_byte regval[MAX_REGISTER_SIZE]; + int gdb_regnum = DWARF2_REG_TO_REGNUM (p->value); + get_frame_register (frame, gdb_regnum, regval); + memcpy (contents + offset, regval, p->size); + } + else /* In memory? */ + { + read_memory (p->value, contents + offset, p->size); + } + offset += p->size; + } } else if (ctx->in_reg) { --------------060701060307050604070507-- --------------010903040604090005050601--