From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14825 invoked by alias); 6 Sep 2005 15:27:29 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14158 invoked by uid 22791); 6 Sep 2005 15:27:17 -0000 Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 06 Sep 2005 15:27:16 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1ECfLt-0007nY-3T for gdb@sources.redhat.com; Tue, 06 Sep 2005 19:27:14 +0400 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1ECfLn-0007nK-Uq; Tue, 06 Sep 2005 19:27:07 +0400 From: Vladimir Prus To: Paul Koning Subject: Re: The 'x' command: size problem Date: Tue, 06 Sep 2005 15:27:00 -0000 User-Agent: KMail/1.7.2 Cc: gdb@sources.redhat.com References: <17181.45190.337014.159288@gargle.gargle.HOWL> In-Reply-To: <17181.45190.337014.159288@gargle.gargle.HOWL> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509061927.07445.ghost@cs.msu.su> X-SW-Source: 2005-09/txt/msg00031.txt.bz2 On Tuesday 06 September 2005 19:06, Paul Koning wrote: > p/x packet > > will do the job. > > Or if you need to refer to some hex address and interpret it as the > data: > > p/x *(struct packet *) 0x12342324 Good, but: 1. The output format of 'p' is very different from that of 'x'. Given that I use 'x' for general case of 'print 1000 bytes starting at 0x12345678', I'll have to detect when to use 'p', and when to parse output of 'p', not output of 'x'. 2. What if user wants to see 5*sizeof(packet) bytes of memory from a given address? p/x (*(packet*)0x12345678)@5 will work but would require extra code to get that from "5*sizeof(packet)", would require extra code to parse output, and what about even more complex case of "sizeof(first_packet) + 5*sizeof(packet)"? - Volodya