Changeset View
Changeset View
Standalone View
Standalone View
debuggers/lldb/controllers/variable.cpp
Show All 19 Lines | |||||
20 | * | 20 | * | ||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #include "variable.h" | 23 | #include "variable.h" | ||
24 | 24 | | |||
25 | #include "debuglog.h" | 25 | #include "debuglog.h" | ||
26 | #include "debugsession.h" | 26 | #include "debugsession.h" | ||
27 | #include "mi/micommand.h" | 27 | #include "mi/micommand.h" | ||
28 | #include "stringhelpers.h" | ||||
29 | | ||||
30 | #include <QString> | ||||
28 | 31 | | |||
29 | using namespace KDevelop; | 32 | using namespace KDevelop; | ||
30 | using namespace KDevMI::LLDB; | 33 | using namespace KDevMI::LLDB; | ||
31 | using namespace KDevMI::MI; | 34 | using namespace KDevMI::MI; | ||
32 | 35 | | |||
33 | LldbVariable::LldbVariable(DebugSession *session, TreeModel *model, TreeItem *parent, | 36 | LldbVariable::LldbVariable(DebugSession *session, TreeModel *model, TreeItem *parent, | ||
34 | const QString& expression, const QString& display) | 37 | const QString& expression, const QString& display) | ||
35 | : MIVariable(session, model, parent, expression, display) | 38 | : MIVariable(session, model, parent, expression, display) | ||
Show All 32 Lines | 70 | if(guarded_this && r.hasField("changelist")) { | |||
68 | if (r["changelist"].size() > 0) { | 71 | if (r["changelist"].size() > 0) { | ||
69 | guarded_this->handleRawUpdate(r); | 72 | guarded_this->handleRawUpdate(r); | ||
70 | } | 73 | } | ||
71 | } | 74 | } | ||
72 | }); | 75 | }); | ||
73 | } | 76 | } | ||
74 | } | 77 | } | ||
75 | } | 78 | } | ||
79 | | ||||
80 | QString LldbVariable::formatValue(const QString& value) const | ||||
81 | { | ||||
82 | // Data formatter emits value with unicode escape sequence for string and char, | ||||
83 | // translate them back. | ||||
84 | // Only check with first char is enough, as unquote will do the rest check | ||||
85 | if (value.startsWith('"')) { | ||||
86 | return Utils::quote(Utils::unquote(value, true)); | ||||
87 | } else if (value.startsWith('\'')) { | ||||
88 | return Utils::quote(Utils::unquote(value, true, '\''), '\''); | ||||
89 | } | ||||
90 | return value; | ||||
91 | } |