mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-13 13:45:16 +00:00
Change ValueObject creation functions to take StringRefs.
llvm-svn: 286744
This commit is contained in:
parent
7a120c8b3d
commit
aa5611f56d
@ -650,21 +650,23 @@ public:
|
|||||||
void Dump(Stream &s, const DumpValueObjectOptions &options);
|
void Dump(Stream &s, const DumpValueObjectOptions &options);
|
||||||
|
|
||||||
static lldb::ValueObjectSP
|
static lldb::ValueObjectSP
|
||||||
CreateValueObjectFromExpression(const char *name, const char *expression,
|
CreateValueObjectFromExpression(llvm::StringRef name,
|
||||||
|
llvm::StringRef expression,
|
||||||
const ExecutionContext &exe_ctx);
|
const ExecutionContext &exe_ctx);
|
||||||
|
|
||||||
static lldb::ValueObjectSP
|
static lldb::ValueObjectSP
|
||||||
CreateValueObjectFromExpression(const char *name, const char *expression,
|
CreateValueObjectFromExpression(llvm::StringRef name,
|
||||||
|
llvm::StringRef expression,
|
||||||
const ExecutionContext &exe_ctx,
|
const ExecutionContext &exe_ctx,
|
||||||
const EvaluateExpressionOptions &options);
|
const EvaluateExpressionOptions &options);
|
||||||
|
|
||||||
static lldb::ValueObjectSP
|
static lldb::ValueObjectSP
|
||||||
CreateValueObjectFromAddress(const char *name, uint64_t address,
|
CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address,
|
||||||
const ExecutionContext &exe_ctx,
|
const ExecutionContext &exe_ctx,
|
||||||
CompilerType type);
|
CompilerType type);
|
||||||
|
|
||||||
static lldb::ValueObjectSP
|
static lldb::ValueObjectSP
|
||||||
CreateValueObjectFromData(const char *name, const DataExtractor &data,
|
CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data,
|
||||||
const ExecutionContext &exe_ctx, CompilerType type);
|
const ExecutionContext &exe_ctx, CompilerType type);
|
||||||
|
|
||||||
void LogValueObject(Log *log);
|
void LogValueObject(Log *log);
|
||||||
|
@ -90,15 +90,16 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
lldb::ValueObjectSP
|
lldb::ValueObjectSP
|
||||||
CreateValueObjectFromExpression(const char *name, const char *expression,
|
CreateValueObjectFromExpression(llvm::StringRef name,
|
||||||
|
llvm::StringRef expression,
|
||||||
const ExecutionContext &exe_ctx);
|
const ExecutionContext &exe_ctx);
|
||||||
|
|
||||||
lldb::ValueObjectSP
|
lldb::ValueObjectSP
|
||||||
CreateValueObjectFromAddress(const char *name, uint64_t address,
|
CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address,
|
||||||
const ExecutionContext &exe_ctx,
|
const ExecutionContext &exe_ctx,
|
||||||
CompilerType type);
|
CompilerType type);
|
||||||
|
|
||||||
lldb::ValueObjectSP CreateValueObjectFromData(const char *name,
|
lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name,
|
||||||
const DataExtractor &data,
|
const DataExtractor &data,
|
||||||
const ExecutionContext &exe_ctx,
|
const ExecutionContext &exe_ctx,
|
||||||
CompilerType type);
|
CompilerType type);
|
||||||
|
@ -3605,32 +3605,33 @@ SymbolContextScope *ValueObject::GetSymbolContextScope() {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::ValueObjectSP ValueObject::CreateValueObjectFromExpression(
|
lldb::ValueObjectSP
|
||||||
const char *name, const char *expression, const ExecutionContext &exe_ctx) {
|
ValueObject::CreateValueObjectFromExpression(llvm::StringRef name,
|
||||||
|
llvm::StringRef expression,
|
||||||
|
const ExecutionContext &exe_ctx) {
|
||||||
return CreateValueObjectFromExpression(name, expression, exe_ctx,
|
return CreateValueObjectFromExpression(name, expression, exe_ctx,
|
||||||
EvaluateExpressionOptions());
|
EvaluateExpressionOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::ValueObjectSP ValueObject::CreateValueObjectFromExpression(
|
lldb::ValueObjectSP ValueObject::CreateValueObjectFromExpression(
|
||||||
const char *name, const char *expression, const ExecutionContext &exe_ctx,
|
llvm::StringRef name, llvm::StringRef expression,
|
||||||
const EvaluateExpressionOptions &options) {
|
const ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options) {
|
||||||
lldb::ValueObjectSP retval_sp;
|
lldb::ValueObjectSP retval_sp;
|
||||||
lldb::TargetSP target_sp(exe_ctx.GetTargetSP());
|
lldb::TargetSP target_sp(exe_ctx.GetTargetSP());
|
||||||
if (!target_sp)
|
if (!target_sp)
|
||||||
return retval_sp;
|
return retval_sp;
|
||||||
if (!expression || !*expression)
|
if (expression.empty())
|
||||||
return retval_sp;
|
return retval_sp;
|
||||||
target_sp->EvaluateExpression(expression, exe_ctx.GetFrameSP().get(),
|
target_sp->EvaluateExpression(expression, exe_ctx.GetFrameSP().get(),
|
||||||
retval_sp, options);
|
retval_sp, options);
|
||||||
if (retval_sp && name && *name)
|
if (retval_sp && !name.empty())
|
||||||
retval_sp->SetName(ConstString(name));
|
retval_sp->SetName(ConstString(name));
|
||||||
return retval_sp;
|
return retval_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::ValueObjectSP
|
lldb::ValueObjectSP ValueObject::CreateValueObjectFromAddress(
|
||||||
ValueObject::CreateValueObjectFromAddress(const char *name, uint64_t address,
|
llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx,
|
||||||
const ExecutionContext &exe_ctx,
|
CompilerType type) {
|
||||||
CompilerType type) {
|
|
||||||
if (type) {
|
if (type) {
|
||||||
CompilerType pointer_type(type.GetPointerType());
|
CompilerType pointer_type(type.GetPointerType());
|
||||||
if (pointer_type) {
|
if (pointer_type) {
|
||||||
@ -3645,7 +3646,7 @@ ValueObject::CreateValueObjectFromAddress(const char *name, uint64_t address,
|
|||||||
Value::eValueTypeLoadAddress);
|
Value::eValueTypeLoadAddress);
|
||||||
Error err;
|
Error err;
|
||||||
ptr_result_valobj_sp = ptr_result_valobj_sp->Dereference(err);
|
ptr_result_valobj_sp = ptr_result_valobj_sp->Dereference(err);
|
||||||
if (ptr_result_valobj_sp && name && *name)
|
if (ptr_result_valobj_sp && !name.empty())
|
||||||
ptr_result_valobj_sp->SetName(ConstString(name));
|
ptr_result_valobj_sp->SetName(ConstString(name));
|
||||||
}
|
}
|
||||||
return ptr_result_valobj_sp;
|
return ptr_result_valobj_sp;
|
||||||
@ -3655,14 +3656,14 @@ ValueObject::CreateValueObjectFromAddress(const char *name, uint64_t address,
|
|||||||
}
|
}
|
||||||
|
|
||||||
lldb::ValueObjectSP ValueObject::CreateValueObjectFromData(
|
lldb::ValueObjectSP ValueObject::CreateValueObjectFromData(
|
||||||
const char *name, const DataExtractor &data,
|
llvm::StringRef name, const DataExtractor &data,
|
||||||
const ExecutionContext &exe_ctx, CompilerType type) {
|
const ExecutionContext &exe_ctx, CompilerType type) {
|
||||||
lldb::ValueObjectSP new_value_sp;
|
lldb::ValueObjectSP new_value_sp;
|
||||||
new_value_sp = ValueObjectConstResult::Create(
|
new_value_sp = ValueObjectConstResult::Create(
|
||||||
exe_ctx.GetBestExecutionContextScope(), type, ConstString(name), data,
|
exe_ctx.GetBestExecutionContextScope(), type, ConstString(name), data,
|
||||||
LLDB_INVALID_ADDRESS);
|
LLDB_INVALID_ADDRESS);
|
||||||
new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad);
|
new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad);
|
||||||
if (new_value_sp && name && *name)
|
if (new_value_sp && !name.empty())
|
||||||
new_value_sp->SetName(ConstString(name));
|
new_value_sp->SetName(ConstString(name));
|
||||||
return new_value_sp;
|
return new_value_sp;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,8 @@ std::string CXXSyntheticChildren::GetDescription() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromExpression(
|
lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromExpression(
|
||||||
const char *name, const char *expression, const ExecutionContext &exe_ctx) {
|
llvm::StringRef name, llvm::StringRef expression,
|
||||||
|
const ExecutionContext &exe_ctx) {
|
||||||
ValueObjectSP valobj_sp(
|
ValueObjectSP valobj_sp(
|
||||||
ValueObject::CreateValueObjectFromExpression(name, expression, exe_ctx));
|
ValueObject::CreateValueObjectFromExpression(name, expression, exe_ctx));
|
||||||
if (valobj_sp)
|
if (valobj_sp)
|
||||||
@ -110,7 +111,7 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromExpression(
|
|||||||
}
|
}
|
||||||
|
|
||||||
lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromAddress(
|
lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromAddress(
|
||||||
const char *name, uint64_t address, const ExecutionContext &exe_ctx,
|
llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx,
|
||||||
CompilerType type) {
|
CompilerType type) {
|
||||||
ValueObjectSP valobj_sp(
|
ValueObjectSP valobj_sp(
|
||||||
ValueObject::CreateValueObjectFromAddress(name, address, exe_ctx, type));
|
ValueObject::CreateValueObjectFromAddress(name, address, exe_ctx, type));
|
||||||
@ -120,7 +121,7 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromAddress(
|
|||||||
}
|
}
|
||||||
|
|
||||||
lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromData(
|
lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromData(
|
||||||
const char *name, const DataExtractor &data,
|
llvm::StringRef name, const DataExtractor &data,
|
||||||
const ExecutionContext &exe_ctx, CompilerType type) {
|
const ExecutionContext &exe_ctx, CompilerType type) {
|
||||||
ValueObjectSP valobj_sp(
|
ValueObjectSP valobj_sp(
|
||||||
ValueObject::CreateValueObjectFromData(name, data, exe_ctx, type));
|
ValueObject::CreateValueObjectFromData(name, data, exe_ctx, type));
|
||||||
|
@ -509,7 +509,8 @@ ValueObjectSP GoUserExpression::GoInterpreter::VisitBasicLit(
|
|||||||
DataExtractor data(buf, order, addr_size);
|
DataExtractor data(buf, order, addr_size);
|
||||||
|
|
||||||
CompilerType type = LookupType(target, ConstString("int64"));
|
CompilerType type = LookupType(target, ConstString("int64"));
|
||||||
return ValueObject::CreateValueObjectFromData(nullptr, data, m_exe_ctx, type);
|
return ValueObject::CreateValueObjectFromData(llvm::StringRef(), data,
|
||||||
|
m_exe_ctx, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueObjectSP GoUserExpression::GoInterpreter::VisitIndexExpr(
|
ValueObjectSP GoUserExpression::GoInterpreter::VisitIndexExpr(
|
||||||
@ -565,7 +566,7 @@ GoUserExpression::GoInterpreter::VisitUnaryExpr(const GoASTUnaryExpr *e) {
|
|||||||
case GoLexer::OP_AMP: {
|
case GoLexer::OP_AMP: {
|
||||||
CompilerType type = x->GetCompilerType().GetPointerType();
|
CompilerType type = x->GetCompilerType().GetPointerType();
|
||||||
uint64_t address = x->GetAddressOf();
|
uint64_t address = x->GetAddressOf();
|
||||||
return ValueObject::CreateValueObjectFromAddress(nullptr, address,
|
return ValueObject::CreateValueObjectFromAddress(llvm::StringRef(), address,
|
||||||
m_exe_ctx, type);
|
m_exe_ctx, type);
|
||||||
}
|
}
|
||||||
case GoLexer::OP_PLUS:
|
case GoLexer::OP_PLUS:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user