This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA take 5] Allow setting breakpoints on inline functions (PR 10738)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Eli Zaretskii <eliz at gnu dot org>, Mark Wielaard <mark at klomp dot org>, Doug Evans <dje at google dot com>
- Date: Mon, 20 Feb 2012 20:48:04 +0100
- Subject: Re: [RFA take 5] Allow setting breakpoints on inline functions (PR 10738)
- References: <20120220155848.GA5813@redhat.com>
On Mon, 20 Feb 2012 16:58:49 +0100, Gary Benson wrote:
> This version of the patch has been updated to add a new command line
> option, --allow-incomplete-gdb-indexes,
Sorry I was a bit offline, I believe such option would be OK just as a vendor
patch. Still I understand patching back the backward support is not easy so
OK, one day it can get finally dropped.
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
[...]
> @@ -2121,13 +2125,20 @@ dwarf2_read_index (struct objfile *objfile)
> /* Versions earlier than 3 emitted every copy of a psymbol. This
> causes the index to behave very poorly for certain requests. Version 3
> contained incomplete addrmap. So, it seems better to just ignore such
> - indices. Index version 4 uses a different hash function than index
> - version 5 and later. */
> - if (version < 4)
> + indices.
> +
> + Index version 4 uses a different hash function than index version
> + 5 and later.
> +
> + Versions earlier than 5 did not emit psymbols for inlined
than 6
> + functions. Using these files will cause GDB not to be able to
> + set breakpoints on inlined functions by name, so we ignore these
> + indices unless --allow-incomplete-gdb-indexes was supplied. */
> + if (version < (allow_incomplete_gdb_indexes ? 4 : 6))
> return 0;
> /* Indexes with higher version than the one supported by GDB may be no
> longer backward compatible. */
> - if (version > 5)
> + if (version > 6)
> return 0;
>
> map = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct mapped_index);
[...]
> --- a/gdb/main.c
> +++ b/gdb/main.c
> @@ -87,6 +87,11 @@ int return_child_result_value = -1;
> /* Whether to enable writing into executable and core files. */
> extern int write_files;
>
> +/* Whether to use incomplete .gdb-index sections.
> + The default is to reject them. */
> +
> +extern int allow_incomplete_gdb_indexes;
> +
Please no "extern var" in *.c files, it may lead to non-matching types etc.
I understand it is present in the current codebase but this is not an excuse,
fixed it now:
[obv] Code cleanup: main.c declarations
http://sourceware.org/ml/gdb-patches/2012-02/msg00410.html
Put it to symfile.h where are declarations for other dwarf2read.c definitions.
> @@ -975,6 +982,10 @@ This is the GNU debugger. Usage:\n\n\
> Options:\n\n\
> "), stream);
> fputs_unfiltered (_("\
> + --allow-incomplete-gdb-indexes\n\
> + Do not reject incomplete .gdb-index sections.\n\
I do not understand the option meaning in such terse form. As English
non-native I would prefer just "old" everywhere (or Doug says "deprecated").
Do not reject old (incomplete) .gdb-index sections.\n\
OK for check-in with these and Eli's changes.
Thanks,
Jan