class DebuggedProcess
Defined at line 52 of file ../../src/developer/debug/debug_agent/debugged_process.h
Public Methods
zx_koid_t koid ()
Defined at line 61 of file ../../src/developer/debug/debug_agent/debugged_process.h
DebugAgent * debug_agent ()
Defined at line 62 of file ../../src/developer/debug/debug_agent/debugged_process.h
const ProcessHandle & process_handle ()
Defined at line 64 of file ../../src/developer/debug/debug_agent/debugged_process.h
ProcessHandle & process_handle ()
Defined at line 65 of file ../../src/developer/debug/debug_agent/debugged_process.h
NativeProcessHandle & handle ()
TODO(brettw) remove this and have all callers use thread_handle().
Defined at line 68 of file ../../src/developer/debug/debug_agent/debugged_process.h
const NativeProcessHandle & handle ()
Defined at line 69 of file ../../src/developer/debug/debug_agent/debugged_process.h
const ModuleList & module_list ()
Defined at line 71 of file ../../src/developer/debug/debug_agent/debugged_process.h
void DebuggedProcess (DebugAgent * )
Caller must call Init after construction.
Defined at line 90 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void ~DebuggedProcess ()
Defined at line 92 of file ../../src/developer/debug/debug_agent/debugged_process.cc
debug::Status Init (DebuggedProcessCreateInfo create_info)
The object is not usable if |Init| is not called or fails.
Defined at line 135 of file ../../src/developer/debug/debug_agent/debugged_process.cc
debug::Status AttachNow ()
After a process has been initialized, but hasn't bound this object to the process' exception
channel (i.e. initialized with |deferred_attach| set to true), use this to attach.
Defined at line 186 of file ../../src/developer/debug/debug_agent/debugged_process.cc
const std::deque<StepOverTicket> & step_over_queue ()
Defined at line 189 of file ../../src/developer/debug/debug_agent/debugged_process.h
const std::map<uint64_t, std::unique_ptr<SoftwareBreakpoint>> & software_breakpoints ()
Defined at line 191 of file ../../src/developer/debug/debug_agent/debugged_process.h
bool IsAttached ()
Defined at line 193 of file ../../src/developer/debug/debug_agent/debugged_process.cc
const std::map<uint64_t, std::unique_ptr<HardwareBreakpoint>> & hardware_breakpoints ()
Defined at line 195 of file ../../src/developer/debug/debug_agent/debugged_process.h
const WatchpointMap & watchpoints ()
Defined at line 199 of file ../../src/developer/debug/debug_agent/debugged_process.h
bool from_limbo ()
Defined at line 201 of file ../../src/developer/debug/debug_agent/debugged_process.h
void SetStdout (OwnedStdioHandle handle)
Defined at line 692 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void SetStdout (OwnedStdioHandle handle)
Defined at line 692 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void SetStderr (OwnedStdioHandle handle)
Defined at line 704 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void SetStderr (OwnedStdioHandle handle)
Defined at line 704 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnResume (const debug_ipc::ResumeRequest & request)
IPC handlers.
Defined at line 200 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnReadMemory (const debug_ipc::ReadMemoryRequest & request, debug_ipc::ReadMemoryReply * reply)
Defined at line 227 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnKill (const debug_ipc::KillRequest & request, debug_ipc::KillReply * reply)
Defined at line 245 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnAddressSpace (const debug_ipc::AddressSpaceRequest & request, debug_ipc::AddressSpaceReply * reply)
Defined at line 611 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnModules (debug_ipc::ModulesReply * reply)
Defined at line 616 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnWriteMemory (const debug_ipc::WriteMemoryRequest & request, debug_ipc::WriteMemoryReply * reply)
Defined at line 626 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnLoadInfoHandleTable (const debug_ipc::LoadInfoHandleTableRequest & request, debug_ipc::LoadInfoHandleTableReply * reply)
Defined at line 644 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnSaveMinidump (const debug_ipc::SaveMinidumpRequest & request, debug_ipc::SaveMinidumpReply * reply)
Defined at line 258 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void InjectThreadForTest (std::unique_ptr<DebuggedThread> thread)
Defined at line 656 of file ../../src/developer/debug/debug_agent/debugged_process.cc
std::vector<debug_ipc::ProcessThreadId> ClientSuspendAllThreads (zx_koid_t except_thread)
Synchronously pauses all threads in the process from the perspective of the client. This issues
ClientSuspend() on all threads (see that for more on what "client" means).
The except_thread can be passed which indicates a thread to ship when suspending. This is for
certain operations that want to do something to all other threads.
The affected threads are returned. If a thread is already in a client suspend, it will not be
affected and it will not be returned in the result.
Defined at line 661 of file ../../src/developer/debug/debug_agent/debugged_process.cc
DebuggedThread * GetThread (zx_koid_t thread_koid)
Returns the thread or null if there is no known thread for this koid.
Defined at line 263 of file ../../src/developer/debug/debug_agent/debugged_process.cc
std::vector<DebuggedThread *> GetThreads ()
Defined at line 270 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void PopulateCurrentThreads ()
Populates the thread map with the current threads for this process.
This function does not notify the client of thread start, but rather updates the internal
thread state according to the underlying zircon truth.
Defined at line 278 of file ../../src/developer/debug/debug_agent/debugged_process.cc
std::vector<debug_ipc::ThreadRecord> GetThreadRecords ()
Returns the information for all current threads. This gets minimal stacks.
Defined at line 294 of file ../../src/developer/debug/debug_agent/debugged_process.cc
bool HandleLoaderBreakpoint (uint64_t address)
Checks if a breakpoint at the given address is the loader's internal one.
If it is, handles it and returns true. If it's not, does nothing and returns false.
Defined at line 301 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void SuspendAndSendModules ()
Suspend all thread and send the module list. This does not refresh the module list.
The client expects the threads to be suspended so it can resolve breakpoints and resume them.
Defined at line 317 of file ../../src/developer/debug/debug_agent/debugged_process.cc
SoftwareBreakpoint * FindSoftwareBreakpoint (uint64_t address)
Looks for breakpoints at the given address. Null if no breakpoints are at that address.
Defined at line 334 of file ../../src/developer/debug/debug_agent/debugged_process.cc
HardwareBreakpoint * FindHardwareBreakpoint (uint64_t address)
Defined at line 341 of file ../../src/developer/debug/debug_agent/debugged_process.cc
Watchpoint * FindWatchpoint (const debug::AddressRange & )
Defined at line 348 of file ../../src/developer/debug/debug_agent/debugged_process.cc
debug::Status RegisterBreakpoint (Breakpoint * bp, uint64_t address)
Defined at line 361 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void UnregisterBreakpoint (Breakpoint * bp, uint64_t address)
Defined at line 382 of file ../../src/developer/debug/debug_agent/debugged_process.cc
debug::Status RegisterWatchpoint (Breakpoint * bp, const debug::AddressRange & range)
Defined at line 403 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void UnregisterWatchpoint (Breakpoint * bp, const debug::AddressRange & range)
Defined at line 431 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void EnqueueStepOver (ProcessBreakpoint * process_breakpoint, DebuggedThread * thread)
Each time a thread attempts to step over a breakpoint, the breakpoint will enqueue itself and
the thread into the step over queue. The step over queue is used so that there is only one
breakpoint being stepped over at a time.
Enqueuing the breakpoint does not mean that the step over begins immediately, but rather the
process will call the |ExecuteStepOver| method on the breakpoint once its turn has come up in
the queue.
In some error cases this might happen twice for the same thread. For example, if there is an
error clearing the breakpoint instruction, attempting to clear it and then single-step it will
just hit the same breakpoint again and the "step over" will never complete.
If this happens the original "step over" request will be silently dropped. Otherwise, the
step queue will be recursively waiting for itself and can never continue. All other breakpoints
will still be waiting behind this failed step, but at least it could theoretically continue if
the breakpoint clearing works in a future try.
Defined at line 451 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnBreakpointFinishedSteppingOver ()
Called by the currently stepping over breakpoint when it's done. It will execute the next
enqueued breakpoint. If there are no more breakpoints enqueued, this will let all the
breakpoints know so that it can resume the stepped over threads.
Defined at line 474 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void DetachFromProcess ()
This function will gracefully detach from the underlying zircon process.
Detaching correctly requires several steps:
1. Remove the installed breakpoints.
2. Resume threads from the exception. Only threads that are stopped on an
exception should be resumed. This is because otherwise zircon will treat
this exception as unhandled and will bubble up the exception upwards,
probably resulting in a crash.
3. Unbind the exception port.
Defined at line 98 of file ../../src/developer/debug/debug_agent/debugged_process.cc
Protected Methods
void OnProcessTerminated ()
ProcessHandleObserver implementation.
These are protected so that they can be called from MockProcess. In normal operation these are
called by the ProcessHandle implementation, but we don't want to have to construct fake
instances of platform specific exception objects when we can just use our own abstractions
here. This provides a simpler interface for testing the higher level objects without exposing
the API outside of tests.
Defined at line 503 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnThreadStarting (std::unique_ptr<ExceptionHandle> exception)
Defined at line 516 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnThreadExiting (std::unique_ptr<ExceptionHandle> exception)
Defined at line 544 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnException (std::unique_ptr<ExceptionHandle> exception)
Defined at line 568 of file ../../src/developer/debug/debug_agent/debugged_process.cc
void OnProcessStarting (std::unique_ptr<ProcessHandle> new_process_handle)
Defined at line 590 of file ../../src/developer/debug/debug_agent/debugged_process.cc