本文整理汇总了C++中LLDBReply类的典型用法代码示例。如果您正苦于以下问题:C++ LLDBReply类的具体用法?C++ LLDBReply怎么用?C++ LLDBReply使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLDBReply类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxPrintf
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);
}
}
}
示例2: wxPrintf
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);
}
}
}
示例3: wxPrintf
void CodeLiteLLDBApp::NotifyStoppedOnFirstEntry()
{
wxPrintf("codelite-lldb: NotifyStoppedOnFirstEntry()\n");
m_variables.clear();
LLDBReply reply;
reply.SetReplyType( kReplyTypeDebuggerStoppedOnFirstEntry );
SendReply( reply );
}
示例4: SendReply
void CodeLiteLLDBApp::SendReply(const LLDBReply& reply)
{
try {
m_replySocket->WriteMessage(reply.ToJSON().format());
} catch(clSocketException& e) {
wxPrintf("codelite-lldb: failed to send reply. %s. %s.\n", e.what().c_str(), strerror(errno));
}
}
示例5: switch
void CodeLiteLLDBApp::NotifyStarted(eLLDBDebugSessionType sessionType)
{
switch(sessionType) {
case kDebugSessionTypeAttach:
wxPrintf("codelite-lldb: NotifyStarted called (kDebugSessionTypeAttach)\n");
break;
case kDebugSessionTypeCore:
wxPrintf("codelite-lldb: NotifyStarted called (kDebugSessionTypeCore)\n");
break;
case kDebugSessionTypeNormal:
wxPrintf("codelite-lldb: NotifyStarted called (kDebugSessionTypeNormal)\n");
break;
}
m_sessionType = sessionType;
m_variables.clear();
LLDBReply reply;
reply.SetDebugSessionType(sessionType);
reply.SetReplyType(kReplyTypeDebuggerStartedSuccessfully);
SendReply(reply);
}
示例6: NotifyStopped
void CodeLiteLLDBApp::NotifyStopped()
{
m_variables.clear();
LLDBReply reply;
wxPrintf("codelite-lldb: NotifyStopped() called. m_interruptReason=%d\n", (int)m_interruptReason);
reply.SetReplyType(kReplyTypeDebuggerStopped);
reply.SetInterruptResaon(m_interruptReason);
// If we find a thread that was stopped due to breakpoint, make it the active one
int threadCount = m_target.GetProcess().GetNumThreads();
for(int i = 0; i < threadCount; ++i) {
lldb::SBThread thr = m_target.GetProcess().GetThreadAtIndex(i);
if(thr.GetStopReason() == lldb::eStopReasonBreakpoint) {
m_target.GetProcess().SetSelectedThread(thr);
break;
}
}
lldb::SBThread thread = m_target.GetProcess().GetSelectedThread();
LLDBBacktrace bt(thread, m_settings);
reply.SetBacktrace(bt);
int selectedThreadId = thread.GetThreadID();
// set the selected frame file:line
if(thread.IsValid() && thread.GetSelectedFrame().IsValid()) {
lldb::SBFrame frame = thread.GetSelectedFrame();
lldb::SBLineEntry lineEntry = thread.GetSelectedFrame().GetLineEntry();
if(lineEntry.IsValid()) {
reply.SetLine(lineEntry.GetLine());
lldb::SBFileSpec fileSepc = frame.GetLineEntry().GetFileSpec();
reply.SetFilename(wxFileName(fileSepc.GetDirectory(), fileSepc.GetFilename()).GetFullPath());
}
}
// Prepare list of threads
LLDBThread::Vect_t threads;
for(int i = 0; i < threadCount; ++i) {
LLDBThread t;
lldb::SBThread thr = m_target.GetProcess().GetThreadAtIndex(i);
t.SetStopReason(thr.GetStopReason());
t.SetId(thr.GetThreadID());
t.SetActive(selectedThreadId == (int)thr.GetThreadID());
lldb::SBFrame frame = thr.GetSelectedFrame();
t.SetFunc(frame.GetFunctionName() ? frame.GetFunctionName() : "");
lldb::SBLineEntry lineEntry = thr.GetSelectedFrame().GetLineEntry();
// get the stop reason string
char buffer[1024];
memset(buffer, 0x0, sizeof(buffer));
thr.GetStopDescription(buffer, sizeof(buffer));
t.SetStopReasonString(buffer);
wxPrintf("codelite-lldb: thread %d stop reason is %s\n", t.GetId(), t.GetStopReasonString());
if(lineEntry.IsValid()) {
t.SetLine(lineEntry.GetLine());
lldb::SBFileSpec fileSepc = frame.GetLineEntry().GetFileSpec();
t.SetFile(wxFileName(fileSepc.GetDirectory(), fileSepc.GetFilename()).GetFullPath());
}
threads.push_back(t);
}
reply.SetThreads(threads);
SendReply(reply);
// reset the interrupt reason
m_interruptReason = kInterruptReasonNone;
}
示例7: NotifyAllBreakpointsDeleted
void CodeLiteLLDBApp::NotifyAllBreakpointsDeleted()
{
LLDBReply reply;
reply.SetReplyType(kReplyTypeAllBreakpointsDeleted);
SendReply(reply);
}