LLDB  mainline
Enumerations | Functions
Mangled.cpp File Reference
#include "lldb/Core/Mangled.h"
#include "lldb/Core/DataFileCache.h"
#include "lldb/Core/RichManglingContext.h"
#include "lldb/Target/Language.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/DataEncoder.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/Stream.h"
#include "lldb/lldb-enumerations.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/Support/Compiler.h"
#include <mutex>
#include <string>
#include <utility>
#include <cstdlib>
#include <cstring>
Include dependency graph for Mangled.cpp:

Go to the source code of this file.

Enumerations

enum  MangledEncoding { Empty = 0u, DemangledOnly = 1u, MangledOnly = 2u, MangledAndDemangled = 3u }
 

Functions

static bool cstring_is_mangled (llvm::StringRef s)
 
static char * GetMSVCDemangledStr (const char *M)
 
static char * GetItaniumDemangledStr (const char *M)
 
static char * GetRustV0DemangledStr (const char *M)
 
static char * GetDLangDemangledStr (const char *M)
 
Streamoperator<< (Stream &s, const Mangled &obj)
 

Enumeration Type Documentation

◆ MangledEncoding

Enumerator
Empty 

If the Mangled object has neither a mangled name or demangled name we can encode the object with one zero byte using the Empty enumeration.

DemangledOnly 

If the Mangled object has only a demangled name and no mangled named, we can encode only the demangled name.

MangledOnly 

If the mangle name can calculate the demangled name (it is the mangled/demangled counterpart), then we only need to encode the mangled name as the demangled name can be recomputed.

MangledAndDemangled 

If we have a Mangled object with two different names that are not related then we need to save both strings.

This can happen if we have a name that isn't a true mangled name, but we want to be able to lookup a symbol by name and type in the symbol table. We do this for Objective C symbols like "OBJC_CLASS_$_NSValue" where the mangled named will be set to "OBJC_CLASS_$_NSValue" and the demangled name will be manually set to "NSValue". If we tried to demangled the name "OBJC_CLASS_$_NSValue" it would fail, but in these cases we want these unrelated names to be preserved.

Definition at line 401 of file Mangled.cpp.

Function Documentation

◆ cstring_is_mangled()

static bool cstring_is_mangled ( llvm::StringRef  s)
inlinestatic

Definition at line 34 of file Mangled.cpp.

◆ GetDLangDemangledStr()

static char* GetDLangDemangledStr ( const char *  M)
static

Definition at line 183 of file Mangled.cpp.

References lldb_private::GetLog(), and LLDB_LOG.

◆ GetItaniumDemangledStr()

static char* GetItaniumDemangledStr ( const char *  M)
static

Definition at line 143 of file Mangled.cpp.

References lldb_private::GetLog(), and LLDB_LOGF.

◆ GetMSVCDemangledStr()

static char* GetMSVCDemangledStr ( const char *  M)
static

Definition at line 126 of file Mangled.cpp.

References lldb_private::GetLog(), and LLDB_LOGF.

◆ GetRustV0DemangledStr()

static char* GetRustV0DemangledStr ( const char *  M)
static

Definition at line 170 of file Mangled.cpp.

References lldb_private::GetLog(), and LLDB_LOG.

◆ operator<<()

Stream& operator<< ( Stream s,
const Mangled &  obj 
)

Definition at line 386 of file Mangled.cpp.