From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16040 invoked by alias); 2 Aug 2007 23:51:22 -0000 Received: (qmail 16032 invoked by uid 22791); 2 Aug 2007 23:51:22 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS 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, 02 Aug 2007 23:51:18 +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 l72NpGfg006397 for ; Thu, 2 Aug 2007 19:51:16 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l72NpGIe001254 for ; Thu, 2 Aug 2007 19:51:16 -0400 Received: from [127.0.0.1] (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l72NpFHa022967 for ; Thu, 2 Aug 2007 19:51:15 -0400 Message-ID: <46B26DF8.6090202@redhat.com> Date: Thu, 02 Aug 2007 23:51:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: frysk@sourceware.org Subject: simplistic examine command 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/msg00264.txt.bz2 FYI, I've added a very simplistic implementation of the examine command. My main purpose is to help illustrate the differences between "print" and "examine" by providing more concrete code. It is far from finished (it should list location addresses et.al.) The main thing to note is the implementation vis: Value v = <> ByteBuffer b = v.getLocation().getByteBuffer() for (int i = 0; i < b.capacity(); i++) print b.getByte(i) Thus examine is about examining the value's underlying data in different formats, for instance, consider: (fhpd) print int_22 22 (fhpd) examine int_22 0: 22 1: 0 2: 0 3: 0 The print command, on the other hand, is much simpler. it's implementation is meant to be: Format format = Format.??? Value v = <> v.toPrint(printWriter, getMemory(), format) For instance: (fhpd) print struct_s --format x { int a = 0x1; int b = 0x2 } (Ok, it doesn't at present, there's some stray code to delete :-). That is it always displays a value according to that value's type. But possibly with the formating of fields changed slightly. This is different to gdb's examine command which can only examine memory, and not arbitrary values that are possibly in memory and/or registers. Andrew