[Lldb-commits] [PATCH] Fix the variable printing for stack-list-local and stack-list-arguments.

Ilia K ki.stfu at gmail.com
Thu Feb 12 07:57:31 PST 2015


Looks good. I dislike these func/func2/func3/func4 (and so on) functions. One question for you: --simple-values works now?

FYI: I didn't check it on OS X yet. I'll do it later.


================
Comment at: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp:729
@@ +728,3 @@
+                    CMIUtilString valueStr = miValueList.ExtractContentNoBrackets();
+                    valueStr = valueStr.Trim('\"');
+                    // Surround by {} if there is , inside indicating multiple values.
----------------
Is it enough? Should we unescape this string?

================
Comment at: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp:733-734
@@ +732,4 @@
+                    {
+                        valueStr = "{" + valueStr;
+                        valueStr += "}";
+                    }
----------------
valueStr = CMIUtilString::Format("{%s}", valueStr.c_str());

================
Comment at: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp:738
@@ +737,3 @@
+                    const CMICmnMIValueResult miValueResult2("value", miValueConst2);
+                    miValueTuple.Add(miValueResult); // name
+                    miValueTuple.Add(miValueResult2);
----------------
Maybe would better to name it like miValueResultName? I know that lldb-mi uses sequential naming standard for miValueConst/miValueResult values, but in your case it was created on 20 lines above.

================
Comment at: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp:766
@@ -775,4 +765,3 @@
 CMICmnLLDBDebugSessionInfo::GetVariableInfo(const MIuint vnMaxDepth, const lldb::SBValue &vrValue, const bool vbIsChildValue,
-                                            const VariableInfoFormat_e veVarInfoFormat, CMICmnMIValueList &vwrMiValueList,
-                                            MIuint &vrwnDepth)
+                                            CMICmnMIValueList &vwrMiValueList, MIuint &vrwnDepth)
 {
----------------
vrwnDepth must be a reference? I think it can cause a problem on large objects. For example, on line #844 you increment it in cycle (which serves to obtain a value of complex object). But on every iteration we will call GetVariableInfo with vrwnDepth which grows, but actually these children have one depth on call stack.

http://reviews.llvm.org/D7589

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list