bitfields and tracepoints

David Taylor <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.