Compare commits

...

22 Commits
master ... f20

Author SHA1 Message Date
Sergio Durigan Junior 67ec2aac3d Fix 'Unowned dir /usr/include/gdb/' (RH BZ 1164991). 2014-11-20 15:49:04 -05:00
Jan Kratochvil 377b9ad425 Accelerate interactive symbols lookup 15x. 2014-10-21 07:55:37 +02:00
Sergio Durigan Junior b1f7008523 Fix 'Slow gstack performance'
(RH BZ 1149865, Jan Kratochvil).
2014-10-06 15:31:47 -04:00
Sergio Durigan Junior 24eac2d9ee Install gdb/jit-reader.h on include directory (BZ 1141968). 2014-09-16 11:54:55 -04:00
Jan Kratochvil 73cfb1774e Import upstream demangler fixes (Gary Benson, Andrew Burgess, BZ 1119559). 2014-08-14 21:32:06 +02:00
Jan Kratochvil f5d8282868 Fix regression#2 of the optimized-out entry data values fix (of BZ 1111910). 2014-07-11 17:41:13 +02:00
Jan Kratochvil c8e95a894d Fix regression of the optimized-out entry data values fix (of BZ 1111910). 2014-07-09 13:00:42 +02:00
Jan Kratochvil 01d3c9fc03 Fix memory errors with demangled name hash (Tom Tromey). 2014-07-01 00:15:01 +02:00
Jan Kratochvil 33ee81f021 Fix crash on optimized-out entry data values (BZ 1111910). 2014-06-30 23:57:17 +02:00
Jan Kratochvil 2101c50067 Merge remote-tracking branch 'origin/master' into f20 2014-05-14 21:22:19 +02:00
Jan Kratochvil ddcd4174da Merge remote-tracking branch 'origin/master' into f20 2014-05-12 20:27:32 +02:00
Jan Kratochvil 2fb957dac0 Merge branch 'f20' 2014-05-09 21:40:11 +02:00
Jan Kratochvil 1ec4463ac7 Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). 2014-02-24 23:27:23 +01:00
Jan Kratochvil ac10ee0d48 [s390*,ppc*] Enable secondary targets s390* and ppc* (BZ 1056259). 2014-01-23 20:43:11 +01:00
Jan Kratochvil b2b7558c35 Backport several gdb-7.6.x stable branch fixes (BZ 1055155). 2014-01-19 19:36:15 +01:00
Jan Kratochvil ab8eb47ebe [aarch64] Backport two breakpoint/watchpoint fixes. 2013-12-25 20:55:05 +01:00
Jan Kratochvil 2bc6944ab3 [rhel7] [--with testsuite] Remove gcc-java&co. BuildRequires. 2013-11-18 15:52:54 +01:00
Jan Kratochvil f823fec325 Fix explicit Class:: inside class scope (BZ 874817, Keith Seitz). 2013-11-09 19:27:47 +01:00
Jan Kratochvil 2598b60bc9 [aarch64] Backport two fixes (BZ 1026484). 2013-11-05 14:58:36 +01:00
Jan Kratochvil 7492fba56d Fix %{_bindir}gdb-add-index to also use -iex 'set auto-load no'. 2013-11-03 16:09:18 +01:00
Jan Kratochvil 0015e2ee6e [rhel5] Fix /etc/gdbinit compatibility with python-2.4. 2013-10-30 12:52:17 +01:00
Sergio Durigan Junior 5430618261 - Fix the case when GDB leaks memory because value_struct_elt does not call
check_typedef.  (Doug Evans, BZ 15695, filed as RH BZ 1013453).
2013-10-01 00:38:47 -03:00
5 changed files with 2109 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,349 @@
Date: Thu, 2 Oct 2014 17:56:53 +0200
From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
To: Doug Evans <dje at google dot com>
Cc: gdb-patches at sourceware dot org
Subject: [patchv2] Fix 100x slowdown regression on DWZ files
Message-ID: <20141002155653.GA9001@host2.jankratochvil.net>
--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Thu, 02 Oct 2014 01:51:38 +0200, Doug Evans wrote:
> I tested this patch with --target_board=dwarf4-gdb-index
> and got a failure in m-static.exp:
That is particularly with -fdebug-types-section.
> Type units read the line table in a separate path,
OK, therefore I dropped that separate struct dwarf2_lineinfo
and reused struct line_header instead.
> OTOH, I do want to avoid any confusion that this patch may inadvertently
> introduce. For example, IIUC with your patch as is,
> if we read a partial_unit first, before a compile_unit
> that has the same stmt_list value, we'll do more processing in
> dwarf_decode_lines than we really need to since we only need a file
> number to symtab mapping. And if we later read in a compile_unit
> with the same stmt_value we'll call dwarf_decode_lines again,
> and this time we need the pc/line mapping it computes.
> Whereas if we process these in the opposite order we'll only call
> dwarf_decode_lines once. I'm sure this will be confusing at first
> to some later developer going through this code.
> [I could be missing something of course, and I'm happy for any corrections.]
Implemented (omitting some story why I did not include it before).
> The code that processes stmt_list for type_units is in setup_type_unit_groups.
> Note that this code goes to the trouble of re-initializing the buildsym
> machinery (see the calls to restart_symtab in dwarf2read.c) when we process
> the second and subsequent type units that share a stmt_list value.
> This is something that used to be done before your patch and will no
> longer be done with your patch (since if we get a cache hit we exit).
> It may be that the type_unit support is doing this unnecessarily,
> which would be great because we can then simplify it.
I hope this patch should no longer break -fdebug-types-section.
If it additionally enables some future optimization for -fdebug-types-section
the better.
> > + /* Offset of line number information in .debug_line section. */
> > + sect_offset offset;
> > + unsigned offset_in_dwz : 1;
>
> IWBN to document why offset_in_dwz is here.
> It's not obvious why it's needed.
+
On Thu, 02 Oct 2014 01:57:03 +0200, Doug Evans wrote:
> Ah, I guess the offset_in_dwz flag will ensure dwarf_decode_lines gets called
> twice regardless of order. But is that the only reason for the flag?
I have added there now:
+ /* OFFSET is for struct dwz_file associated with dwarf2_per_objfile. */
If one removes it regressions really happen. What happens is that this
line_header_hash (former lineinfo_hash) is in struct dwarf2_per_objfile which
is common for both objfile and its objfile.dwz (that one is normally in
/usr/lib/debug/.dwz/ - common for multiple objfiles). And there are two
different DIEs at offset 0xb - one in objfile and one in objfile.dwz - which
would match single line_header if offset_in_dwz was not there.
Also existing dwarf2read.c code usually transfers "dwz flag" together with DIE
offset, such as:
dwarf2_find_containing_comp_unit (sect_offset offset,
unsigned int offset_in_dwz,
struct objfile *objfile)
This reminds me - why doesn't similar ambiguity happen also for dwp_file?
I am unfortunately not much aware of the dwp implementation details.
> > - struct line_header *line_header
> > - = dwarf_decode_line_header (line_offset, cu);
> > + dwarf2_per_objfile->lineinfo_hash =
>
> As much as I prefer "=" going here, convention says to put it on the
> next line.
I have changed it but this was just blind copy from existing line 21818.
> > + htab_create_alloc_ex (127, dwarf2_lineinfo_hash, dwarf2_lineinfo_eq,
>
> I don't have any data, but 127 seems high.
I have not changed it but this was just blind copy from existing line 21818.
> I wouldn't change it, I just wanted to ask if you have any data
> guiding this choice.
Tuning some constants really makes no sense when GDB has missing + insanely
complicated data structures and in consequence GDB is using inappropriate data
structures with bad algorithmic complexity. One needs to switch GDB to C++
and its STL before one can start talking about data structures performance.
No regressions on {x86_64,x86_64-m32,i686}-fedora20-linux-gnu in DWZ mode and
in -fdebug-types-section mode.
Thanks,
Jan
--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="partialunit5.patch"
gdb/
2014-10-02 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix 100x slowdown regression on DWZ files.
* dwarf2read.c (struct dwarf2_per_objfile): Add line_header_hash.
(struct line_header): Add offset and offset_in_dwz.
(dwarf_decode_lines): Add parameter decode_mapping to the declaration.
(free_line_header_voidp): New declaration.
(line_header_hash, line_header_eq): New functions.
(dwarf2_build_include_psymtabs): Update dwarf_decode_lines caller.
(handle_DW_AT_stmt_list): Use dwarf2_per_objfile->line_header_hash.
(free_line_header_voidp): New function.
(dwarf_decode_line_header): Initialize offset and offset_in_dwz.
(dwarf_decode_lines): New parameter decode_mapping, use it.
Index: gdb-7.7.1/gdb/dwarf2read.c
===================================================================
--- gdb-7.7.1.orig/gdb/dwarf2read.c
+++ gdb-7.7.1/gdb/dwarf2read.c
@@ -314,6 +314,9 @@ struct dwarf2_per_objfile
/* The CUs we recently read. */
VEC (dwarf2_per_cu_ptr) *just_read_cus;
+
+ /* Table containing line_header indexed by offset and offset_in_dwz. */
+ htab_t line_header_hash;
};
static struct dwarf2_per_objfile *dwarf2_per_objfile;
@@ -1030,6 +1033,12 @@ typedef void (die_reader_func_ftype) (co
which contains the following information. */
struct line_header
{
+ /* Offset of line number information in .debug_line section. */
+ sect_offset offset;
+
+ /* OFFSET is for struct dwz_file associated with dwarf2_per_objfile. */
+ unsigned offset_in_dwz : 1;
+
unsigned int total_length;
unsigned short version;
unsigned int header_length;
@@ -1518,7 +1527,7 @@ static struct line_header *dwarf_decode_
static void dwarf_decode_lines (struct line_header *, const char *,
struct dwarf2_cu *, struct partial_symtab *,
- int);
+ int, int decode_mapping);
static void dwarf2_start_subfile (const char *, const char *, const char *);
@@ -2046,6 +2055,8 @@ get_section_file_name (const struct dwar
/* Return the id of SECTION.
Returns 0 if SECTION doesn't exist. */
+static void free_line_header_voidp (void *arg);
+
static int
get_section_id (const struct dwarf2_section_info *section)
{
@@ -2450,6 +2461,29 @@ dwarf2_get_dwz_file (void)
dwarf2_per_objfile->dwz_file = result;
return result;
}
+
+/* Hash function for line_header_hash. */
+
+static hashval_t
+line_header_hash (const void *item)
+{
+ const struct line_header *ofs = item;
+
+ return ofs->offset.sect_off ^ ofs->offset_in_dwz;
+}
+
+/* Equality function for line_header_hash. */
+
+static int
+line_header_eq (const void *item_lhs, const void *item_rhs)
+{
+ const struct line_header *ofs_lhs = item_lhs;
+ const struct line_header *ofs_rhs = item_rhs;
+
+ return (ofs_lhs->offset.sect_off == ofs_rhs->offset.sect_off
+ && ofs_lhs->offset_in_dwz == ofs_rhs->offset_in_dwz);
+}
+
/* DWARF quick_symbols_functions support. */
@@ -4453,7 +4487,7 @@ dwarf2_build_include_psymtabs (struct dw
return; /* No linetable, so no includes. */
/* NOTE: pst->dirname is DW_AT_comp_dir (if present). */
- dwarf_decode_lines (lh, pst->dirname, cu, pst, 1);
+ dwarf_decode_lines (lh, pst->dirname, cu, pst, 1, 1);
free_line_header (lh);
}
@@ -8876,24 +8910,64 @@ static void
handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
const char *comp_dir) /* ARI: editCase function */
{
+ struct objfile *objfile = dwarf2_per_objfile->objfile;
struct attribute *attr;
+ unsigned int line_offset;
+ struct line_header *line_header, line_header_local;
+ unsigned u;
+ void **slot;
+ int decode_mapping;
gdb_assert (! cu->per_cu->is_debug_types);
attr = dwarf2_attr (die, DW_AT_stmt_list, cu);
- if (attr)
+ if (attr == NULL)
+ return;
+
+ line_offset = DW_UNSND (attr);
+
+ if (dwarf2_per_objfile->line_header_hash == NULL)
{
- unsigned int line_offset = DW_UNSND (attr);
- struct line_header *line_header
- = dwarf_decode_line_header (line_offset, cu);
-
- if (line_header)
- {
- cu->line_header = line_header;
- make_cleanup (free_cu_line_header, cu);
- dwarf_decode_lines (line_header, comp_dir, cu, NULL, 1);
- }
+ dwarf2_per_objfile->line_header_hash
+ = htab_create_alloc_ex (127, line_header_hash, line_header_eq,
+ free_line_header_voidp,
+ &objfile->objfile_obstack,
+ hashtab_obstack_allocate,
+ dummy_obstack_deallocate);
+ }
+
+ line_header_local.offset.sect_off = line_offset;
+ line_header_local.offset_in_dwz = cu->per_cu->is_dwz;
+ slot = htab_find_slot (dwarf2_per_objfile->line_header_hash,
+ &line_header_local, NO_INSERT);
+
+ /* For DW_TAG_compile_unit we need info like symtab::linetable which
+ is not present in *SLOT. */
+ if (die->tag == DW_TAG_partial_unit && slot != NULL)
+ {
+ gdb_assert (*slot != NULL);
+ cu->line_header = *slot;
+ return;
+ }
+
+ line_header = dwarf_decode_line_header (line_offset, cu);
+ if (line_header == NULL)
+ return;
+ cu->line_header = line_header;
+
+ slot = htab_find_slot (dwarf2_per_objfile->line_header_hash,
+ &line_header_local, INSERT);
+ gdb_assert (slot != NULL);
+ if (*slot == NULL)
+ *slot = line_header;
+ else
+ {
+ gdb_assert (die->tag != DW_TAG_partial_unit);
+ make_cleanup (free_cu_line_header, cu);
}
+ decode_mapping = (die->tag != DW_TAG_partial_unit);
+ dwarf_decode_lines (line_header, comp_dir, cu, NULL, 1,
+ decode_mapping);
}
/* Process DW_TAG_compile_unit or DW_TAG_partial_unit. */
@@ -16826,6 +16900,16 @@ free_line_header (struct line_header *lh
xfree (lh);
}
+/* Stub for free_line_header to match void * callback types. */
+
+static void
+free_line_header_voidp (void *arg)
+{
+ struct line_header *lh = arg;
+
+ free_line_header (lh);
+}
+
/* Add an entry to LH's include directory table. */
static void
@@ -16956,6 +17040,9 @@ dwarf_decode_line_header (unsigned int o
back_to = make_cleanup ((make_cleanup_ftype *) free_line_header,
(void *) lh);
+ lh->offset.sect_off = offset;
+ lh->offset_in_dwz = cu->per_cu->is_dwz;
+
line_ptr = section->buffer + offset;
/* Read in the header. */
@@ -17453,18 +17540,22 @@ dwarf_decode_lines_1 (struct line_header
as the corresponding symtab. Since COMP_DIR is not used in the name of the
symtab we don't use it in the name of the psymtabs we create.
E.g. expand_line_sal requires this when finding psymtabs to expand.
- A good testcase for this is mb-inline.exp. */
+ A good testcase for this is mb-inline.exp.
+
+ Boolean DECODE_MAPPING specifies we need to fully decode .debug_line
+ for its PC<->lines mapping information. Otherwise only filenames
+ tables is read in. */
static void
dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
struct dwarf2_cu *cu, struct partial_symtab *pst,
- int want_line_info)
+ int want_line_info, int decode_mapping)
{
struct objfile *objfile = cu->objfile;
const int decode_for_pst_p = (pst != NULL);
struct subfile *first_subfile = current_subfile;
- if (want_line_info)
+ if (want_line_info && decode_mapping)
dwarf_decode_lines_1 (lh, comp_dir, cu, pst);
if (decode_for_pst_p)

View File

@ -0,0 +1,149 @@
http://sourceware.org/ml/gdb-patches/2014-10/msg00524.html
Subject: [patch 1/2] Accelerate iter_match_first_hashed 1.8x
--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
very simple caching. dict_hash() is being called again and again for the same
string.
#0 in skip_spaces_const (chp=0x7fffb10f9bb6 "ts<char>, std::allocator<char> >::npos") at ./cli/cli-utils.c:244
#1 in msymbol_hash_iw (string=0x7fffb10f9bb6 "ts<char>, std::allocator<char> >::npos") at minsyms.c:89
#2 in dict_hash ( string0=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos") at dictionary.c:840
#3 in iter_match_first_hashed (dict=0x105a7840, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", compare=0x8b82f8 <strcmp_iw>, iterator=0x7fffb10f9970) at dictionary.c:659
#4 in dict_iter_match_first (dict=0x105a7840, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", compare=0x8b82f8 <strcmp_iw>, iterator=0x7fffb10f9970) at dictionary.c:555
#5 in dict_iter_name_first (dict=0x105a7840, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", iterator=0x7fffb10f9970) at dictionary.c:541
#6 in block_iter_name_step (iterator=0x7fffb10f9960, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", first=1) at block.c:580
#7 in block_iter_name_first (block=0x10593e10, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", iterator=0x7fffb10f9960) at block.c:609
#8 in lookup_block_symbol (block=0x10593e10, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", domain=VAR_DOMAIN) at symtab.c:2062
#9 in lookup_symbol_aux_objfile (objfile=0x466f870, block_index=0, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", domain=VAR_DOMAIN) at symtab.c:1664
#10 in lookup_symbol_global_iterator_cb (objfile=0x466f870, cb_data=0x7fffb10f9ad0) at symtab.c:1868
Maybe it could get cached at the caller but:
* We would need to pass the hash value along the whole {dict,block}_iter_*
call chain.
* The DICT_VECTOR virtualization would get violated as dict_linear*_vector do
not use any hash values.
Jan
--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="idxcache1.patch"
gdb/
2014-10-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* dictionary.c (iter_match_first_hashed): Provide state cache for
hash_index from NAME.
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 055c87e..90bcd6d 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -656,9 +656,26 @@ iter_match_first_hashed (const struct dictionary *dict, const char *name,
symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
- unsigned int hash_index = dict_hash (name) % DICT_HASHED_NBUCKETS (dict);
+ unsigned int hash_index;
struct symbol *sym;
+ /* Cache HASH_INDEX. */
+ {
+ static const char *name_ptr_cached;
+ static char *name_content_cached;
+ static unsigned int dict_hash_cached;
+
+ if (name_ptr_cached != name || strcmp (name_content_cached, name) != 0)
+ {
+ dict_hash_cached = dict_hash (name);
+ name_ptr_cached = name;
+ xfree (name_content_cached);
+ name_content_cached = xstrdup (name);
+ }
+ hash_index = dict_hash_cached;
+ }
+ hash_index %= DICT_HASHED_NBUCKETS (dict);
+
DICT_ITERATOR_DICT (iterator) = dict;
/* Loop through the symbols in the given bucket, breaking when SYM
--17pEHd4RhPHOinZp--
http://sourceware.org/ml/gdb-patches/2014-10/msg00525.html
Subject: [patch 2/2] Accelerate lookup_symbol_aux_objfile 8x
--K8nIJk4ghYZn606h
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
lookup_symbol_aux_objfile() processing is very ineffective. For each primary
symtab it searches it and also all its secondary symtabs. But that means that
secondary symtabs included in many primary symtabs get needlessly searched
many times during one lookup_symbol_aux_objfile() run.
lookup_symbol_aux_objfile does not care in which primary/secondary symtab the
symbol is found.
Jan
--K8nIJk4ghYZn606h
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="idxcache2.patch"
gdb/
2014-10-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* symtab.c (lookup_symbol_aux_objfile): Use ALL_OBJFILE_SYMTABS, inline
lookup_block_symbol.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index c530d50..bc800ef 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1657,15 +1657,25 @@ lookup_symbol_aux_objfile (struct objfile *objfile, int block_index,
const struct block *block;
struct symtab *s;
- ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
+ gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK);
+
+ ALL_OBJFILE_SYMTABS (objfile, s)
{
+ struct dict_iterator dict_iter;
+
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, domain);
- if (sym)
+
+ for (sym = dict_iter_name_first (block->dict, name, &dict_iter);
+ sym != NULL;
+ sym = dict_iter_name_next (name, &dict_iter))
{
- block_found = block;
- return fixup_symbol_section (sym, objfile);
+ if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ SYMBOL_DOMAIN (sym), domain))
+ {
+ block_found = block;
+ return fixup_symbol_section (sym, objfile);
+ }
}
}
--K8nIJk4ghYZn606h--

View File

@ -102,3 +102,511 @@ Date: Tue May 13 14:55:53 2014 +0200
}
}
http://sourceware.org/ml/gdb-patches/2014-06/msg00550.html
Subject: Re: ASAN crash regression [Re: [PATCH 2/2] move the demangled_names_hash into the per-BFD]
Jan> ./configure ... -fsanitize=address
Jan> echo 'void f(){}main(){}'|gcc -x c++ - -g;ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ./gdb -batch a.out -ex 'file a.out'
Readily seen with valgrind as well.
Here's my proposed fix.
Tom
commit 3a93a67ad0ea3495f67c9708673345b73de2d806
Author: Tom Tromey <tromey@redhat.com>
Date: Mon Jun 16 03:17:19 2014 -0600
fix memory errors with demangled name hash
This fixes a regression that Jan pointed out.
The bug is that some names were allocated by dwarf2read on the objfile
obstack, but then passed to SYMBOL_SET_NAMES with copy_name=0. This
violates the invariant that the names must have a lifetime tied to the
lifetime of the BFD.
The fix is to allocate names on the per-BFD obstack.
I looked at all callers, direct or indirect, of SYMBOL_SET_NAMES that
pass copy_name=0. Note that only the ELF and DWARF readers do this;
other symbol readers were never updated (and perhaps cannot be,
depending on the details of the formats). This is why the patch is
relatively small.
Built and regtested on x86-64 Fedora 20.
2014-06-16 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (fixup_go_packaging, dwarf2_compute_name)
(dwarf2_physname, read_partial_die)
(guess_partial_die_structure_name, fixup_partial_die)
(guess_full_die_structure_name, anonymous_struct_prefix)
(dwarf2_name): Use per-BFD obstack.
### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,5 +1,13 @@
2014-06-16 Tom Tromey <tromey@redhat.com>
+ * dwarf2read.c (fixup_go_packaging, dwarf2_compute_name)
+ (dwarf2_physname, read_partial_die)
+ (guess_partial_die_structure_name, fixup_partial_die)
+ (guess_full_die_structure_name, anonymous_struct_prefix)
+ (dwarf2_name): Use per-BFD obstack.
+
+2014-06-16 Tom Tromey <tromey@redhat.com>
+
* minsyms.h (prim_record_minimal_symbol)
(prim_record_minimal_symbol_and_info): Update comments.
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7745,9 +7745,10 @@ fixup_go_packaging (struct dwarf2_cu *cu)
if (package_name != NULL)
{
struct objfile *objfile = cu->objfile;
- const char *saved_package_name = obstack_copy0 (&objfile->objfile_obstack,
- package_name,
- strlen (package_name));
+ const char *saved_package_name
+ = obstack_copy0 (&objfile->per_bfd->storage_obstack,
+ package_name,
+ strlen (package_name));
struct type *type = init_type (TYPE_CODE_MODULE, 0, 0,
saved_package_name, objfile);
struct symbol *sym;
@@ -8365,6 +8366,8 @@ dwarf2_compute_name (const char *name,
long length;
const char *prefix;
struct ui_file *buf;
+ char *intermediate_name;
+ const char *canonical_name = NULL;
prefix = determine_prefix (die, cu);
buf = mem_fileopen ();
@@ -8541,19 +8544,25 @@ dwarf2_compute_name (const char *name,
}
}
- name = ui_file_obsavestring (buf, &objfile->objfile_obstack,
- &length);
+ intermediate_name = ui_file_xstrdup (buf, &length);
ui_file_delete (buf);
if (cu->language == language_cplus)
- {
- const char *cname
- = dwarf2_canonicalize_name (name, cu,
- &objfile->objfile_obstack);
+ canonical_name
+ = dwarf2_canonicalize_name (intermediate_name, cu,
+ &objfile->per_bfd->storage_obstack);
+
+ /* If we only computed INTERMEDIATE_NAME, or if
+ INTERMEDIATE_NAME is already canonical, then we need to
+ copy it to the appropriate obstack. */
+ if (canonical_name == NULL || canonical_name == intermediate_name)
+ name = obstack_copy0 (&objfile->per_bfd->storage_obstack,
+ intermediate_name,
+ strlen (intermediate_name));
+ else
+ name = canonical_name;
- if (cname != NULL)
- name = cname;
- }
+ xfree (intermediate_name);
}
}
@@ -8562,7 +8571,7 @@ dwarf2_compute_name (const char *name,
/* Return the fully qualified name of DIE, based on its DW_AT_name.
If scope qualifiers are appropriate they will be added. The result
- will be allocated on the objfile_obstack, or NULL if the DIE does
+ will be allocated on the storage_obstack, or NULL if the DIE does
not have a name. NAME may either be from a previous call to
dwarf2_name or NULL.
@@ -8677,7 +8686,8 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
retval = canon;
if (need_copy)
- retval = obstack_copy0 (&objfile->objfile_obstack, retval, strlen (retval));
+ retval = obstack_copy0 (&objfile->per_bfd->storage_obstack,
+ retval, strlen (retval));
do_cleanups (back_to);
return retval;
@@ -15508,7 +15518,7 @@ read_partial_die (const struct die_reader_specs *reader,
default:
part_die->name
= dwarf2_canonicalize_name (DW_STRING (&attr), cu,
- &objfile->objfile_obstack);
+ &objfile->per_bfd->storage_obstack);
break;
}
break;
@@ -15793,7 +15803,7 @@ guess_partial_die_structure_name (struct partial_die_info *struct_pdi,
if (actual_class_name != NULL)
{
struct_pdi->name
- = obstack_copy0 (&cu->objfile->objfile_obstack,
+ = obstack_copy0 (&cu->objfile->per_bfd->storage_obstack,
actual_class_name,
strlen (actual_class_name));
xfree (actual_class_name);
@@ -15879,8 +15889,9 @@ fixup_partial_die (struct partial_die_info *part_die,
else
base = demangled;
- part_die->name = obstack_copy0 (&cu->objfile->objfile_obstack,
- base, strlen (base));
+ part_die->name
+ = obstack_copy0 (&cu->objfile->per_bfd->storage_obstack,
+ base, strlen (base));
xfree (demangled);
}
}
@@ -18557,7 +18568,7 @@ guess_full_die_structure_name (struct die_info *die, struct dwarf2_cu *cu)
&& actual_name[actual_name_len
- die_name_len - 1] == ':')
name =
- obstack_copy0 (&cu->objfile->objfile_obstack,
+ obstack_copy0 (&cu->objfile->per_bfd->storage_obstack,
actual_name,
actual_name_len - die_name_len - 2);
}
@@ -18603,7 +18614,7 @@ anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu)
if (base == NULL || base == DW_STRING (attr) || base[-1] != ':')
return "";
- return obstack_copy0 (&cu->objfile->objfile_obstack,
+ return obstack_copy0 (&cu->objfile->per_bfd->storage_obstack,
DW_STRING (attr), &base[-1] - DW_STRING (attr));
}
@@ -18943,8 +18954,9 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
char *base;
/* FIXME: we already did this for the partial symbol... */
- DW_STRING (attr) = obstack_copy0 (&cu->objfile->objfile_obstack,
- demangled, strlen (demangled));
+ DW_STRING (attr)
+ = obstack_copy0 (&cu->objfile->per_bfd->storage_obstack,
+ demangled, strlen (demangled));
DW_STRING_IS_CANONICAL (attr) = 1;
xfree (demangled);
@@ -18967,7 +18979,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
{
DW_STRING (attr)
= dwarf2_canonicalize_name (DW_STRING (attr), cu,
- &cu->objfile->objfile_obstack);
+ &cu->objfile->per_bfd->storage_obstack);
DW_STRING_IS_CANONICAL (attr) = 1;
}
return DW_STRING (attr);
commit bb6c123500f8a6df2fdb5f91818ebdf7e67eaebe
Author: gary <gary@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu May 8 09:13:44 2014 +0000
libiberty/
2014-05-08 Gary Benson <gbenson@redhat.com>
* cp-demangle.c (struct d_component_stack): New structure.
(struct d_print_info): New field component_stack.
(d_print_init): Initialize the above.
(d_print_comp_inner): Renamed from d_print_comp.
Do not restore template stack if it would cause a loop.
(d_print_comp): New function.
* testsuite/demangle-expected: New test cases.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210205 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index d9a208b..335a47d 100644
### a/libiberty/ChangeLog
### b/libiberty/ChangeLog
## -1,3 +1,13 @@
+2014-05-08 Gary Benson <gbenson@redhat.com>
+
+ * cp-demangle.c (struct d_component_stack): New structure.
+ (struct d_print_info): New field component_stack.
+ (d_print_init): Initialize the above.
+ (d_print_comp_inner): Renamed from d_print_comp.
+ Do not restore template stack if it would cause a loop.
+ (d_print_comp): New function.
+ * testsuite/demangle-expected: New test cases.
+
2014-04-17 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/56781
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 3d5d33e..68d8ee1 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -275,6 +275,16 @@ struct d_growable_string
int allocation_failure;
};
+/* Stack of components, innermost first, used to avoid loops. */
+
+struct d_component_stack
+{
+ /* This component. */
+ const struct demangle_component *dc;
+ /* This component's parent. */
+ const struct d_component_stack *parent;
+};
+
/* A demangle component and some scope captured when it was first
traversed. */
@@ -327,6 +337,8 @@ struct d_print_info
int pack_index;
/* Number of d_print_flush calls so far. */
unsigned long int flush_count;
+ /* Stack of components, innermost first, used to avoid loops. */
+ const struct d_component_stack *component_stack;
/* Array of saved scopes for evaluating substitutions. */
struct d_saved_scope *saved_scopes;
/* Index of the next unused saved scope in the above array. */
@@ -3934,6 +3946,8 @@ d_print_init (struct d_print_info *dpi, demangle_callbackref callback,
dpi->demangle_failure = 0;
+ dpi->component_stack = NULL;
+
dpi->saved_scopes = NULL;
dpi->next_saved_scope = 0;
dpi->num_saved_scopes = 0;
@@ -4269,8 +4283,8 @@ d_get_saved_scope (struct d_print_info *dpi,
/* Subroutine to handle components. */
static void
-d_print_comp (struct d_print_info *dpi, int options,
- const struct demangle_component *dc)
+d_print_comp_inner (struct d_print_info *dpi, int options,
+ const struct demangle_component *dc)
{
/* Magic variable to let reference smashing skip over the next modifier
without needing to modify *dc. */
@@ -4673,11 +4687,30 @@ d_print_comp (struct d_print_info *dpi, int options,
}
else
{
+ const struct d_component_stack *dcse;
+ int found_self_or_parent = 0;
+
/* This traversal is reentering SUB as a substition.
- Restore the original templates temporarily. */
- saved_templates = dpi->templates;
- dpi->templates = scope->templates;
- need_template_restore = 1;
+ If we are not beneath SUB or DC in the tree then we
+ need to restore SUB's template stack temporarily. */
+ for (dcse = dpi->component_stack; dcse != NULL;
+ dcse = dcse->parent)
+ {
+ if (dcse->dc == sub
+ || (dcse->dc == dc
+ && dcse != dpi->component_stack))
+ {
+ found_self_or_parent = 1;
+ break;
+ }
+ }
+
+ if (!found_self_or_parent)
+ {
+ saved_templates = dpi->templates;
+ dpi->templates = scope->templates;
+ need_template_restore = 1;
+ }
}
a = d_lookup_template_argument (dpi, sub);
@@ -5316,6 +5349,21 @@ d_print_comp (struct d_print_info *dpi, int options,
}
}
+static void
+d_print_comp (struct d_print_info *dpi, int options,
+ const struct demangle_component *dc)
+{
+ struct d_component_stack self;
+
+ self.dc = dc;
+ self.parent = dpi->component_stack;
+ dpi->component_stack = &self;
+
+ d_print_comp_inner (dpi, options, dc);
+
+ dpi->component_stack = self.parent;
+}
+
/* Print a Java dentifier. For Java we try to handle encoded extended
Unicode characters. The C++ ABI doesn't mention Unicode encoding,
so we don't it for C++. Characters are encoded as
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 3ff08e6..453f9a3 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4294,6 +4294,7 @@ void n<void (A::*)() const &>(void (A::*)() const &)
--format=gnu-v3
_ZL1fIiEvv
void f<int>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c3
--format=gnu-v3
_ZSt7forwardIRN1x14refobjiteratorINS0_3refINS0_4mime30multipart_section_processorObjIZ15get_body_parserIZZN14mime_processor21make_section_iteratorERKNS2_INS3_10sectionObjENS0_10ptrrefBaseEEEbENKUlvE_clEvEUlSB_bE_ZZNS6_21make_section_iteratorESB_bENKSC_clEvEUlSB_E0_ENS1_INS2_INS0_20outputrefiteratorObjIiEES8_EEEERKSsSB_OT_OT0_EUlmE_NS3_32make_multipart_default_discarderISP_EEEES8_EEEEEOT_RNSt16remove_referenceISW_E4typeE
x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >& std::forward<x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >&>(std::remove_reference<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> > >::type&)
@@ -4317,3 +4318,28 @@ A::operator C*<C>
_ZN1AcvT_IiEI1CEEv
A::operator C<int><C>()
A::operator C<int><C>
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c16
+--format=gnu-v3
+_ZN3mdr16in_cached_threadIRZNK4cudr6GPUSet17parallel_for_eachIZN5tns3d20shape_representation7compute7GPUImpl7executeERKNS_1AINS_7ptr_refIKjEELl3ELl3ENS_8c_strideILl1ELl0EEEEERKNS8_INS9_IjEELl4ELl1ESD_EEEUliRKNS1_7ContextERNS7_5StateEE_JSt6vectorISO_SaISO_EEEEEvOT_DpRT0_EUlSP_E_JSt17reference_wrapperISO_EEEENS_12ScopedFutureIDTclfp_spcl7forwardISW_Efp0_EEEEESV_DpOSW_
+mdr::ScopedFuture<decltype ({parm#1}(((forward<void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&>)({parm#2}))...))> mdr::in_cached_thread<void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::reference_wrapper<tns3d::shape_representation::compute::GPUImpl::State> >(void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, (void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&&&)...)
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c18
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN13ThreadManager10futureTaskISt5_BindIFSt7_Mem_fnIM6RunnerFvvEEPS5_EEEEvOT_EUlvE_EERSC_v
+void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*& std::_Any_data::_M_access<void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c24
+# aka https://sourceware.org/bugzilla/show_bug.cgi?id=16593
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN3sel8Selector6SetObjI3FooJPKcMS4_FviEEEEvRT_DpT0_EUlvE_EESA_v
+void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*& std::_Any_data::_M_access<void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*&, char const*, void (Foo::*)(int))::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16752#c1
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN13ThreadManager7newTaskIRSt5_BindIFSt7_Mem_fnIM5DiaryFivEEPS5_EEIEEESt6futureINSt9result_ofIFT_DpT0_EE4typeEEOSF_DpOSG_EUlvE_EERSF_v
+std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*& std::_Any_data::_M_access<std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*&&)::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16752#c6
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN6cereal18polymorphic_detail15getInputBindingINS1_16JSONInputArchiveEEENS1_6detail15InputBindingMapIT_E11SerializersERS7_jEUlPvRSt10unique_ptrIvNS5_12EmptyDeleterIvEEEE0_EESA_v
+cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*& std::_Any_data::_M_access<cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16845#c2
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZ4postISt8functionIFvvEEEvOT_EUlvE_EERS5_v
+void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std::_Any_data::_M_access<void post<std::function<void ()> >(void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
commit 0e5f381c7a4292dd37d664e158e71836601fd03a
Author: gary <gary@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed May 14 14:18:49 2014 +0000
libiberty/
2014-05-14 Andrew Burgess <aburgess@broadcom.com>
* cplus-dmem.c (internal_cplus_demangle): Free any resources
allocated by possible previous call to gnu_special.
(squangle_mop_up): Reset pointers to NULL after calling free.
* testsuite/demangle-expected: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210425 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 335a47d..7156be7 100644
### a/libiberty/ChangeLog
### b/libiberty/ChangeLog
## -1,3 +1,10 @@
+2014-05-14 Andrew Burgess <aburgess@broadcom.com>
+
+ * cplus-dmem.c (internal_cplus_demangle): Free any resources
+ allocated by possible previous call to gnu_special.
+ (squangle_mop_up): Reset pointers to NULL after calling free.
+ * testsuite/demangle-expected: New test case.
+
2014-05-08 Gary Benson <gbenson@redhat.com>
* cp-demangle.c (struct d_component_stack): New structure.
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index e948487..2dd0a8a 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -1175,6 +1175,11 @@ internal_cplus_demangle (struct work_stuff *work, const char *mangled)
if ((AUTO_DEMANGLING || GNU_DEMANGLING))
{
success = gnu_special (work, &mangled, &decl);
+ if (!success)
+ {
+ delete_work_stuff (work);
+ string_delete (&decl);
+ }
}
if (!success)
{
@@ -1218,10 +1223,12 @@ squangle_mop_up (struct work_stuff *work)
if (work -> btypevec != NULL)
{
free ((char *) work -> btypevec);
+ work->btypevec = NULL;
}
if (work -> ktypevec != NULL)
{
free ((char *) work -> ktypevec);
+ work->ktypevec = NULL;
}
}
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 453f9a3..823a1c4 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4343,3 +4343,7 @@ cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::p
--format=gnu-v3
_ZNSt9_Any_data9_M_accessIPZ4postISt8functionIFvvEEEvOT_EUlvE_EERS5_v
void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std::_Any_data::_M_access<void post<std::function<void ()> >(void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16817
+--format=auto --no-params
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
commit 8207b6a22d5955c41109399cb09f0af661a593ea
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu May 22 11:56:45 2014 +0000
Fix test in libiberty/testsuite/demangle-expected.
libiberty/
* testsuite/demangle-expected: Fix last commit.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210803 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 7156be7..7b25c7e 100644
### a/libiberty/ChangeLog
### b/libiberty/ChangeLog
## -1,3 +1,7 @@
+2014-05-22 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/demangle-expected: Fix last commit.
+
2014-05-14 Andrew Burgess <aburgess@broadcom.com>
* cplus-dmem.c (internal_cplus_demangle): Free any resources
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 823a1c4..864ee7e 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4347,3 +4347,4 @@ void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std
--format=auto --no-params
_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z

View File

@ -39,7 +39,7 @@ Version: 7.7.1
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 13%{?dist}
Release: 22%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
Group: Development/Debuggers
@ -553,6 +553,15 @@ Patch852: gdb-gnat-dwarf-crash-3of3.patch
Patch865: gdb-static-tls-1of2.patch
Patch866: gdb-static-tls-2of2.patch
# Fix crash on optimized-out entry data values (BZ 1111910).
Patch919: gdb-entrydataoptimizedout.patch
# Fix 'Slow gstack performance' (RH BZ 1149865, Jan Kratochvil).
Patch974: gdb-slow-gstack-performance.patch
# Accelerate interactive symbols lookup 15x.
Patch975: gdb-symbols-lookup-accel.patch
%if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for:
# Patch642: gdb-readline62-ask-more-rh.patch
@ -873,6 +882,9 @@ find -name "*.info*"|xargs rm -f
%patch863 -p1
%patch865 -p1
%patch866 -p1
%patch919 -p1
%patch974 -p1
%patch975 -p1
%patch848 -p1
%if 0%{!?el6:1}
@ -1258,7 +1270,9 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/
rm -f $RPM_BUILD_ROOT%{_infodir}/bfd*
rm -f $RPM_BUILD_ROOT%{_infodir}/standard*
rm -f $RPM_BUILD_ROOT%{_infodir}/configure*
rm -rf $RPM_BUILD_ROOT%{_includedir}
# Just exclude the header files in the top directory, and don't exclude
# the gdb/ directory, as it contains jit-reader.h.
rm -rf $RPM_BUILD_ROOT%{_includedir}/*.h
rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*}
# pstack obsoletion
@ -1339,6 +1353,10 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/pstack
%{_mandir}/*/pstack.1*
%{_datadir}/gdb
%{_includedir}/gdb
# Provide jit-reader.h so that users are able to write their own GDB JIT
# plugins.
%{_includedir}/gdb/jit-reader.h
# don't include the files in include, they are part of binutils
@ -1404,6 +1422,33 @@ fi
%endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch"
%changelog
* Thu Nov 20 2014 Sergio Durigan Junior <sergiodj@redhat.com> - 7.7.1-22.fc20
- Fix 'Unowned dir /usr/include/gdb/' (RH BZ 1164991).
* Mon Oct 20 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.1-21.fc20
- Accelerate interactive symbols lookup 15x.
* Mon Oct 06 2014 Sergio Durigan Junior <sergiodj@redhat.com> - 7.7.1-20.fc20
- Fix 'Slow gstack performance' (RH BZ 1149865, Jan Kratochvil).
* Mon Sep 15 2014 Sergio Durigan Junior <sergiodj@redhat.com> - 7.8-19.fc20
- Install gdb/jit-reader.h on include directory (BZ 1141968).
* Thu Aug 14 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.1-18.fc20
- Import upstream demangler fixes (Gary Benson, Andrew Burgess, BZ 1119559).
* Fri Jul 11 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.1-17.fc20
- Fix regression#2 of the optimized-out entry data values fix (of BZ 1111910).
* Wed Jul 9 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.1-16.fc20
- Fix regression of the optimized-out entry data values fix (of BZ 1111910).
* Tue Jul 1 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.1-15.fc20
- Fix memory errors with demangled name hash (Tom Tromey).
* Mon Jun 30 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.1-14.fc20
- Fix crash on optimized-out entry data values (BZ 1111910).
* Wed May 14 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.1-13.fc21
- [s390*] Import upstream fix for 64->32 debugging.