This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: The 'x' command: size problem
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: Paul Koning <pkoning at equallogic dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 6 Sep 2005 19:27:06 +0400
- Subject: Re: The 'x' command: size problem
- References: <dfkaub$n1c$1@sea.gmane.org> <17181.45190.337014.159288@gargle.gargle.HOWL>
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