[Lldb-commits] [lldb] r215730 - Fix a thinko in the process list formatting.

Jim Ingham jingham at apple.com
Fri Aug 15 10:05:28 PDT 2014


Author: jingham
Date: Fri Aug 15 12:05:27 2014
New Revision: 215730

URL: http://llvm.org/viewvc/llvm-project?rev=215730&view=rev
Log:
Fix a thinko in the process list formatting.
Made Process::Attach list the matching processes if there is more than one match.

<rdar://problem/18023352>

Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=215730&r1=215729&r2=215730&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Fri Aug 15 12:05:27 2014
@@ -319,8 +319,8 @@ ProcessInstanceInfo::DumpTableHeader (St
     }
     else
     {
-        s.Printf     ("PID    PARENT USER       ARCH    %s\n", label);
-        s.PutCString ("====== ====== ========== ======= ============================\n");
+        s.Printf     ("PID    PARENT USER       TRIPLE                   %s\n", label);
+        s.PutCString ("====== ====== ========== ======================== ============================\n");
     }
 }
 
@@ -362,10 +362,9 @@ ProcessInstanceInfo::DumpAsTableRow (Str
         }
         else
         {
-            s.Printf ("%-10s %-7d %s ", 
+            s.Printf ("%-10s %-24s ",
                       platform->GetUserName (m_euid),
-                      (int)m_arch.GetTriple().getArchName().size(),
-                      m_arch.GetTriple().getArchName().data());
+                      m_arch.IsValid() ? m_arch.GetTriple().str().c_str() : "");
         }
 
         if (verbose || show_args)
@@ -3022,7 +3021,17 @@ Process::Attach (ProcessAttachInfo &atta
                     {
                         match_info.GetProcessInfo().GetExecutableFile().GetPath (process_name, sizeof(process_name));    
                         if (num_matches > 1)
-                            error.SetErrorStringWithFormat ("more than one process named %s", process_name);
+                        {
+                            StreamString s;
+                            ProcessInstanceInfo::DumpTableHeader (s, platform_sp.get(), true, false);
+                            for (size_t i = 0; i < num_matches; i++)
+                            {
+                                process_infos.GetProcessInfoAtIndex(i).DumpAsTableRow(s, platform_sp.get(), true, false);
+                            }
+                            error.SetErrorStringWithFormat ("more than one process named %s:\n%s",
+                                                            process_name,
+                                                            s.GetData());
+                        }
                         else
                             error.SetErrorStringWithFormat ("could not find a process named %s", process_name);
                     }





More information about the lldb-commits mailing list