This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: The 'x' command: size problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]