LLDB
mainline
|
#include <DWARFExpression.h>
Classes | |
struct | LoclistAddresses |
Public Member Functions | |
DWARFExpression () | |
DWARFExpression (lldb::ModuleSP module, const DataExtractor &data, const DWARFUnit *dwarf_cu) | |
Constructor. More... | |
virtual | ~DWARFExpression () |
Destructor. More... | |
void | GetDescription (Stream *s, lldb::DescriptionLevel level, ABI *abi) const |
Print the description of the expression to a stream. More... | |
bool | IsValid () const |
Return true if the location expression contains data. More... | |
bool | IsLocationList () const |
Return true if a location list was provided. More... | |
bool | LocationListContainsAddress (lldb::addr_t func_load_addr, lldb::addr_t addr) const |
Search for a load address in the location list. More... | |
lldb::addr_t | GetLocation_DW_OP_addr (uint32_t op_addr_idx, bool &error) const |
If a location is not a location list, return true if the location contains a DW_OP_addr () opcode in the stream that matches file_addr. More... | |
bool | Update_DW_OP_addr (lldb::addr_t file_addr) |
void | UpdateValue (uint64_t const_value, lldb::offset_t const_value_byte_size, uint8_t addr_byte_size) |
void | SetModule (const lldb::ModuleSP &module) |
bool | ContainsThreadLocalStorage () const |
bool | LinkThreadLocalStorage (lldb::ModuleSP new_module_sp, std::function< lldb::addr_t(lldb::addr_t file_addr)> const &link_address_callback) |
void | SetLocationListAddresses (lldb::addr_t cu_file_addr, lldb::addr_t func_file_addr) |
Tells the expression that it refers to a location list. More... | |
int | GetRegisterKind () |
Return the call-frame-info style register kind. More... | |
void | SetRegisterKind (lldb::RegisterKind reg_kind) |
Set the call-frame-info style register kind. More... | |
bool | Evaluate (ExecutionContextScope *exe_scope, lldb::addr_t func_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr) const |
Wrapper for the static evaluate function that accepts an ExecutionContextScope instead of an ExecutionContext and uses member variables to populate many operands. More... | |
bool | Evaluate (ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t loclist_base_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr) const |
Wrapper for the static evaluate function that uses member variables to populate many operands. More... | |
bool | GetExpressionData (DataExtractor &data) const |
bool | DumpLocationForAddress (Stream *s, lldb::DescriptionLevel level, lldb::addr_t func_load_addr, lldb::addr_t address, ABI *abi) |
bool | DumpLocations (Stream *s, lldb::DescriptionLevel level, lldb::addr_t func_load_addr, lldb::addr_t addr, ABI *abi) |
bool | GetLocationExpressions (lldb::addr_t load_function_start, llvm::function_ref< bool(llvm::DWARFLocationExpression)> callback) const |
bool | MatchesOperand (StackFrame &frame, const Instruction::Operand &op) |
llvm::Optional< DataExtractor > | GetLocationExpression (lldb::addr_t load_function_start, lldb::addr_t addr) const |
Static Public Member Functions | |
static bool | Evaluate (ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes, const DWARFUnit *dwarf_cu, const lldb::RegisterKind reg_set, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr) |
Evaluate a DWARF location expression in a particular context. More... | |
Private Member Functions | |
void | DumpLocation (Stream *s, const DataExtractor &data, lldb::DescriptionLevel level, ABI *abi) const |
Pretty-prints the location expression to a stream. More... | |
Private Attributes | |
lldb::ModuleWP | m_module_wp |
Module which defined this expression. More... | |
DataExtractor | m_data |
A data extractor capable of reading opcode bytes. More... | |
const DWARFUnit * | m_dwarf_cu = nullptr |
The DWARF compile unit this expression belongs to. More... | |
lldb::RegisterKind | m_reg_kind = lldb::eRegisterKindDWARF |
One of the defines that starts with LLDB_REGKIND_. More... | |
llvm::Optional< LoclistAddresses > | m_loclist_addresses |
"lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location expression and interprets it.
DWARF location expressions are used in two ways by LLDB. The first use is to find entities specified in the debug information, since their locations are specified in precisely this language. The second is to interpret expressions without having to run the target in cases where the overhead from copying JIT-compiled code into the target is too high or where the target cannot be run. This class encapsulates a single DWARF location expression or a location list and interprets it.
Definition at line 36 of file DWARFExpression.h.
DWARFExpression::DWARFExpression | ( | ) |
Definition at line 62 of file DWARFExpression.cpp.
DWARFExpression::DWARFExpression | ( | lldb::ModuleSP | module, |
const DataExtractor & | data, | ||
const DWARFUnit * | dwarf_cu | ||
) |
Constructor.
[in] | data | A data extractor configured to read the DWARF location expression's bytecode. |
Definition at line 64 of file DWARFExpression.cpp.
References m_module_wp.
|
virtualdefault |
Destructor.
bool DWARFExpression::ContainsThreadLocalStorage | ( | ) | const |
Definition at line 489 of file DWARFExpression.cpp.
References GetOpcodeDataSize(), lldb_private::DataExtractor::GetU8(), IsLocationList(), LLDB_INVALID_OFFSET, m_data, and lldb_private::DataExtractor::ValidOffset().
Referenced by SymbolFileDWARF::ParseVariableDIE().
|
private |
Pretty-prints the location expression to a stream.
[in] | s | The stream to use for pretty-printing. |
[in] | data | The data extractor. |
[in] | level | The level of detail to use in pretty-printing. |
[in] | abi | An optional ABI plug-in that can be used to resolve register names. |
Definition at line 89 of file DWARFExpression.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DataExtractor::GetAsLLVM(), and lldb_private::ABI::GetMCRegisterInfo().
Referenced by DumpLocationForAddress(), DumpLocations(), and GetDescription().
bool DWARFExpression::DumpLocationForAddress | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
lldb::addr_t | func_load_addr, | ||
lldb::addr_t | address, | ||
ABI * | abi | ||
) |
Definition at line 616 of file DWARFExpression.cpp.
References DumpLocation(), GetLocationExpression(), IsLocationList(), and m_data.
Referenced by SymbolFileDWARF::ParseVariableDIE().
bool DWARFExpression::DumpLocations | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
lldb::addr_t | func_load_addr, | ||
lldb::addr_t | addr, | ||
ABI * | abi | ||
) |
Definition at line 2753 of file DWARFExpression.cpp.
References lldb_private::Stream::AsRawOstream(), DumpLocation(), lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DataExtractor::GetByteOrder(), GetLocationExpressions(), IsLocationList(), LLDB_INVALID_ADDRESS, m_data, lldb_private::Stream::PutCString(), and ToDataExtractor().
Referenced by lldb_private::Variable::DumpLocations().
bool DWARFExpression::Evaluate | ( | ExecutionContext * | exe_ctx, |
RegisterContext * | reg_ctx, | ||
lldb::addr_t | loclist_base_load_addr, | ||
const Value * | initial_value_ptr, | ||
const Value * | object_address_ptr, | ||
Value & | result, | ||
Status * | error_ptr | ||
) | const |
Wrapper for the static evaluate function that uses member variables to populate many operands.
Definition at line 852 of file DWARFExpression.cpp.
References Evaluate(), lldb_private::ExecutionContext::GetFramePtr(), GetLocationExpression(), lldb_private::RegisterContext::GetPCForSymbolication(), lldb_private::StackFrame::GetRegisterContext(), lldb_private::ExecutionContext::GetTargetPtr(), IsLocationList(), LLDB_INVALID_ADDRESS, m_data, m_dwarf_cu, m_module_wp, m_reg_kind, pc, and lldb_private::Status::SetErrorString().
|
static |
Evaluate a DWARF location expression in a particular context.
[in] | exe_ctx | The execution context in which to evaluate the location expression. The location expression may access the target's memory, especially if it comes from the expression parser. |
[in] | opcode_ctx | The module which defined the expression. |
[in] | opcodes | This is a static method so the opcodes need to be provided explicitly. |
[in] | reg_ctx | An optional parameter which provides a RegisterContext for use when evaluating the expression (i.e. for fetching register values). Normally this will come from the ExecutionContext's StackFrame but in the case where an expression needs to be evaluated while building the stack frame list, this short-cut is available. |
[in] | reg_set | The call-frame-info style register kind. |
[in] | initial_value_ptr | A value to put on top of the interpreter stack before evaluating the expression, if the expression is parametrized. Can be NULL. |
[in] | result | A value into which the result of evaluating the expression is to be placed. |
[in] | error_ptr | If non-NULL, used to report errors in expression evaluation. |
Insertion point for evaluating multi-piece expression.
Definition at line 1011 of file DWARFExpression.cpp.
References lldb_private::Value::AppendDataToHostBuffer(), lldb_private::StackFrame::CalculateTarget(), lldb_private::Value::ClearContext(), DerefSizeExtractDataHelper(), lldb_private::DW_OP_value_to_name(), Empty, error(), Evaluate_DW_OP_entry_value(), lldb_private::Expressions, lldb_private::Scalar::ExtractBitfield(), lldb_private::Value::FileAddress, lldb_private::Process::GetABI(), lldb_private::DataExtractor::GetAddress(), lldb_private::DataExtractor::GetAddressByteSize(), DWARFBaseDIE::GetAttributeValueAsUnsigned(), lldb_private::Value::GetBuffer(), lldb_private::ObjectFile::GetByteOrder(), lldb_private::Process::GetByteOrder(), lldb_private::DataBufferHeap::GetByteSize(), lldb_private::Scalar::GetByteSize(), lldb_private::DataExtractor::GetByteSize(), lldb_private::StackID::GetCallFrameAddress(), lldb_private::StreamString::GetData(), lldb_private::DataExtractor::GetData(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::ExecutionContext::GetFramePtr(), lldb_private::GetLog(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::StackFrame::GetRegisterContext(), lldb_private::Value::GetScalar(), lldb_private::DataExtractor::GetSLEB128(), lldb_private::StackFrame::GetStackID(), lldb_private::ExecutionContext::GetTargetRef(), lldb_private::Thread::GetThreadLocalData(), lldb_private::ExecutionContext::GetThreadPtr(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), lldb_private::Value::GetValueType(), lldb_private::Log::GetVerbose(), lldb_private::Value::HostAddress, lldb_private::Value::Invalid, lldb_private::Address::IsSectionOffset(), lldb_private::Scalar::IsZero(), LLDB_ERRORF, LLDB_INVALID_ADDRESS, LLDB_LOG, LLDB_LOGF, lldb_private::Value::LoadAddress, lldb_private::Stream::Printf(), ReadAddressFromDebugAddrSection(), lldb_private::Target::ReadMemory(), lldb_private::Process::ReadMemory(), lldb_private::Process::ReadPointerFromMemory(), ReadRegisterValueAsScalar(), lldb_private::Value::ResizeData(), ResolveLoadAddress(), lldb_private::Value::ResolveValue(), lldb_private::Value::Scalar, lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), lldb_private::Status::SetErrorStringWithFormatv(), lldb_private::Scalar::TruncOrExtendTo(), lldb_private::Scalar::UInt128(), lldb_private::Scalar::ULongLong(), and lldb_private::DataExtractor::ValidOffset().
bool DWARFExpression::Evaluate | ( | ExecutionContextScope * | exe_scope, |
lldb::addr_t | func_load_addr, | ||
const Value * | initial_value_ptr, | ||
const Value * | object_address_ptr, | ||
Value & | result, | ||
Status * | error_ptr | ||
) | const |
Wrapper for the static evaluate function that accepts an ExecutionContextScope instead of an ExecutionContext and uses member variables to populate many operands.
Definition at line 842 of file DWARFExpression.cpp.
Referenced by Evaluate(), Evaluate_DW_OP_entry_value(), lldb_private::IndirectCallEdge::GetCallee(), lldb_private::StackFrame::GetFrameBaseValue(), SymbolFileDWARF::GetGlobalAranges(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), lldb_private::RegisterContextUnwind::SavedLocationForRegister(), and lldb_private::ValueObjectVariable::UpdateValue().
void DWARFExpression::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
ABI * | abi | ||
) | const |
Print the description of the expression to a stream.
[in] | s | The stream to print to. |
[in] | level | The level of verbosity to use. |
[in] | abi | An optional ABI plug-in that can be used to resolve register names. |
Definition at line 131 of file DWARFExpression.cpp.
References lldb_private::Stream::AsRawOstream(), DumpLocation(), lldb::eByteOrderLittle, lldb_private::DataExtractor::GetByteOrder(), lldb_private::Stream::GetIndentLevel(), DWARFUnit::GetLocationTable(), lldb_private::ABI::GetMCRegisterInfo(), IsLocationList(), m_data, m_dwarf_cu, and lldb_private::toString().
Referenced by lldb_private::Variable::Dump().
|
inline |
Definition at line 204 of file DWARFExpression.h.
References lldb_private::DataExtractor::GetByteSize(), and m_data.
Referenced by lldb_private::ClangExpressionDeclMap::GetVariableValue(), and lldb_private::ValueObjectVariable::UpdateValue().
lldb::addr_t DWARFExpression::GetLocation_DW_OP_addr | ( | uint32_t | op_addr_idx, |
bool & | error | ||
) | const |
If a location is not a location list, return true if the location contains a DW_OP_addr () opcode in the stream that matches file_addr.
If file_addr is LLDB_INVALID_ADDRESS, the this function will return true if the variable there is any DW_OP_addr in a location that (yet still is NOT a location list). This helps us detect if a variable is a global or static variable since there is no other indication from DWARF debug info.
[in] | op_addr_idx | The DW_OP_addr index to retrieve in case there is more than one DW_OP_addr opcode in the location byte stream. |
[out] | error | If the location stream contains unknown DW_OP opcodes or the data is missing, error will be set to true. |
Definition at line 412 of file DWARFExpression.cpp.
References error(), lldb_private::DataExtractor::GetAddress(), GetOpcodeDataSize(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), IsLocationList(), LLDB_INVALID_ADDRESS, LLDB_INVALID_OFFSET, m_data, m_dwarf_cu, ReadAddressFromDebugAddrSection(), and lldb_private::DataExtractor::ValidOffset().
Referenced by SymbolFileDWARF::ParseVariableDIE().
llvm::Optional< DataExtractor > DWARFExpression::GetLocationExpression | ( | lldb::addr_t | load_function_start, |
lldb::addr_t | addr | ||
) | const |
Definition at line 2830 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DataExtractor::GetByteOrder(), GetLocationExpressions(), m_data, and ToDataExtractor().
Referenced by DumpLocationForAddress(), Evaluate(), LocationListContainsAddress(), and MatchesOperand().
bool DWARFExpression::GetLocationExpressions | ( | lldb::addr_t | load_function_start, |
llvm::function_ref< bool(llvm::DWARFLocationExpression)> | callback | ||
) | const |
Definition at line 2786 of file DWARFExpression.cpp.
References error(), lldb_private::Expressions, DWARFUnit::GetLocationTable(), lldb_private::GetLog(), LLDB_INVALID_ADDRESS, LLDB_LOG_ERROR, m_data, m_dwarf_cu, m_loclist_addresses, and ReadAddressFromDebugAddrSection().
Referenced by DumpLocations(), and GetLocationExpression().
int DWARFExpression::GetRegisterKind | ( | ) |
Return the call-frame-info style register kind.
Definition at line 102 of file DWARFExpression.cpp.
References m_reg_kind.
bool DWARFExpression::IsLocationList | ( | ) | const |
Return true if a location list was provided.
Definition at line 108 of file DWARFExpression.cpp.
References m_loclist_addresses.
Referenced by ContainsThreadLocalStorage(), DumpLocationForAddress(), DumpLocations(), Evaluate(), GetDescription(), lldb_private::StackFrame::GetFrameBaseValue(), GetLocation_DW_OP_addr(), LinkThreadLocalStorage(), lldb_private::Variable::LocationIsValidForAddress(), lldb_private::Variable::LocationIsValidForFrame(), LocationListContainsAddress(), MatchesOperand(), Update_DW_OP_addr(), and lldb_private::ValueObjectVariable::UpdateValue().
bool DWARFExpression::IsValid | ( | ) | const |
Return true if the location expression contains data.
Definition at line 75 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetByteSize(), and m_data.
Referenced by lldb_private::Variable::Dump(), DWARFASTParserClang::ParseFunctionFromDWARF(), and SymbolFileDWARF::ParseVariableDIE().
bool DWARFExpression::LinkThreadLocalStorage | ( | lldb::ModuleSP | new_module_sp, |
std::function< lldb::addr_t(lldb::addr_t file_addr)> const & | link_address_callback | ||
) |
Definition at line 509 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::DataExtractor::GetByteSize(), lldb_private::DataExtractor::GetDataStart(), GetOpcodeDataSize(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), IsLocationList(), LLDB_INVALID_ADDRESS, LLDB_INVALID_OFFSET, m_data, m_module_wp, lldb_private::DataExtractor::SetData(), UINT32_MAX, and lldb_private::DataExtractor::ValidOffset().
Referenced by SymbolFileDWARF::ParseVariableDIE().
bool DWARFExpression::LocationListContainsAddress | ( | lldb::addr_t | func_load_addr, |
lldb::addr_t | addr | ||
) | const |
Search for a load address in the location list.
[in] | func_load_addr | The actual address of the function containing this location list. |
[in] | addr | The address to resolve |
Definition at line 605 of file DWARFExpression.cpp.
References GetLocationExpression(), IsLocationList(), and LLDB_INVALID_ADDRESS.
Referenced by lldb_private::Variable::LocationIsValidForAddress(), and lldb_private::Variable::LocationIsValidForFrame().
bool DWARFExpression::MatchesOperand | ( | StackFrame & | frame, |
const Instruction::Operand & | op | ||
) |
Definition at line 2844 of file DWARFExpression.cpp.
References lldb_private::StackFrame::CalculateTarget(), lldb_private::Instruction::Operand::Dereference, lldb_private::SymbolContext::function, lldb_private::Function::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::GetFileAddress(), lldb_private::StackFrame::GetFrameBaseExpression(), lldb_private::StackFrame::GetFrameCodeAddressForSymbolication(), lldb_private::Address::GetLoadAddress(), GetLocationExpression(), lldb_private::StackFrame::GetRegisterContext(), lldb_private::DataExtractor::GetSLEB128(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), IsLocationList(), LLDB_INVALID_ADDRESS, m_data, m_reg_kind, lldb_private::OperandMatchers::MatchBinaryOp, MatchesOperand(), lldb_private::OperandMatchers::MatchImmOp, lldb_private::OperandMatchers::MatchOpType, lldb_private::OperandMatchers::MatchRegOp, lldb_private::OperandMatchers::MatchUnaryOp, pc, and lldb_private::Instruction::Operand::Sum.
Referenced by MatchesOperand().
void DWARFExpression::SetLocationListAddresses | ( | lldb::addr_t | cu_file_addr, |
lldb::addr_t | func_file_addr | ||
) |
Tells the expression that it refers to a location list.
[in] | cu_file_addr | The base address to use for interpreting relative location list entries. |
[in] | func_file_addr | The file address of the function containing this location list. This address will be used to relocate the location list on the fly (in conjuction with the func_load_addr arguments). |
Definition at line 97 of file DWARFExpression.cpp.
References m_loclist_addresses.
Referenced by DWARFDebugInfoEntry::GetDIENamesAndRanges(), and SymbolFileDWARF::ParseVariableDIE().
|
inline |
Definition at line 114 of file DWARFExpression.h.
References m_module_wp.
Referenced by SymbolFileDWARF::ParseVariableDIE().
void DWARFExpression::SetRegisterKind | ( | lldb::RegisterKind | reg_kind | ) |
Set the call-frame-info style register kind.
[in] | reg_kind | The register kind. |
Definition at line 104 of file DWARFExpression.cpp.
References m_reg_kind.
Referenced by ConvertPDBLocationToDWARFExpression(), MakeLocationExpressionInternal(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), and lldb_private::RegisterContextUnwind::SavedLocationForRegister().
bool DWARFExpression::Update_DW_OP_addr | ( | lldb::addr_t | file_addr | ) |
Definition at line 451 of file DWARFExpression.cpp.
References lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::DataExtractor::GetByteSize(), lldb_private::DataExtractor::GetDataStart(), GetOpcodeDataSize(), lldb_private::DataExtractor::GetU8(), IsLocationList(), LLDB_INVALID_OFFSET, m_data, lldb_private::DataExtractor::SetData(), UINT32_MAX, and lldb_private::DataExtractor::ValidOffset().
Referenced by SymbolFileDWARF::ParseVariableDIE().
void DWARFExpression::UpdateValue | ( | uint64_t | const_value, |
lldb::offset_t | const_value_byte_size, | ||
uint8_t | addr_byte_size | ||
) |
Definition at line 77 of file DWARFExpression.cpp.
References lldb_private::endian::InlHostByteOrder(), m_data, lldb_private::DataExtractor::SetAddressByteSize(), lldb_private::DataExtractor::SetByteOrder(), and lldb_private::DataExtractor::SetData().
Referenced by SymbolFileDWARF::ParseVariableDIE().
|
private |
A data extractor capable of reading opcode bytes.
Definition at line 248 of file DWARFExpression.h.
Referenced by ContainsThreadLocalStorage(), DumpLocationForAddress(), DumpLocations(), Evaluate(), GetDescription(), GetExpressionData(), GetLocation_DW_OP_addr(), GetLocationExpression(), GetLocationExpressions(), IsValid(), LinkThreadLocalStorage(), MatchesOperand(), Update_DW_OP_addr(), and UpdateValue().
|
private |
The DWARF compile unit this expression belongs to.
It is used to evaluate values indexing into the .debug_addr section (e.g. DW_OP_GNU_addr_index, DW_OP_GNU_const_index)
Definition at line 253 of file DWARFExpression.h.
Referenced by Evaluate(), GetDescription(), GetLocation_DW_OP_addr(), and GetLocationExpressions().
|
private |
Definition at line 262 of file DWARFExpression.h.
Referenced by GetLocationExpressions(), IsLocationList(), and SetLocationListAddresses().
|
private |
Module which defined this expression.
Definition at line 245 of file DWARFExpression.h.
Referenced by DWARFExpression(), Evaluate(), LinkThreadLocalStorage(), and SetModule().
|
private |
One of the defines that starts with LLDB_REGKIND_.
Definition at line 256 of file DWARFExpression.h.
Referenced by Evaluate(), GetRegisterKind(), MatchesOperand(), and SetRegisterKind().