This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
The 'x' command: size problem
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: gdb at sources dot redhat dot com
- Date: Tue, 06 Sep 2005 19:00:28 +0400
- Subject: The 'x' command: size problem
Hello!
Suppose I want to print, in binary, content of some large object (for
example, network packet header).
I can use this:
x /154 &packet
Assuming 154 is the size of the object, but neither:
x /sizeof(packet) &packet
nor
set $size = sizeof(packet)
x /$size &packet
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?
- Volodya