Add exec support for Linux including common support for POSIX.

llvm-svn: 192319
This commit is contained in:
Matt Kopec
2013-10-09 19:39:55 +00:00
parent dc7c73c604
commit 718be877f8
6 changed files with 62 additions and 5 deletions

View File

@@ -352,6 +352,31 @@ ProcessPOSIX::DoDestroy()
return error;
}
void
ProcessPOSIX::DoDidExec()
{
Target *target = &GetTarget();
if (target)
{
PlatformSP platform_sp (target->GetPlatform());
assert (platform_sp.get());
if (platform_sp)
{
ProcessInstanceInfo process_info;
platform_sp->GetProcessInfo(GetID(), process_info);
ModuleSP exe_module_sp;
FileSpecList executable_search_paths (Target::GetDefaultExecutableSearchPaths());
Error error = platform_sp->ResolveExecutable(process_info.GetExecutableFile(),
target->GetArchitecture(),
exe_module_sp,
executable_search_paths.GetSize() ? &executable_search_paths : NULL);
if (!error.Success())
return;
target->SetExecutableModule(exe_module_sp, true);
}
}
}
void
ProcessPOSIX::SendMessage(const ProcessMessage &message)
{
@@ -426,7 +451,7 @@ ProcessPOSIX::SendMessage(const ProcessMessage &message)
break;
case ProcessMessage::eNewThreadMessage:
{
{
lldb::tid_t new_tid = message.GetChildTID();
if (WaitingForInitialStop(new_tid))
{
@@ -437,9 +462,19 @@ ProcessPOSIX::SendMessage(const ProcessMessage &message)
StopAllThreads(message.GetTID());
SetPrivateState(eStateStopped);
break;
}
}
case ProcessMessage::eExecMessage:
{
assert(thread);
thread->SetState(eStateStopped);
StopAllThreads(message.GetTID());
SetPrivateState(eStateStopped);
break;
}
}
m_message_queue.push(message);
}