本文整理汇总了C++中LLDBCommand::GetExpression方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDBCommand::GetExpression方法的具体用法?C++ LLDBCommand::GetExpression怎么用?C++ LLDBCommand::GetExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDBCommand
的用法示例。
在下文中一共展示了LLDBCommand::GetExpression方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EvalExpression
void CodeLiteLLDBApp::EvalExpression(const LLDBCommand& command)
{
wxPrintf("codelite-lldb: evaluating expression '%s'\n", command.GetExpression());
if(CanInteract()) {
lldb::SBExpressionOptions options;
lldb::SBValue value = m_target.EvaluateExpression(command.GetExpression().mb_str(wxConvUTF8).data(), options);
if(value.IsValid()) {
LLDBReply reply;
reply.SetReplyType(kReplyTypeExprEvaluated);
reply.SetExpression(command.GetExpression());
LLDBVariable::Vect_t vars;
LLDBVariable::Ptr_t var(new LLDBVariable(value));
vars.push_back(var);
reply.SetVariables(vars);
VariableWrapper wrapper;
wrapper.value = value;
// Cache the expanded variable (we will need it later for tooltip expansion
m_variables.insert(std::make_pair(value.GetID(), wrapper));
SendReply(reply);
}
}
}
示例2: EvalExpression
void CodeLiteLLDBApp::EvalExpression(const LLDBCommand& command)
{
wxPrintf("codelite-lldb: evaluating expression '%s'\n", command.GetExpression());
if(CanInteract()) {
// Evaluate the expression based on the current frame
wxString expression = command.GetExpression();
expression.Trim().Trim(false);
lldb::SBValue value = m_target.GetProcess().GetSelectedThread().GetSelectedFrame().GetValueForVariablePath(
expression.mb_str(wxConvUTF8).data());
if(value.IsValid()) {
LLDBReply reply;
reply.SetReplyType(kReplyTypeExprEvaluated);
reply.SetExpression(command.GetExpression());
LLDBVariable::Vect_t vars;
LLDBVariable::Ptr_t var(new LLDBVariable(value));
vars.push_back(var);
reply.SetVariables(vars);
VariableWrapper wrapper;
wrapper.value = value;
// Cache the expanded variable (we will need it later for tooltip expansion
m_variables.insert(std::make_pair(value.GetID(), wrapper));
SendReply(reply);
}
}
}
示例3: ExecuteInterperterCommand
void CodeLiteLLDBApp::ExecuteInterperterCommand(const LLDBCommand& command)
{
lldb::SBCommandReturnObject ret;
std::string c_command = command.GetExpression().mb_str(wxConvUTF8).data();
wxPrintf("codelite-lldb: ExecuteInterperterCommand: '%s'\n", c_command.c_str());
m_debugger.GetCommandInterpreter().HandleCommand(c_command.c_str(), ret);
if(ret.GetOutput()) {
LLDBReply reply;
reply.SetText(ret.GetOutput());
reply.SetReplyType(kReplyTypeInterperterReply);
SendReply(reply);
} else if(ret.GetError()) {
LLDBReply reply;
reply.SetText(ret.GetError());
reply.SetReplyType(kReplyTypeInterperterReply);
SendReply(reply);
}
}
示例4: AddWatch
void CodeLiteLLDBApp::AddWatch(const LLDBCommand& command)
{
wxString expr = command.GetExpression();
wxPrintf("codelite-lldb: adding watch '%s'\n", expr);
m_watches.Add(command.GetExpression());
}