Tom de Vries aef36dee93 [gdb/symtab] Don't deduplicate variables in gdb-index
When running test-case gdb.python/py-symbol.exp with target board
cc-with-gdb-index, we run into:
...
(gdb) python print (len (gdb.lookup_static_symbols ('rr')))^M
1^M
(gdb) FAIL: gdb.python/py-symbol.exp: print (len (gdb.lookup_static_symbols ('rr')))
...

[ Note that the test-case contains rr in both py-symtab.c:
...
static int __attribute__ ((used)) rr = 42;	/* line of rr */
...
and py-symtab-2.c:
...
static int __attribute__ ((used)) rr = 99;	/* line of other rr */
... ]

This passes with gdb-12-branch, and fails with gdb-13-branch.

AFAIU the current code in symtab_index_entry::minimize makes the assumption
that it's fine to store only one copy of rr in the gdb-index, because
"print rr" will only ever print one, and always the same.

But that fails to recognize that gdb supports gdb.lookup_static_symbols, which
returns a list of variables rather than the first one.

In other words, the current approach breaks feature parity between cooked
index and gdb-index.

Note btw that also debug-names has both instances:
...
[  5] #00597969 rr:
        <4> DW_TAG_variable DW_IDX_compile_unit=3 DW_IDX_GNU_internal=1
        <4> DW_TAG_variable DW_IDX_compile_unit=4 DW_IDX_GNU_internal=1
...

Fix this in symtab_index_entry::minimize, by not deduplicating variables.

Tested on x86_64-linux, with target boards unix and cc-with-gdb-index.

Reviewed-by: Kevin Buettner <kevinb@redhat.com>

PR symtab/30720
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30720
2023-08-13 14:08:06 +02:00
2023-08-13 00:00:21 +00:00
2023-08-12 10:27:57 +09:30
2020-09-25 10:24:44 -04:00
2023-07-03 11:12:15 +01:00
2023-08-12 16:26:41 +09:30
2023-08-12 10:27:57 +09:30
2023-08-02 12:06:23 +01:00
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2023-08-12 10:27:57 +09:30
2022-01-28 08:25:42 -05:00
2023-08-02 12:06:23 +01:00
2023-08-12 10:27:57 +09:30
2023-08-12 10:25:06 +09:30
2023-08-12 10:27:57 +09:30
2023-08-02 12:06:23 +01:00

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.
S
Description
Yggdrasil port of GNU Binutils
Readme 418 MiB