]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/lldbmacros/utils.py
xnu-2782.30.5.tar.gz
[apple/xnu.git] / tools / lldbmacros / utils.py
index 104a528cc8b0e56efa08dce656872c17d90f70b4..5c7ff72c6e2bf7b498c440397be511b18dc7be10 100644 (file)
@@ -27,6 +27,8 @@ def lldb_run_command(cmdstring):
     lldb_run_command_state['active'] = False
     if res.Succeeded():
         retval = res.GetOutput()
+    else:
+        retval = "ERROR:" + res.GetError()
     return retval
 
 def EnableLLDBAPILogging():
@@ -44,9 +46,9 @@ def EnableLLDBAPILogging():
     cmd_str = enable_log_base_cmd + ' kdp-remote packets'
     print cmd_str
     print lldb_run_command(cmd_str)
-    print lldb_run_command("verison")
+    print lldb_run_command("version")
     print "Please collect the logs from %s for filing a radar. If you had encountered an exception in a lldbmacro command please re-run it." % logfile_name
-    print "Please make sure to provide the output of 'verison', 'image list' and output of command that failed."
+    print "Please make sure to provide the output of 'version', 'image list' and output of command that failed."
     return
 
 def GetConnectionProtocol():
@@ -111,6 +113,8 @@ def GetLongestMatchOption(searchstr, options=[], ignore_case=True):
         so = o
         if ignore_case:
             so = o.lower()
+        if so == searchstr:
+            return [o]
         if so.find(searchstr) >=0 :
             found_options.append(o)
     return found_options