class Target

Defined at line 42 of file ../../src/developer/debug/zxdb/client/target.h

A Target represents the abstract idea of a process that can be debugged. This is as opposed to a

Process which corresponds to one running process.

Targets are not initially attached to Processes on the debugged device. There are multiple ways

of associating a Target with a Process.

If users want to start a new process on the debugged device, they set the breakpoints, process

name, command line switches, and other state in the Target. The user then runs the target, which

creates the associated Process object. When the process exits, the Target can be re-used to

launch the process again with the same configuration.

If users want to associate a Target with a process on the debugged device, they create a new

Target (possibly using System::CreateNewTarget), and then call Attach() to perform the

association.

Protected Members

MapSettingStore settings_

Public Methods

void ~Target ()

Defined at line 134 of file ../../src/developer/debug/zxdb/client/target.cc

fxl::WeakPtr<Target> GetWeakPtr ()

Defined at line 136 of file ../../src/developer/debug/zxdb/client/target.cc

State GetState ()

Returns the current process state.

Process * GetProcess ()

Returns the process object if it is currently running (see GetState()). Returns null otherwise.

const TargetSymbols * GetSymbols ()

Returns the process-independent symbol interface. See also Process:GetSymbols().

const std::vector<std::string> & GetArgs ()

Sets and retrieves the arguments passed to the program. args[0] is the program name, the rest

of the array are the command-line.

void SetArgs (std::vector<std::string> args)
void Launch (CallbackWithTimestamp callback)

Launches the program. The program must be in a kStopped state and the program name configured

via SetArgs().

void Kill (Callback callback)

Kills the process with the given koid. The callback will be executed when the kill is complete

(or fails).

void Attach (uint64_t koid, debug_ipc::AttachConfig config, CallbackWithTimestamp callback)

Attaches to the process with the given koid. The callback will be executed when the attach is

complete (or fails).

void Detach (Callback callback)

Detaches from the process with the given koid. The callback will be executed when the detach is

complete (or fails).

void OnProcessExiting (int return_code, uint64_t timestamp)

Notification from the agent that a process has exited.

void AssignPreviousConnectedProcess (const debug_ipc::ProcessRecord & record)

Use |record| to create a client-side process entry for an already attached process from

DebugAgent. This method assumes |record| is up to date, and therefore performs no IPC calls

until fetching modules for the created target and process(es).

MapSettingStore & settings ()

Defined at line 122 of file ../../src/developer/debug/zxdb/client/target.h

fxl::RefPtr<SettingSchema> GetSchema ()

Provides the setting schema for this object.

Defined at line 138 of file ../../src/developer/debug/zxdb/client/target.cc

Protected Methods

void Target (Session * session)

Target Implementation ---------------------------------------------------------------------------

Defined at line 128 of file ../../src/developer/debug/zxdb/client/target.cc

Enumerations

enum State
Name Value
kNone 0
kStarting 1
kAttaching 2
kRunning 3

Defined at line 50 of file ../../src/developer/debug/zxdb/client/target.h

enum AttachMode
Name Value
kStrong 0
kWeak 1

Defined at line 66 of file ../../src/developer/debug/zxdb/client/target.h