[Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range

Ilia K via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 25 00:40:05 PDT 2015


ki.stfu requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: include/lldb/API/SBTypeSummary.h:125-126
@@ -124,1 +124,4 @@
+
+        bool
+        DoesPrintValue (const SBValue& value);
         
----------------
You can use clang-format to follow the LLDB coding style, or just do the following:
```
        bool
        DoesPrintValue (const SBValue &value);
```

================
Comment at: source/API/SBTypeSummary.cpp:290
@@ +289,3 @@
+bool
+SBTypeSummary::DoesPrintValue(const SBValue& value)
+{
----------------
ditto

================
Comment at: test/tools/lldb-mi/variable/TestMiVar.py:355
@@ +354,3 @@
+        self.runCmd("-var-create - * std_string")
+        self.expect('\^done,name="var\d+",numchild="[0-9]+",value="\\\\"hello\\\\"",type="std::[\S]*string",thread-id="1",has_more="0"')
+
----------------
Use lazy regex:
```
self.expect('\^done,name="var\d+",numchild="[0-9]+",value="\\\\"hello\\\\"",type="std::[\S]*?string",thread-id="1",has_more="0"')
```

================
Comment at: tools/lldb-mi/MICmnLLDBUtilSBValue.cpp:173-174
@@ +172,4 @@
+        // (for example with AddCXXSummary) as simple value
+        if (TryGetValueSummary(vwrValue))
+            return MIstatus::success;
+    }
----------------
```
vwrValue = GetValueSummary();
if (!vwrValue.empty)
  return MIstatus::success;
```

================
Comment at: tools/lldb-mi/MICmnLLDBUtilSBValue.cpp:191-193
@@ -182,1 +190,5 @@
 {
+    CMIUtilString summary;
+    if (TryGetValueSummary(summary))
+        return summary;
+
----------------
```
const CMIUtilString summary = GetValueSummary();
if (!summary.empty())
    return summary;
```

================
Comment at: tools/lldb-mi/MICmnLLDBUtilSBValue.cpp:242-244
@@ -229,1 +241,5 @@
 
+    CMIUtilString summary;
+    if (TryGetValueSummary(summary))
+        return summary;
+
----------------
```
const CMIUtilString summary = GetValueSummary();
if (!summary.empty())
    return summary;
```

================
Comment at: tools/lldb-mi/MICmnLLDBUtilSBValue.cpp:285-287
@@ -268,1 +284,5 @@
 {
+    CMIUtilString summary;
+    if (TryGetValueSummary(summary))
+        return summary;
+
----------------
```
const CMIUtilString summary = GetValueSummary();
if (!summary.empty())
    return summary;
```

================
Comment at: tools/lldb-mi/MICmnLLDBUtilSBValue.h:58
@@ -57,3 +57,3 @@
     bool GetCompositeValue(const bool vbPrintFieldNames, CMICmnMIValueTuple &vwrMiValueTuple, const MIuint vnDepth = 1) const;
-
+    bool TryGetValueSummary(CMIUtilString &vrValue) const;
     // Statics:
----------------
It is better:
```
CMIUtilString GetValueSummary(CMIUtilString &vrValue) const
```


http://reviews.llvm.org/D13058





More information about the lldb-commits mailing list