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]

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



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