From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7114 invoked by alias); 27 Sep 2007 14:14:03 -0000 Received: (qmail 7098 invoked by uid 22791); 27 Sep 2007 14:14:02 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS,TW_FH X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 27 Sep 2007 14:13:59 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l8REDrll029545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 27 Sep 2007 10:13:56 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l8REDgK3005118 for ; Thu, 27 Sep 2007 10:13:52 -0400 Received: from toothpaste.toronto.redhat.com (toothpaste.toronto.redhat.com [172.16.14.161]) by pobox.toronto.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l8REDglh002732 for ; Thu, 27 Sep 2007 10:13:42 -0400 Message-ID: <46FBBA96.8050606@redhat.com> Date: Thu, 27 Sep 2007 14:14:00 -0000 From: Teresa Thomas User-Agent: Thunderbird 2.0.0.5 (X11/20070719) MIME-Version: 1.0 To: frysk Subject: Re: New fhpd commands: ptype & plocation References: <46FAC452.4010301@redhat.com> <46FB527F.2070809@redhat.com> In-Reply-To: <46FB527F.2070809@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00405.txt.bz2 Phil Muldoon wrote: > Apart from the output code, and parsing code in fhpd, is the "get the > location" code placed in a utility class somewhere? Can you give a > programming example of given variable foo, how to get a location or > locations in memory of where it resides? Following is an example taken from /Variable.java/: // Get the DWARF operations that describe the variable's location from its DIE List ops = variableDie.getFormData(frame.getAdjustedAddress()); // Create a LocationExpression from it LocationExpression locationExpression = new LocationExpression(frame, variableDie, ops); // Decode the expression to get the location and create a PieceLocation from it PieceLocation pieceLocation = new PieceLocation(locationExpression.decode(this.getType(frame).getSize())); pieceLocation will now contain the (list of) location(s). You can print it by using its toPrint function, manipulate its bytes, etc. [Refer /Location.java /and /PieceLocation.java/ (or ping me :-) ) for its other functions]