[Lldb-commits] [lldb] r224188 - Make the platform process connect path less chatty.

Stephane Sezer sas at cd80.net
Fri Dec 12 21:23:51 PST 2014

Author: sas
Date: Fri Dec 12 23:23:51 2014
New Revision: 224188

URL: http://llvm.org/viewvc/llvm-project?rev=224188&view=rev
Make the platform process connect path less chatty.

If a stream contains an empty string, no need to append it to the output
(otherwise we end up with a blank line). Also, no need to print a status
message when the state changes to connected, as this string brings no
information -- "Process 0" does not mean anything to the user, and the
process being connected has no meaning either.

Test Plan:
Connect to a remote linux platform mode daemon with `platform select
remote-linux` followed by `platform connect ...`, create a target and
run it, observe the output. Also, run the full test suite (dosep.py).

    (lldb) [...] connect, etc.
    (lldb) r
    Process 0 connected

    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

    (lldb) [...] connect, etc.
    (lldb) r
    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

Reviewers: tfiala, vharron, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D6593


Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=224188&r1=224187&r2=224188&view=diff
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Fri Dec 12 23:23:51 2014
@@ -268,7 +268,8 @@ protected:
             ProcessSP process_sp (target->GetProcessSP());
             if (process_sp)
-                if (stream.GetData())
+                const char *data = stream.GetData();
+                if (data && strlen(data) > 0)
                 result.AppendMessageWithFormat ("Process %" PRIu64 " launched: '%s' (%s)\n", process_sp->GetID(), exe_module_sp->GetFileSpec().GetPath().c_str(), archname);
                 result.SetStatus (eReturnStatusSuccessFinishResult);

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=224188&r1=224187&r2=224188&view=diff
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Fri Dec 12 23:23:51 2014
@@ -1044,7 +1044,6 @@ Process::HandleProcessStateChangedEvent
         case eStateInvalid:
         case eStateUnloaded:
-        case eStateConnected:
         case eStateAttaching:
         case eStateLaunching:
         case eStateStepping:
@@ -1060,6 +1059,7 @@ Process::HandleProcessStateChangedEvent
+        case eStateConnected:
         case eStateRunning:
             // Don't be chatty when we run...

More information about the lldb-commits mailing list