[Bug exp/12355] New: GDB takes address of a bit-field. It should not.

jan.kratochvil at redhat dot com sourceware-bugzilla@sourceware.org
Wed Dec 29 12:06:00 GMT 2010


           Summary: GDB takes address of a bit-field.  It should not.
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: exp
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jan.kratochvil@redhat.com

struct { unsigned b : 1; } v;
void *p = &v.b;
int main (void) { return 0; }

gcc (GCC) 4.6.0 20101227 (experimental)
1.c:2:1: error: cannot take address of bit-field ‘b’

GNU gdb (GDB)
(gdb) p &v.b
$1 = (unsigned int *) 0x600818

This is confusing for watchpoints etc. if one does not expect a bit-field.

(starting point: value_addr())

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the Gdb-prs mailing list