This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: The 'x' command: size problem
- From: Daniel Jacobowitz <drow at false dot org>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 6 Sep 2005 11:24:48 -0400
- Subject: Re: The 'x' command: size problem
- References: <dfkaub$n1c$1@sea.gmane.org>
On Tue, Sep 06, 2005 at 07:00:28PM +0400, Vladimir Prus wrote:
> works. In fact, the x_command function in printcmd.c expects the the size
> argument be always given as literal.
>
> This limitation makes it somewhat harder to implement "show this
> variable/expression in binary" command in a GUI. Are there any easy
> workarounds?
Not as far as I know. But you're in a GUI, i.e. hopefully something
with logic and capable of parsing GDB's responses. Is it really that
hard to get the size and print out the right bytes?
-data-evaluate-expression "sizeof(i)"
^done,value="4"
(gdb)
-data-read-memory "&i" t 1 1 4
^done,addr="0xbf82ec04",nr-bytes="4",total-bytes="4",next-row="0xbf82ec08",prev-row="0xbf82ec00",next-page="0xbf82ec08",prev-page="0xbf82ec00",memory=[{addr="0xbf82ec04",data=["10011100","01011110","11101111","10110111"]}]
(gdb)
--
Daniel Jacobowitz
CodeSourcery, LLC