summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHan Ming Ong <hanming@apple.com>2012-02-29 00:12:56 +0000
committerHan Ming Ong <hanming@apple.com>2012-02-29 00:12:56 +0000
commitcec8c90a2e596d918bf5d7cc48c3261bb7b36006 (patch)
tree72437b6a43393799b3974e944c5f0de5e02e7642
parent1c0c51a51af9eaa983cb4600a71c767a6ea61524 (diff)
downloadbcm5719-llvm-cec8c90a2e596d918bf5d7cc48c3261bb7b36006.tar.gz
bcm5719-llvm-cec8c90a2e596d918bf5d7cc48c3261bb7b36006.zip
<rdar://10950312>
Need to GetProcess() to set the uid of the process to attach. llvm-svn: 151679
-rw-r--r--lldb/source/API/SBTarget.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 79b45485007..7dbcf95e48e 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -815,6 +815,16 @@ SBTarget::Attach (SBAttachInfo &sb_attach_info, SBError& error)
sb_process.SetSP (process_sp);
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));
// If we are doing synchronous mode, then wait for the
// process to stop!
@@ -907,7 +917,6 @@ SBTarget::AttachToProcessWithID
if (platform_sp->GetProcessInfo(pid, instance_info))
{
attach_info.SetUserID(instance_info.GetEffectiveUserID());
-
}
error.SetError (process_sp->Attach (attach_info));
// If we are doing synchronous mode, then wait for the
OpenPOWER on IntegriCloud