public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/17387] New: missing entries for multiple different typedefs with same name in .gdb_index
@ 2014-09-12 19:49 dje at google dot com
  2014-09-12 19:52 ` [Bug symtab/17387] " dje at google dot com
  2014-09-12 19:53 ` dje at google dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dje at google dot com @ 2014-09-12 19:49 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17387

            Bug ID: 17387
           Summary: missing entries for multiple different typedefs with
                    same name in .gdb_index
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

dwarf2read.c:write_psymbols only writes out one copy of each psym here:

      /* Only add a given psymbol once.  */
      slot = htab_find_slot (psyms_seen, psym, INSERT);
      if (!*slot)

which is in and of itself not a bad thing.  For some psyms we only want one
copy.

However, the typedef "mytype" in the attached example is defined in multiple
CUs and has different definitions in each.

This causes the output of "info types mytype" to be different with/without
gdb-generated .gdb_index:

Without gdb-generated .gdb_index:

bash$ gdb a.out
(gdb) info types mytype
All types matching regular expression "mytype":

File a.cc:
typedef A mytype;

File b.cc:
typedef A mytype;

File c.cc:
typedef A::B mytype;

With gdb-generated .gdb_index:

bash$ gdb a.out.2
(gdb) info types mytype
All types matching regular expression "mytype":

File a.cc:
typedef A mytype;

Perhaps a minor issue.  I'm not sure (yet) if there are more serious issues.
Since typedefs have static scope, and since we'll in general want to first look
in the current static scope before looking elsewhere (which we don't always do
right now), it might be that this will remain a minor issue.

Still, it's a bit odd: Why put any statically scoped symbols in the index then?
[and perhaps instead require the user to somehow always specify the desired CU:
e.g. by $pc or by file name or whatever]

-- 
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 symtab/17387] missing entries for multiple different typedefs with same name in .gdb_index
  2014-09-12 19:49 [Bug symtab/17387] New: missing entries for multiple different typedefs with same name in .gdb_index dje at google dot com
@ 2014-09-12 19:52 ` dje at google dot com
  2014-09-12 19:53 ` dje at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dje at google dot com @ 2014-09-12 19:52 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17387

--- Comment #1 from dje at google dot com ---
Created attachment 7784
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7784&action=edit
testcase

-- 
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 symtab/17387] missing entries for multiple different typedefs with same name in .gdb_index
  2014-09-12 19:49 [Bug symtab/17387] New: missing entries for multiple different typedefs with same name in .gdb_index dje at google dot com
  2014-09-12 19:52 ` [Bug symtab/17387] " dje at google dot com
@ 2014-09-12 19:53 ` dje at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dje at google dot com @ 2014-09-12 19:53 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17387

dje at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ccoutant at google dot com

-- 
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:[~2014-09-12 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 19:49 [Bug symtab/17387] New: missing entries for multiple different typedefs with same name in .gdb_index dje at google dot com
2014-09-12 19:52 ` [Bug symtab/17387] " dje at google dot com
2014-09-12 19:53 ` dje at google 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).