LLDB mainline
lldb_private::FunctionCallLabel Struct Reference

Holds parsed information about a function call label that LLDB attaches as an AsmLabel to function AST nodes it parses from debug-info. More...

#include <Expression.h>

Public Member Functions

std::string toString () const
 Encode this FunctionCallLabel into its string representation.

Static Public Member Functions

static llvm::Expected< FunctionCallLabelfromString (llvm::StringRef label)
 Decodes the specified function label into a FunctionCallLabel.

Public Attributes

llvm::StringRef discriminator
 Arbitrary string which language plugins can interpret for their own needs.
lldb::user_id_t module_id
 Unique identifier of the lldb_private::Module which contains the symbol identified by symbol_id.
lldb::user_id_t symbol_id
 Unique identifier of the function symbol on which to perform the function call.
llvm::StringRef lookup_name
 Name to use when searching for the function symbol in module_id.

Detailed Description

Holds parsed information about a function call label that LLDB attaches as an AsmLabel to function AST nodes it parses from debug-info.

The format being:

<prefix>:<discriminator>:<module uid>:<symbol uid>:<name>

The label string needs to stay valid for the entire lifetime of this object.

Definition at line 110 of file Expression.h.

Member Function Documentation

◆ fromString()

llvm::Expected< FunctionCallLabel > lldb_private::FunctionCallLabel::fromString ( llvm::StringRef label)
static

◆ toString()

std::string lldb_private::FunctionCallLabel::toString ( ) const

Encode this FunctionCallLabel into its string representation.

The representation roundtrips through fromString:

llvm::StringRef encoded = "$__lldb_func:blah:0x0:0x0:_Z3foov";
FunctionCallLabel label = *fromString(label);
assert (label.toString() == encoded);
assert (*fromString(label.toString()) == label);
Holds parsed information about a function call label that LLDB attaches as an AsmLabel to function AS...
Definition Expression.h:110
std::string toString() const
Encode this FunctionCallLabel into its string representation.
static llvm::Expected< FunctionCallLabel > fromString(llvm::StringRef label)
Decodes the specified function label into a FunctionCallLabel.

Definition at line 69 of file Expression.cpp.

References discriminator, lldb_private::FunctionCallLabelPrefix, lookup_name, module_id, and symbol_id.

Referenced by MakeLLDBFuncAsmLabel().

Member Data Documentation

◆ discriminator

llvm::StringRef lldb_private::FunctionCallLabel::discriminator

Arbitrary string which language plugins can interpret for their own needs.

Definition at line 113 of file Expression.h.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::FindFunctionDefinition(), fromString(), lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunctionCallLabel(), and toString().

◆ lookup_name

llvm::StringRef lldb_private::FunctionCallLabel::lookup_name

Name to use when searching for the function symbol in module_id.

For most function calls this will be a mangled name. In cases where a mangled name can't be used, this will be the function name.

NOTE: kept as last element so we don't have to worry about ':' in the mangled name when parsing the label.

Definition at line 131 of file Expression.h.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::FindFunctionDefinition(), fromString(), lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunctionCallLabel(), and toString().

◆ module_id

lldb::user_id_t lldb_private::FunctionCallLabel::module_id

Unique identifier of the lldb_private::Module which contains the symbol identified by symbol_id.

Definition at line 117 of file Expression.h.

Referenced by fromString(), ResolveFunctionCallLabel(), and toString().

◆ symbol_id

lldb::user_id_t lldb_private::FunctionCallLabel::symbol_id

Unique identifier of the function symbol on which to perform the function call.

For example, for DWARF this would be the DIE UID.

Definition at line 122 of file Expression.h.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunctionCallLabel(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ResolveFunctionCallLabel(), and toString().


The documentation for this struct was generated from the following files: