mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 11:57:39 +08:00
"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
89 lines
2.1 KiB
C++
89 lines
2.1 KiB
C++
//===-- State.cpp -----------------------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// C Includes
|
|
// C++ Includes
|
|
// Other libraries and framework includes
|
|
// Project includes
|
|
#include "lldb/Core/State.h"
|
|
#include <stdio.h>
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
const char *
|
|
lldb_private::StateAsCString (StateType state)
|
|
{
|
|
switch (state)
|
|
{
|
|
case eStateInvalid: return "invalid";
|
|
case eStateUnloaded: return "unloaded";
|
|
case eStateAttaching: return "attaching";
|
|
case eStateLaunching: return "launching";
|
|
case eStateStopped: return "stopped";
|
|
case eStateRunning: return "running";
|
|
case eStateStepping: return "stepping";
|
|
case eStateCrashed: return "crashed";
|
|
case eStateDetached: return "detached";
|
|
case eStateExited: return "exited";
|
|
case eStateSuspended: return "suspended";
|
|
}
|
|
static char unknown_state_string[64];
|
|
snprintf(unknown_state_string, sizeof (unknown_state_string), "StateType = %i", state);
|
|
return unknown_state_string;
|
|
}
|
|
|
|
bool
|
|
lldb_private::StateIsRunningState (StateType state)
|
|
{
|
|
switch (state)
|
|
{
|
|
case eStateAttaching:
|
|
case eStateLaunching:
|
|
case eStateRunning:
|
|
case eStateStepping:
|
|
return true;
|
|
|
|
case eStateDetached:
|
|
case eStateInvalid:
|
|
case eStateUnloaded:
|
|
case eStateStopped:
|
|
case eStateCrashed:
|
|
case eStateExited:
|
|
case eStateSuspended:
|
|
default:
|
|
break;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool
|
|
lldb_private::StateIsStoppedState (StateType state)
|
|
{
|
|
switch (state)
|
|
{
|
|
case eStateInvalid:
|
|
case eStateAttaching:
|
|
case eStateLaunching:
|
|
case eStateRunning:
|
|
case eStateStepping:
|
|
case eStateDetached:
|
|
default:
|
|
break;
|
|
|
|
case eStateUnloaded:
|
|
case eStateStopped:
|
|
case eStateCrashed:
|
|
case eStateExited:
|
|
case eStateSuspended:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|