X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fprdbg.c;h=1b376f485fecf04303d39b6240c1475e65e8dfa9;hb=8df017996f662ce6ab23aea4abeb8f7ac1f62651;hp=7b24fbe61613da28708a3dd746e5bc2bb24b8d0a;hpb=cea7a285058bcba5a54d6493d6914c720f5c40a8;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/prdbg.c b/binutils/prdbg.c index 7b24fbe616..1b376f485f 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -1,5 +1,5 @@ /* prdbg.c -- Print out generic debugging information. - Copyright (C) 1995-2017 Free Software Foundation, Inc. + Copyright (C) 1995-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor . Tags style generation written by Salvador E. Tropea . @@ -286,6 +286,8 @@ static const struct debug_write_fns tg_fns = pr_end_function, /* Same, does nothing. */ tg_lineno }; + +static int demangle_flags = DMGL_ANSI | DMGL_PARAMS; /* Print out the generic debugging information recorded in dhandle. */ @@ -1622,7 +1624,7 @@ pr_tag_type (void *p, const char *name, unsigned int id, t = "union class "; break; default: - abort (); + /* PR 25625: Corrupt input can trigger this case. */ return FALSE; } @@ -1928,14 +1930,14 @@ find_address_in_section (bfd *abfd, asection *section, void *data) if (found) return; - if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0) + if ((bfd_section_flags (section) & SEC_ALLOC) == 0) return; - vma = bfd_get_section_vma (abfd, section); + vma = bfd_section_vma (section); if (pc < vma) return; - size = bfd_get_section_size (section); + size = bfd_section_size (section); if (pc >= vma + size) return; @@ -2115,6 +2117,7 @@ tg_start_class_type (void *p, const char *tag, unsigned int id, struct pr_handle *info = (struct pr_handle *) p; char *tv = NULL; const char *name; + char idbuf[20]; info->indent += 2; @@ -2129,8 +2132,6 @@ tg_start_class_type (void *p, const char *tag, unsigned int id, name = tag; else { - char idbuf[20]; - sprintf (idbuf, "%%anon%u", id); name = idbuf; } @@ -2600,7 +2601,7 @@ tg_variable (void *p, const char *name, enum debug_var_kind kind, dname = NULL; if (info->demangler) - dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS); + dname = info->demangler (info->abfd, name, demangle_flags); from_class = NULL; if (dname != NULL) @@ -2661,7 +2662,7 @@ tg_start_function (void *p, const char *name, bfd_boolean global) dname = NULL; if (info->demangler) - dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS); + dname = info->demangler (info->abfd, name, demangle_flags); if (! substitute_type (info, dname ? dname : name)) return FALSE;