public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* bitfields and tracepoints
@ 2015-06-03 16:09 David Taylor
  0 siblings, 0 replies; only message in thread
From: David Taylor @ 2015-06-03 16:09 UTC (permalink / raw)
  To: gdb

In file gdb/value.c, function value_fetch_lazy, there is this comment:

      /* To read a lazy bitfield, read the entire enclosing value.  This
	 prevents reading the same block of (possibly volatile) memory once
         per bitfield.  It would be even better to read only the containing
         word, but we have no way to record that just specific bits of a
         value have been fetched.  */

This causes problems for tracepoints.

At a tracepoint you can ask to collect a bit field.  And GDB will send
an expression to the remote target to collect the byte that contains the
bitfield.

When it comes time to view the collected data, it doesn't work -- the
code right after the above comment tries to fetch the entire structure.

Since we didn't ask for the entire structure to be collected -- just the
part containing the bitfield -- it fails.  But, if you compute the
offset of the bitfield from the start of the structure and look there,
you see that the value was correctly collected.

Either the collect action needs to collect the entire structure since it
is a bitfield (bleech!) or the value retrieval code needs to only
require the bytes containing the bitfield.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-03 16:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-03 16:09 bitfields and tracepoints David Taylor

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).