[Lldb-commits] [PATCH] D11574: Add size field to library load event

Ilia K ki.stfu at gmail.com
Wed Jul 29 22:31:30 PDT 2015


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

================
Comment at: test/tools/lldb-mi/TestMiLibraryLoaded.py:31
@@ +30,3 @@
+                "=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"1\",symbols-path=\"%s\",loaded_addr=\"-\",size=\"[0-9]+\"" % (path, path, path, symbols_path),
+                "=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"0\",loaded_addr=\"-\",size=\"[0-9]+\"" % (path, path, path)
+            ])
----------------
It's still may cause a false negative, so let's do the following (more details in D9716):
```
def add_slashes(x): return x.replace("\\", "\\\\").replace("\"", "\\\"").replace("\'", "\\\'").replace("\0", "\\\0")
self.expect([
        "=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"1\",symbols-path=\"%s\",loaded_addr=\"-\",size=\"[0-9]+\"" % (add_slashes(path), add_slashes(path), add_slashes(path), add_slashes(symbols_path)),
        "=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"0\",loaded_addr=\"-\",size=\"[0-9]+\"" % (add_slashes(path), add_slashes(path), add_slashes(path))
    ])
```

================
Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:691
@@ -690,3 +690,3 @@
     const CMIUtilString strTargetPath(apPath.get());
-    const CMICmnMIValueConst miValueConst(strTargetPath);
+    const CMICmnMIValueConst miValueConst(strTargetPath.Escape(true /* vbEscapeQuotes */));
     const CMICmnMIValueResult miValueResult("id", miValueConst);
----------------
Just use the AddSlashes here.

================
Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:695
@@ -694,3 +694,3 @@
     // Build "target-name" field
-    const CMICmnMIValueConst miValueConst2(strTargetPath);
+    const CMICmnMIValueConst miValueConst2(strTargetPath.Escape(true /* vbEscapeQuotes */));
     const CMICmnMIValueResult miValueResult2("target-name", miValueConst2);
----------------
Just use the AddSlashes here.

================
Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:701
@@ -700,3 +700,3 @@
     const CMIUtilString strHostPath(apPath.get());
-    const CMICmnMIValueConst miValueConst3(strHostPath);
+    const CMICmnMIValueConst miValueConst3(strHostPath.Escape(true /* vbEscapeQuotes */));
     const CMICmnMIValueResult miValueResult3("host-name", miValueConst3);
----------------
Just use the AddSlashes here.

================
Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:718
@@ -717,3 +717,3 @@
         {
-            const CMICmnMIValueConst miValueConst5(strSymbolsPath);
+            const CMICmnMIValueConst miValueConst5(strSymbolsPath.Escape(true /* vbEscapeQuotes */));
             const CMICmnMIValueResult miValueResult5("symbols-path", miValueConst5);
----------------
Just use the AddSlashes here.


http://reviews.llvm.org/D11574







More information about the lldb-commits mailing list