forked from OSchip/llvm-project
<rdar://10950312>
Need to GetProcess() to set the uid of the process to attach. llvm-svn: 151679
This commit is contained in:
parent
1c0c51a51a
commit
cec8c90a2e
|
@ -815,6 +815,16 @@ SBTarget::Attach (SBAttachInfo &sb_attach_info, SBError& error)
|
||||||
sb_process.SetSP (process_sp);
|
sb_process.SetSP (process_sp);
|
||||||
|
|
||||||
ProcessAttachInfo &attach_info = sb_attach_info.ref();
|
ProcessAttachInfo &attach_info = sb_attach_info.ref();
|
||||||
|
lldb::pid_t attach_pid = attach_info.GetProcessID();
|
||||||
|
if (attach_pid != LLDB_INVALID_PROCESS_ID)
|
||||||
|
{
|
||||||
|
PlatformSP platform_sp = target_sp->GetPlatform();
|
||||||
|
ProcessInstanceInfo instance_info;
|
||||||
|
if (platform_sp->GetProcessInfo(attach_pid, instance_info))
|
||||||
|
{
|
||||||
|
attach_info.SetUserID(instance_info.GetEffectiveUserID());
|
||||||
|
}
|
||||||
|
}
|
||||||
error.SetError (process_sp->Attach (attach_info));
|
error.SetError (process_sp->Attach (attach_info));
|
||||||
// If we are doing synchronous mode, then wait for the
|
// If we are doing synchronous mode, then wait for the
|
||||||
// process to stop!
|
// process to stop!
|
||||||
|
@ -907,7 +917,6 @@ SBTarget::AttachToProcessWithID
|
||||||
if (platform_sp->GetProcessInfo(pid, instance_info))
|
if (platform_sp->GetProcessInfo(pid, instance_info))
|
||||||
{
|
{
|
||||||
attach_info.SetUserID(instance_info.GetEffectiveUserID());
|
attach_info.SetUserID(instance_info.GetEffectiveUserID());
|
||||||
|
|
||||||
}
|
}
|
||||||
error.SetError (process_sp->Attach (attach_info));
|
error.SetError (process_sp->Attach (attach_info));
|
||||||
// If we are doing synchronous mode, then wait for the
|
// If we are doing synchronous mode, then wait for the
|
||||||
|
|
Loading…
Reference in New Issue