ROSE 0.11.145.189
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::Demangler Class Reference

Description

Demangle mangled names.

Definition at line 15 of file Demangler.h.

#include <Rose/BinaryAnalysis/Demangler.h>

Public Types

typedef Sawyer::Container::Map< std::string, std::string > NameMap
 

Public Member Functions

void fillCache (const std::vector< std::string > &mangledNames)
 Demangle lots of names.
 
std::string demangle (const std::string &mangledName)
 Demangle one name.
 
void clear ()
 Clear the cache.
 
size_t size () const
 Number of items in the cache.
 
const NameMapallNames () const
 Map of all cached names.
 
void insert (const std::string &mangledName, const std::string &demangledName)
 Insert a mangled/demangled pair.
 
const boost::filesystem::path & cxxFiltExe () const
 Property: Name of c++filt program.
 
void cxxFiltExe (const boost::filesystem::path &p)
 Property: Name of c++filt program.
 
const std::string & compiler () const
 Property: Format of mangled names.
 
void compiler (const std::string &s)
 Property: Format of mangled names.
 

Member Typedef Documentation

◆ NameMap

Definition at line 17 of file Demangler.h.

Member Function Documentation

◆ cxxFiltExe() [1/2]

const boost::filesystem::path & Rose::BinaryAnalysis::Demangler::cxxFiltExe ( ) const
inline

Property: Name of c++filt program.

This is the name of the c++filt command that gets run to convert mangled names to demangled names. If it's not an absolute name then the normal executable search is performed (i.e., $PATH variable).

Definition at line 31 of file Demangler.h.

◆ cxxFiltExe() [2/2]

void Rose::BinaryAnalysis::Demangler::cxxFiltExe ( const boost::filesystem::path &  p)
inline

Property: Name of c++filt program.

This is the name of the c++filt command that gets run to convert mangled names to demangled names. If it's not an absolute name then the normal executable search is performed (i.e., $PATH variable).

Definition at line 32 of file Demangler.h.

◆ compiler() [1/2]

const std::string & Rose::BinaryAnalysis::Demangler::compiler ( ) const
inline

Property: Format of mangled names.

Each compiler has slightly different rules for how names are mangled. This property controls the format and should be one of the following strings:

  • "auto" (or empty string): automatic selection based on c++filt executable (this is the default).
  • "gnu": format used by GNU C++ compiler (g++).
  • "lucid": format used by the Lucid compiler (lcc).
  • "arm": format used by the C++ Annotated Reference Manual.
  • "hp": format used by the HP compiler (aCC).
  • "edg": format used by EDG-based compilers.
  • "gnu-v3": format used by the GNU C++ compiler (g++) with the V3 ABI.
  • "java": format used by the GNU Java compiler (gcj).
  • "gnat": format used by the GNU Ada compiler (GNAT).

ROSE itself does not check these strings, so if your c++filt supports other values for its "-s" switch they will work.

Definition at line 53 of file Demangler.h.

◆ compiler() [2/2]

void Rose::BinaryAnalysis::Demangler::compiler ( const std::string &  s)
inline

Property: Format of mangled names.

Each compiler has slightly different rules for how names are mangled. This property controls the format and should be one of the following strings:

  • "auto" (or empty string): automatic selection based on c++filt executable (this is the default).
  • "gnu": format used by GNU C++ compiler (g++).
  • "lucid": format used by the Lucid compiler (lcc).
  • "arm": format used by the C++ Annotated Reference Manual.
  • "hp": format used by the HP compiler (aCC).
  • "edg": format used by EDG-based compilers.
  • "gnu-v3": format used by the GNU C++ compiler (g++) with the V3 ABI.
  • "java": format used by the GNU Java compiler (gcj).
  • "gnat": format used by the GNU Ada compiler (GNAT).

ROSE itself does not check these strings, so if your c++filt supports other values for its "-s" switch they will work.

Definition at line 54 of file Demangler.h.

◆ fillCache()

void Rose::BinaryAnalysis::Demangler::fillCache ( const std::vector< std::string > &  mangledNames)

Demangle lots of names.

The most efficient way to invoke this analyzer is to provide it with as many names as possible. It will send them all to the c++filt program (cxxFiltExe property) all at once and cache the results to query later.

◆ demangle()

std::string Rose::BinaryAnalysis::Demangler::demangle ( const std::string &  mangledName)

Demangle one name.

If the name is already cached, then return the cached value. Otherwise invoke c++filt to demangle this one name and cache the result. A name that cannot be demangled is returned in its original form.

It is not efficient to fill the cache one name at a time; use fillCache first if possible, and then call this function to retrieve the results.

◆ clear()

void Rose::BinaryAnalysis::Demangler::clear ( )
inline

Clear the cache.

Definition at line 73 of file Demangler.h.

References Sawyer::Container::Map< K, T, Cmp, Alloc >::clear().

◆ size()

size_t Rose::BinaryAnalysis::Demangler::size ( ) const
inline

Number of items in the cache.

Definition at line 76 of file Demangler.h.

References Sawyer::Container::Map< K, T, Cmp, Alloc >::size().

◆ allNames()

const NameMap & Rose::BinaryAnalysis::Demangler::allNames ( ) const
inline

Map of all cached names.

Definition at line 79 of file Demangler.h.

◆ insert()

void Rose::BinaryAnalysis::Demangler::insert ( const std::string &  mangledName,
const std::string &  demangledName 
)

Insert a mangled/demangled pair.

Adds (or modifies) the mangled/demangled pair to the cache.


The documentation for this class was generated from the following file: