class LinuxTask

Defined at line 36 of file ../../src/developer/debug/debug_agent/linux_task.h

Represents a thread/process on Linux for which ptrace is involed.

Threads and processes aren't really different on Linux. Threads are special-cases of processes

that share address space, and the main thread is indistinguishable from the process.

To implement our process/thread split, the process and thread handles must share the underlying

handle. In addition, exceptions and suspend tokens need to refer to the pthread information in

a way that's independent of the ThreadHandle or ProcessHandle.

This reference-counted object can be referenced by all the necessary places and collects the

state.

Public Methods

int pid ()

Defined at line 38 of file ../../src/developer/debug/debug_agent/linux_task.h

bool is_attached ()

Registers/unregisters this task with ptrace for getting exceptions. Attach() and Detach() can

be called multiple times without side effects.

Defined at line 42 of file ../../src/developer/debug/debug_agent/linux_task.h

void set_single_step (bool ss)

Defined at line 55 of file ../../src/developer/debug/debug_agent/linux_task.h

bool is_suspended ()

Defined at line 57 of file ../../src/developer/debug/debug_agent/linux_task.h

int exit_code ()

Defined at line 58 of file ../../src/developer/debug/debug_agent/linux_task.h

debug::Status Attach ()

Defined at line 84 of file ../../src/developer/debug/debug_agent/linux_task.cc

void Detach ()

Defined at line 98 of file ../../src/developer/debug/debug_agent/linux_task.cc

void SetObserver (LinuxTaskObserver * observer)

Sets the observer. Callers will also want to call Attach first to get events.

Null means no observer.

There can be multiple LinuxTask objects for a process since the debug agent expects that

Thread/ProcessHandles are like Zircon "handles." There should only be one task with an observer

set on it, or there will be failures. Normally this will correspond to a DebuggedProcess

so maintaining a unique observer across all LinuxTasks with a given PID is trivial.

Defined at line 111 of file ../../src/developer/debug/debug_agent/linux_task.cc

Friends

class LinuxSuspendHandle
class LinuxExceptionHandle
class LinuxBinaryLauncher
class MakeRefCountedHelper
class RefCountedThreadSafe