Commit dd7f1c90 authored by Peifeng Yu's avatar Peifeng Yu
Browse files

KDevMI: correctly handle error in MIVariableController

parent b3fd416d
......@@ -118,7 +118,7 @@ public:
{
if (!KDevelop::ICore::self()->debugController()) return; //happens on shutdown
// FIXME: handle error.
if (r.hasField("stack-args") && r["stack-args"].size() > 0) {
const Value& locals = r["stack-args"][0]["args"];
for (int i = 0; i < locals.size(); i++) {
......@@ -130,6 +130,7 @@ public:
v->attachMaybe();
}
}
}
private:
QStringList m_localsName;
......@@ -144,8 +145,7 @@ public:
void handle(const ResultRecord &r) override
{
// FIXME: handle error.
if (r.hasField("locals")) {
const Value& locals = r["locals"];
QStringList localsName;
......@@ -159,6 +159,7 @@ public:
QString("0 %1 %2").arg(frame).arg(frame),
new StackListArgumentsHandler(localsName));
}
}
private:
MIDebugSession *m_session;
......@@ -223,8 +224,9 @@ void MIVariableController::addWatchpoint(KDevelop::Variable* variable)
void MIVariableController::addWatch(const ResultRecord& r)
{
// FIXME: handle error.
if (r.reason == "done" && !r["path_expr"].literal().isEmpty()) {
if (r.reason == "done"
&& r.hasField("path_expr")
&& !r["path_expr"].literal().isEmpty()) {
variableCollection()->watches()->add(r["path_expr"].literal());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment