jasonmolenda created this revision.
jasonmolenda added reviewers: jingham, clayborg, labath.
jasonmolenda added a project: LLDB.
Herald added a subscriber: krytarowski.

I wanted to put this up as a phab to collect any reactions instead of just 
landing it, I think it's not controversial but I could be wrong.  Right now, 
Target::Launch() will prepend any error message with "process launch failed: ". 
 This is a problem with a driver program using the SB API to launch a process 
on a remote system -- the wording "process launch failed:" makes some sense for 
the lldb command line driver, but the UI driving lldb may have a different way 
of describing the operation to the user -- for instance pressing the Run button 
in an UI.  When we get back a meaningful error message about why the launch 
failed, prepending boilerplate like this makes it harder for a user to spot the 
error message.

It's a little annoying to test - on a native run, at least on macOS, our 
process launching doesn't go through Target::Process, 
CommandObjectProcessLaunch and SBTarget::Launch go through NativeProcessDarwin, 
there is no change in the error messaging in this case.  I looked over 
PlatformLinux and PlatformNetBSD, they both seem to prefix their own "process 
launch failed: " strings; PlatformWindows overwrites the error message.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74585

Files:
  lldb/source/Target/Target.cpp


Index: lldb/source/Target/Target.cpp
===================================================================
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -2957,11 +2957,6 @@
       }
     }
     m_process_sp->RestoreProcessEvents();
-  } else {
-    Status error2;
-    error2.SetErrorStringWithFormat("process launch failed: %s",
-                                    error.AsCString());
-    error = error2;
   }
   return error;
 }


Index: lldb/source/Target/Target.cpp
===================================================================
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -2957,11 +2957,6 @@
       }
     }
     m_process_sp->RestoreProcessEvents();
-  } else {
-    Status error2;
-    error2.SetErrorStringWithFormat("process launch failed: %s",
-                                    error.AsCString());
-    error = error2;
   }
   return error;
 }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to