The new ReadStringFromMemory() API does not work correctly with NSStrings that have an explicit length and no NULL terminator
This checkin reverts NSString to the old behavior when appropriate, and cleans up the syntax to call the UTF Reader&Dumper function
Incidentally, add a "-d" command-line flag to redo.py with the same semantics as "-d" in dotest.py



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180141 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/redo.py b/test/redo.py
index 2cbdd4e..ac42b2b 100755
--- a/test/redo.py
+++ b/test/redo.py
@@ -28,6 +28,8 @@
 # will be considered for re-run.  Examples: ['X86_64', 'clang'].
 filename_components = []
 
+do_delay = False
+
 # There is a known bug with respect to comp_specs and arch_specs, in that if we
 # encountered "-C clang" and "-C gcc" when visiting the session files, both
 # compilers will end up in the invocation of the test driver when rerunning.
@@ -40,12 +42,13 @@
 
 def usage():
     print"""\
-Usage: redo.py [-F filename_component] [-n] [session_dir]
+Usage: redo.py [-F filename_component] [-n] [session_dir] [-d]
 where options:
 -F : only consider the test for re-run if the session filename conatins the filename component
      for example: -F x86_64
 -n : when running the tests, do not turn on trace mode, i.e, no '-t' option
      is passed to the test driver (this will run the tests faster)
+-d : pass -d down to the test driver (introduces a delay so you can attach with a debugger)
 
 and session_dir specifies the session directory which contains previously
 recorded session infos for all the test cases which either failed or errored.
@@ -81,6 +84,7 @@
     global comp_pattern
     global arch_pattern
     global filename_components
+    global do_delay
 
     for name in names:
         if name.endswith(suffix):
@@ -111,6 +115,7 @@
     global no_trace
     global redo_specs
     global filename_components
+    global do_delay
 
     test_dir = sys.path[0]
     if not test_dir:
@@ -139,6 +144,8 @@
             filename_components.append(sys.argv[index])
         elif sys.argv[index] == '-n':
             no_trace = True
+        elif sys.argv[index] == '-d':
+            do_delay = True
 
         index += 1
 
@@ -176,7 +183,7 @@
     for arch in arch_specs:
         archs += "--arch %s " % (arch)
 
-    command = "./dotest.py %s %s -v %s -f " % (compilers, archs, "" if no_trace else "-t")
+    command = "./dotest.py %s %s -v %s %s -f " % (compilers, archs, "" if no_trace else "-t", "-d" if do_delay else "")
 
 
     print "Running %s" % (command + filters)