public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* The 'x' command: size problem
@ 2005-09-06 15:04 Vladimir Prus
  2005-09-06 15:25 ` Daniel Jacobowitz
       [not found] ` <17181.45190.337014.159288@gargle.gargle.HOWL>
  0 siblings, 2 replies; 12+ messages in thread
From: Vladimir Prus @ 2005-09-06 15:04 UTC (permalink / raw)
  To: gdb


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-09-07 18:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06 15:04 The 'x' command: size problem Vladimir Prus
2005-09-06 15:25 ` Daniel Jacobowitz
2005-09-06 15:35   ` Vladimir Prus
2005-09-06 15:42     ` Daniel Jacobowitz
2005-09-07  6:55       ` Vladimir Prus
2005-09-07 13:14         ` Daniel Jacobowitz
2005-09-07 13:42           ` Vladimir Prus
2005-09-07 18:02             ` Eli Zaretskii
2005-09-06 19:17   ` Eli Zaretskii
2005-09-06 19:29     ` Daniel Jacobowitz
2005-09-07  6:40       ` Vladimir Prus
     [not found] ` <17181.45190.337014.159288@gargle.gargle.HOWL>
2005-09-06 15:27   ` Vladimir Prus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).