Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 5e91e37

Browse files
author
Greg Clayton
committedOct 12, 2012
Patch from Daniel Malea that cleans up the process parameters for Process/Thread classes for POSIX and Linux.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165806 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d1f0376 commit 5e91e37

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed
 

‎source/API/SBDeclaration.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "lldb/Core/Stream.h"
1414
#include "lldb/Symbol/Declaration.h"
1515

16+
#include <limits.h>
17+
1618
using namespace lldb;
1719
using namespace lldb_private;
1820

‎source/Plugins/Process/Linux/ProcessLinux.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ ProcessLinux::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thre
106106
assert(m_monitor);
107107
ThreadSP thread_sp (old_thread_list.FindThreadByID (GetID(), false));
108108
if (!thread_sp) {
109-
ProcessSP me = this->shared_from_this();
110-
thread_sp.reset(new POSIXThread(me, GetID()));
109+
thread_sp.reset(new POSIXThread(*this, GetID()));
111110
}
112111

113112
if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))

‎source/Plugins/Process/Linux/ProcessMonitor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,6 @@ ProcessMonitor::Launch(LaunchArgs *args)
967967
{
968968
ProcessMonitor *monitor = args->m_monitor;
969969
ProcessLinux &process = monitor->GetProcess();
970-
lldb::ProcessSP processSP = process.shared_from_this();
971970
const char **argv = args->m_argv;
972971
const char **envp = args->m_envp;
973972
const char *stdin_path = args->m_stdin_path;
@@ -1106,7 +1105,7 @@ ProcessMonitor::Launch(LaunchArgs *args)
11061105
// Update the process thread list with this new thread.
11071106
// FIXME: should we be letting UpdateThreadList handle this?
11081107
// FIXME: by using pids instead of tids, we can only support one thread.
1109-
inferior.reset(new POSIXThread(processSP, pid));
1108+
inferior.reset(new POSIXThread(process, pid));
11101109
if (log)
11111110
log->Printf ("ProcessMonitor::%s() adding pid = %i", __FUNCTION__, pid);
11121111
process.GetThreadList().AddThread(inferior);
@@ -1168,7 +1167,6 @@ ProcessMonitor::Attach(AttachArgs *args)
11681167

11691168
ProcessMonitor *monitor = args->m_monitor;
11701169
ProcessLinux &process = monitor->GetProcess();
1171-
lldb::ProcessSP processSP = process.shared_from_this();
11721170
lldb::ThreadSP inferior;
11731171
LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
11741172

@@ -1196,7 +1194,7 @@ ProcessMonitor::Attach(AttachArgs *args)
11961194
monitor->m_pid = pid;
11971195

11981196
// Update the process thread list with the attached thread.
1199-
inferior.reset(new POSIXThread(processSP, pid));
1197+
inferior.reset(new POSIXThread(process, pid));
12001198
if (log)
12011199
log->Printf ("ProcessMonitor::%s() adding tid = %i", __FUNCTION__, pid);
12021200
process.GetThreadList().AddThread(inferior);

‎source/Plugins/Process/POSIX/POSIXThread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using namespace lldb;
3333
using namespace lldb_private;
3434

3535

36-
POSIXThread::POSIXThread(ProcessSP &process, lldb::tid_t tid)
36+
POSIXThread::POSIXThread(Process &process, lldb::tid_t tid)
3737
: Thread(process, tid),
3838
m_frame_ap(0)
3939
{

‎source/Plugins/Process/POSIX/POSIXThread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class POSIXThread
2929
: public lldb_private::Thread
3030
{
3131
public:
32-
POSIXThread(lldb::ProcessSP &process, lldb::tid_t tid);
32+
POSIXThread(lldb_private::Process &process, lldb::tid_t tid);
3333

3434
virtual ~POSIXThread();
3535

‎source/Plugins/Process/POSIX/ProcessPOSIX.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,7 @@ ProcessPOSIX::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thre
510510
assert(m_monitor);
511511
ThreadSP thread_sp (old_thread_list.FindThreadByID (GetID(), false));
512512
if (!thread_sp) {
513-
ProcessSP me = this->shared_from_this();
514-
thread_sp.reset(new POSIXThread(me, GetID()));
513+
thread_sp.reset(new POSIXThread(*this, GetID()));
515514
}
516515

517516
if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))

0 commit comments

Comments
 (0)
This repository has been archived.