gdb: how to view all memory associated with struct in hex
<p>I have a pointer to a struct and I can print it in gdb using <code>print /x (*s)</code>.</p>

<p>However this gives me:</p>

<blockquote>
  <p>..., intensity = 2 '\002'}, {distance_2cm = 3045, intensity = 3 '\003'}, {distance_2cm = 14735, intensity = 7 '\a'}, {dis
  tance_2cm = 3345, intensity = 3 '\003'}, {distance_2cm = 14272, intensity = 7 '\a'}, {distance_2cm = 3735, intensity =
   2 '\002'}, {distance_2cm = 14617, intensity = 6 '\006'}, {distance_2cm = 4239, intensity = 2 '\002'}, {distance_2cm =
   9741, intensity = 5 '\005'}, {distance_2cm = 4892, intensity = 2 '\002'}, {distance_2cm = 10686, intensity = 4 '\004'
  }, {distance_2cm = 6012, intensity = 3 '\003'}, {distance_2cm = 9906, intensity = 3 '\003'}}}, {head = {laser_block_id
   = 61183, rotational_theta = 21191}, lasers_arary = {{distance_2cm = 0, intensity = 2 '\002'}, {distance_2cm = 0, inte
  nsity = 1 '\001'}, {distance_2cm = 0, intensity = 3 '\003'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance_2cm =
   0, intensity = 2 '\002'}, {distance_2cm = 0, intensity = 2 '\002'}, {distance_2cm = 0, intensity = 1 '\001'}, {distan
  ce_2cm = 6426, intensity = 1 '\001'}, {distance_2cm = 2040, intensity = 3 '\003'}, {distance_2cm = 6584, intensity = 2
   '\002'}, {distance_2cm = 2154, intensity = 3 '\003'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance_2cm = 2282,
   intensity = 3 '\003'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance_2cm = 2428, intensity = 2 '\002'}, {distan
  ce_2cm = 26580, intensity = 33 '!'}, {distance_2cm = 2592, intensity = 5 '\005'}, {distance_2cm = 27180, intensity = 2
  7 '\033'}, {distance_2cm = 2795, intensity = 3 '\003'}, {distance_2cm = 0, intensity = 2 '\002'}, {distance_2cm = 3045
  , intensity = 3 '\003'}, {distance_2cm = 14712, intensity = 22 '\026'}, {distance_2cm = 3342, intensity = 3 '\003'}, {
  distance_2cm = 14181, intensity = 7 '\a'}, {distance_2cm = 3729, intensity = 2 '\002'}, {distance_2cm = 14474, intensi
  ty = 6 '\006'}, {distance_2cm = 4228, intensity = 2 '\002'}, {distance_2cm = 9744, intensity = 1 '\001'}, {distance_2c
  m = 4887, intensity = 2 '\002'}, {distance_2cm = 13075, intensity = 7 '\a'}, {distance_2cm = 5994, intensity = 3 '\003
  '}, {distance_2cm = 9947, intensity = 4 '\004'}}}, {head = {laser_block_id = 61183, rotational_theta = 21207}, lasers_
  arary = {{distance_2cm = 0, intensity = 2 '\002'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance_2cm = 0, intens
  ity = 3 '\003'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance_2cm = 0, intensity = 2 '\002'}, {distance_2cm = 0
  , intensity = 2 '\002'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance
  _2cm = 2038, intensity = 6 '\006'}, {distance_2cm = 6548, intensity = 1 '\001'}, {distance_2cm = 2146, intensity = 3 '
  \003'}, {distance_2cm = 0, intensity = 1 '\001'}, {distance_2cm = 2285, intensity = 3 '\003'}, {distance_2cm = 0, inte
  nsity = 1 '\001'}, {distance_2cm = 2428, intensity = 2 '\002'}, {distance_2cm = 26498, intensity = 33 '!'}, {distance_
  2cm = 2590, intensity = 5 '\005'}, {distance_2cm = 26177, intensity = 29 '\035'}, {distance_2cm = 2792, intensity = 3
  '\003'}, {distance_2cm = 0, intensity = 2 '\002'}, {distance_2cm = 3044, intensity = 3 '\003'}, {distance_2cm = 14743,
   intensity = 7 '\a'}, {distance_2cm = 3344, intensity = 3 '\003'}, {distance_2cm = 14147, intensity = 7 '\a'}, {distan
  ce_2cm = 3728, intensity = 2 '\002'}, {distance_2cm = 14520, intensity = 13 '\r'}, {distance_2cm = 4222, intensity = 2
   '\002'}, {distance_2cm = 14567, intensity = 5 '\005'}, {distance_2cm = 4885, intensity = 3 '\003'}, {distance_2cm = 1
  0842, intensity = 6 '\006'}, {distance_2cm = 5978, intensity = 3 '\003'}, {distance_2cm = 9964, intensity = 6 '\006'}}
  }}}, sd = {gps_time_stamp = 59467414, status_type = 55 '7', status_value = 33 '!'}}</p>
</blockquote>

<p>I want to view it in hex, something like the hypothetical output below:</p>

<pre><code>00000000: 2369 6e63 6c75 6465 203c 6368 6563 6b2e
00000010: 683e 0a0a 2369 6e63 6c75 6465 2022 635f
00000020: 7665 6c6f 6479 6e65 2f61 7267 7061 7273
00000030: 652e 6822 0a23 696e 636c 7564 6520 2263
</code></pre>

<p>Is there a way to do this with gdb?</p>