public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug exp/12355] New: GDB takes address of a bit-field.  It should not.
@ 2010-12-29 12:06 jan.kratochvil at redhat dot com
  2010-12-29 12:46 ` [Bug exp/12355] " schwab@linux-m68k.org
  2010-12-30  3:25 ` jan.kratochvil at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jan.kratochvil at redhat dot com @ 2010-12-29 12:06 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12355

           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) 7.2.50.20101228-cvs
(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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug exp/12355] GDB takes address of a bit-field.  It should not.
  2010-12-29 12:06 [Bug exp/12355] New: GDB takes address of a bit-field. It should not jan.kratochvil at redhat dot com
@ 2010-12-29 12:46 ` schwab@linux-m68k.org
  2010-12-30  3:25 ` jan.kratochvil at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: schwab@linux-m68k.org @ 2010-12-29 12:46 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12355

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> 2010-12-29 12:06:30 UTC ---
GDB does a few things that are invalid in C, which is not necessarily a bad
thing.

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug exp/12355] GDB takes address of a bit-field.  It should not.
  2010-12-29 12:06 [Bug exp/12355] New: GDB takes address of a bit-field. It should not jan.kratochvil at redhat dot com
  2010-12-29 12:46 ` [Bug exp/12355] " schwab@linux-m68k.org
@ 2010-12-30  3:25 ` jan.kratochvil at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jan.kratochvil at redhat dot com @ 2010-12-30  3:25 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12355

--- Comment #2 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2010-12-29 12:46:11 UTC ---
OK, understood.  But there should be some new operator for it or a query() or
at least a watning().

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-29 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-29 12:06 [Bug exp/12355] New: GDB takes address of a bit-field. It should not jan.kratochvil at redhat dot com
2010-12-29 12:46 ` [Bug exp/12355] " schwab@linux-m68k.org
2010-12-30  3:25 ` jan.kratochvil at redhat dot com

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