Fixed debugserver to properly attach to a process by name with the

"vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch 
with the "vAttachWait;<PROCNAME>".

Fixed a few issues with attaching where if DoAttach() returned no error, yet
there was no valid process ID, we would deadlock waiting for an event that
would never happen.

Added a new "process launch" option "--tty" that will launch the process 
in a new terminal if the Host layer supports the "Host::LaunchInNewTerminal(...)"
function. This currently works on MacOSX and will allow the debugging of 
terminal applications that do complex operations with the terminal. 

Cleaned up the output when the process resumes, stops and halts to be 
consistent with the output format.

llvm-svn: 116693
This commit is contained in:
Greg Clayton
2010-10-18 01:45:30 +00:00
parent 0ea1047d51
commit 19388cfc6e
10 changed files with 163 additions and 92 deletions

View File

@@ -1109,6 +1109,12 @@ Error
Process::CompleteAttach ()
{
Error error;
if (GetID() == LLDB_INVALID_PROCESS_ID)
{
error.SetErrorString("no process");
}
EventSP event_sp;
StateType state = WaitForProcessStopPrivate(NULL, event_sp);
if (state == eStateStopped || state == eStateCrashed)
@@ -1205,7 +1211,7 @@ Process::Attach (const char *process_name, bool wait_for_launch)
if (!wait_for_launch)
{
ArchSpec attach_spec = GetArchSpecForExistingProcess (process_name);
if (attach_spec != GetTarget().GetArchitecture())
if (attach_spec.IsValid() && attach_spec != GetTarget().GetArchitecture())
{
// Set the architecture on the target.
GetTarget().SetArchitecture(attach_spec);