public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/11846] New: struct should not permit ->
@ 2010-07-28 11:03 jan dot kratochvil at redhat dot com
  2010-07-28 11:17 ` [Bug symtab/11846] " schwab at linux-m68k dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-07-28 11:03 UTC (permalink / raw)
  To: gdb-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

struct
  {
    int x;
  }
s = { 42 };
int main (void) { return s.x; }

OK:
(gdb) p s.x
$2 = 42
But this is wrong:
(gdb) p s->x
$3 = 42
GCC prints:
.c:6: error: invalid type argument of ‘->’ (have ‘struct <anonymous>’)

GNU gdb (GDB) 7.2.50.20100728-cvs

-- 
           Summary: struct should not permit ->
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: symtab
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org
GCC target triplet: x86_64-unknown-linux-gnu


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug symtab/11846] struct should not permit ->
  2010-07-28 11:03 [Bug symtab/11846] New: struct should not permit -> jan dot kratochvil at redhat dot com
@ 2010-07-28 11:17 ` schwab at linux-m68k dot org
  2010-07-28 11:24 ` pedro at codesourcery dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: schwab at linux-m68k dot org @ 2010-07-28 11:17 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From schwab at linux-m68k dot org  2010-07-28 11:17 -------
GDB also permits . on a pointer to struct, so this could be considered
convenience.  Apparently . and -> are basically treated the same.

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug symtab/11846] struct should not permit ->
  2010-07-28 11:03 [Bug symtab/11846] New: struct should not permit -> jan dot kratochvil at redhat dot com
  2010-07-28 11:17 ` [Bug symtab/11846] " schwab at linux-m68k dot org
@ 2010-07-28 11:24 ` pedro at codesourcery dot com
  2010-07-28 11:28 ` jan dot kratochvil at redhat dot com
  2010-07-28 16:33 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pedro at codesourcery dot com @ 2010-07-28 11:24 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2010-07-28 11:24 -------
>From the manual:

@item .@r{, }->
Structure member, and pointer-to-structure member.  For convenience,
@value{GDBN} regards the two as equivalent, choosing whether to dereference a
pointer based on the stored type information.
Defined on @code{struct} and @code{union} data.


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug symtab/11846] struct should not permit ->
  2010-07-28 11:03 [Bug symtab/11846] New: struct should not permit -> jan dot kratochvil at redhat dot com
  2010-07-28 11:17 ` [Bug symtab/11846] " schwab at linux-m68k dot org
  2010-07-28 11:24 ` pedro at codesourcery dot com
@ 2010-07-28 11:28 ` jan dot kratochvil at redhat dot com
  2010-07-28 16:33 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-07-28 11:28 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jan dot kratochvil at redhat dot com  2010-07-28 11:28 -------
I did not know, OK, thanks.

It is true GDB also intentionally lookups `static' objects from other files
which is also not exactly following the C language rules.

Which I may disagree with but this is all I can do.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug symtab/11846] struct should not permit ->
  2010-07-28 11:03 [Bug symtab/11846] New: struct should not permit -> jan dot kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  2010-07-28 11:28 ` jan dot kratochvil at redhat dot com
@ 2010-07-28 16:33 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2010-07-28 16:33 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-07-28 16:33 -------
FWIW --

I think there are some minor differences between the two.
And, we may introduce a few more, since it isn't clear that, e.g.,
"foo.x" should use an overloaded operator->

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2010-07-28 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28 11:03 [Bug symtab/11846] New: struct should not permit -> jan dot kratochvil at redhat dot com
2010-07-28 11:17 ` [Bug symtab/11846] " schwab at linux-m68k dot org
2010-07-28 11:24 ` pedro at codesourcery dot com
2010-07-28 11:28 ` jan dot kratochvil at redhat dot com
2010-07-28 16:33 ` tromey 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).