[Lldb-commits] [lldb] r155592 - in /lldb/branches/lldb-platform-work/source: Commands/CommandObjectPlatform.cpp Core/Error.cpp

Enrico Granata egranata at apple.com
Wed Apr 25 15:29:50 PDT 2012


Author: enrico
Date: Wed Apr 25 17:29:50 2012
New Revision: 155592

URL: http://llvm.org/viewvc/llvm-project?rev=155592&view=rev
Log:
Patch by Viktor Kutuzov <vkutuzov at accesssoftek.com> to:
- fix a double output for the "error: " prefix (like "error: error: ...<message>...") in Error::LogIfError (source/Core/Error.cpp).
- fix a crash in CommandObjectPlatformConnect::GetOptions method (source/Commands/CommandObjectPlatform.cpp).
- fix the syntax help string for the 'platform file' command.
- have the 'platform shell' print its usage if no arguments were passed.


Modified:
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp
    lldb/branches/lldb-platform-work/source/Core/Error.cpp

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp?rev=155592&r1=155591&r2=155592&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp Wed Apr 25 17:29:50 2012
@@ -421,7 +421,7 @@
         if (platform_sp)
         {
             m_platform_options = platform_sp->GetConnectionOptions(m_interpreter);
-            if (!m_platform_options->m_did_finalize)
+            if (m_platform_options != NULL && !m_platform_options->m_did_finalize)
                 m_platform_options->Finalize();
         }
         return m_platform_options;
@@ -927,7 +927,7 @@
     CommandObjectMultiword (interpreter,
                             "platform file",
                             "A set of commands to manage file access through a platform",
-                            "platform process [attach|launch|list] ...")
+                            "platform file [open|close|read|write] ...")
     {
         LoadSubCommand ("open", CommandObjectSP (new CommandObjectPlatformFOpen  (interpreter)));
         LoadSubCommand ("close", CommandObjectSP (new CommandObjectPlatformFClose  (interpreter)));
@@ -1978,6 +1978,14 @@
     ExecuteRawCommandString (const char *raw_command_line, CommandReturnObject &result)
     {
         const char* expr = NULL;
+
+        // Print out an usage syntax on an empty command line.
+        if (raw_command_line[0] == '\0')
+        {
+            result.GetOutputStream().Printf("%s\n", this->GetSyntax());
+            return true;
+        }
+
         if (raw_command_line[0] == '-')
         {
             // We have some options and these options MUST end with --.

Modified: lldb/branches/lldb-platform-work/source/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Error.cpp?rev=155592&r1=155591&r2=155592&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Error.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Error.cpp Wed Apr 25 17:29:50 2012
@@ -238,7 +238,7 @@
             if (err_str == NULL)
                 err_str = "???";
 
-            SetErrorStringWithFormat("error: %s err = %s (0x%8.8x)", arg_msg, err_str, m_code);
+            SetErrorStringWithFormat("%s err = %s (0x%8.8x)", arg_msg, err_str, m_code);
             if (log)
                 log->Error("%s", m_string.c_str());
 





More information about the lldb-commits mailing list