[DynInst_API:] [dyninst/dyninst] 41ef64: make symbol name demangling consistent (#872, #717)


Date: Thu, 22 Oct 2020 06:26:56 -0700
From: kupsch <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 41ef64: make symbol name demangling consistent (#872, #717)
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: 41ef642f3a43c09e0c46a050687d639f479c3364
      https://github.com/dyninst/dyninst/commit/41ef642f3a43c09e0c46a050687d639f479c3364
  Author: James A. Kupsch <kupsch@xxxxxxxxxxx>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M CMakeLists.txt
    M cmake/LibIberty.cmake
    M cmake/cap_arch_def.cmake
    M common/CMakeLists.txt
    M common/src/freebsdHeaders.h
    M common/src/freebsdKludges.C
    M common/src/linuxHeaders.h
    M common/src/linuxKludges.C
    M common/src/ntHeaders.h
    M common/src/string-regex.C
    A common/src/symbolDemangle.c
    A common/src/symbolDemangle.h
    A common/src/symbolDemangleWithCache.C
    A common/src/symbolDemangleWithCache.h
    M dyninstAPI/h/BPatch_module.h
    M dyninstAPI/src/BPatch_module.C
    M dyninstAPI/src/image.C
    M dyninstAPI/src/image.h
    M dyninstAPI/src/mapped_module.C
    M dyninstAPI/src/mapped_module.h
    M symlite/src/SymLite-elf.C
    M symtabAPI/doc/4-Definitions.tex
    M symtabAPI/h/Symtab.h
    M symtabAPI/src/Aggregate.C
    M symtabAPI/src/Object-elf.C
    M symtabAPI/src/Symbol.C
    M symtabAPI/src/Symtab-edit.C
    M symtabAPI/src/Symtab.C
    M symtabAPI/src/dwarfWalker.C
    M symtabAPI/src/dwarfWalker.h
    M symtabAPI/src/parseStab.C

  Log Message:
  -----------
  make symbol name demangling consistent (#872, #717)

* make all pretty and typed names consistent on linux and freebsd.
  the pretty name is the value returned by 'c++filt -i -p <sym>' and the
  typed name is the value returned by 'c++file -i <sym>'.  In addition
  C++ mangled and nonmangled symbols both have and symbol versioning or
  stabs suffix removed (previously nonmangled symbols included this
  suffix), also for C++ mangled symbols the pretty name now includes any
  present function cloning suffix (previously not included)

* use libiberty's cplus_demangle to generate pretty and typed names
  from the mangled names instead of abi::__cxa_demangle to get the typed
  name and parsing the result to get the pretty name

* remove USE_GNU_DEMANGLE cmake variable as libiberty is now required
  on non-windows platforms

* use common function symbol_demangle to implement both pretty and typed
  names using cplus_demangle and removing suffixes (versioning and
  stabs), and add function cloning suffixes back to the pretty name
  so it is consistent with the mangled and types names.

* added a last result caching version of symbol_demangle,
  symbol_demangle_with_cache used by P_cplus_demangle (matching current
  behavior)

* change P_cplus_demangle interface to take and return a std::string
  instead of a char*

* update SymtabAPI documentation improve the definitions of mangled,
  pretty and typed name for correctness and to match current behavior

* removed demangleSymbol and demangleSymbols methods and other functions
  that are unused or have no effect.

* remove native compiler support (pgcc) from P_cplus_demangle and all
  other uses


  Commit: a5ed9e6b4ded767fdf648384edfdb4dee875e8e5
      https://github.com/dyninst/dyninst/commit/a5ed9e6b4ded767fdf648384edfdb4dee875e8e5
  Author: James A. Kupsch <kupsch@xxxxxxxxxxx>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M common/src/ntHeaders.h
    M common/src/ntKludges.C
    M dyninstAPI/src/pdwinnt.C
    M symtabAPI/src/Object-nt.C

  Log Message:
  -----------
  fix duplicate Windows demangle code

* remove the 2 duplicate cplus_demangle and stripAtSuffix functions
  to the common library in ntKludges.C

* change signature of cplus_demangle name param to be const char*


  Commit: 46f744c1564f92c8a7a79b6257021489584c44fa
      https://github.com/dyninst/dyninst/commit/46f744c1564f92c8a7a79b6257021489584c44fa
  Author: James A. Kupsch <kupsch@xxxxxxxxxxx>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M symtabAPI/src/parseStab.C

  Log Message:
  -----------
  properly check for empty string in parseStabString

* fix bug in code that checked for empty std::string by checking the
  first char of the string being null


  Commit: 14de918f2fdcc8bf09eb022c1021d713ed78c35d
      https://github.com/dyninst/dyninst/commit/14de918f2fdcc8bf09eb022c1021d713ed78c35d
  Author: James A. Kupsch <kupsch@xxxxxxxxxxx>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M symlite/src/SymLite-elf.C

  Log Message:
  -----------
  SymElf:  fix memory leak of cached demangled names

* the existing cache in SymElf did not free the char* string in each
  cache entry


Compare: https://github.com/dyninst/dyninst/compare/260318c2eb22...14de918f2fdc
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] 41ef64: make symbol name demangling consistent (#872, #717), kupsch <=