class Session

Defined at line 65 of file ../../src/developer/debug/zxdb/client/session.h

The session object manages the connection with the remote debug agent.

Protected Members

ObserverList observers_

Public Methods

fxl::WeakPtr<Session> GetWeakPtr ()

Defined at line 81 of file ../../src/developer/debug/zxdb/client/session.h

RemoteAPI * remote_api ()

The RempteAPI for sending messages to the debug_agent.

Defined at line 84 of file ../../src/developer/debug/zxdb/client/session.h

uint32_t ipc_version ()

Defined at line 85 of file ../../src/developer/debug/zxdb/client/session.h

void AddObserver (SessionObserver * observer)

Defined at line 87 of file ../../src/developer/debug/zxdb/client/session.h

void RemoveObserver (SessionObserver * observer)

Defined at line 88 of file ../../src/developer/debug/zxdb/client/session.h

void AddBreakpointObserver (BreakpointObserver * observer)

Defined at line 90 of file ../../src/developer/debug/zxdb/client/session.h

void RemoveBreakpointObserver (BreakpointObserver * observer)

Defined at line 93 of file ../../src/developer/debug/zxdb/client/session.h

void AddDownloadObserver (DownloadObserver * observer)

Defined at line 97 of file ../../src/developer/debug/zxdb/client/session.h

void RemoveDownloadObserver (DownloadObserver * observer)

Defined at line 100 of file ../../src/developer/debug/zxdb/client/session.h

void AddProcessObserver (ProcessObserver * observer)

Defined at line 103 of file ../../src/developer/debug/zxdb/client/session.h

void RemoveProcessObserver (ProcessObserver * observer)

Defined at line 104 of file ../../src/developer/debug/zxdb/client/session.h

bool is_minidump ()

Returns information about whether this session is connected to a minidump instead of a live

system.

Defined at line 110 of file ../../src/developer/debug/zxdb/client/session.h

bool IsConnected ()

Returns true if there is currently a connection.

Defined at line 117 of file ../../src/developer/debug/zxdb/client/session.h

bool HasPendingConnection ()

Returns whether a connection is pending.

Defined at line 120 of file ../../src/developer/debug/zxdb/client/session.h

Err last_connection_error ()

Returns the last connection error.

Defined at line 123 of file ../../src/developer/debug/zxdb/client/session.h

const std::string minidump_path ()

Information about the current connection.

Defined at line 126 of file ../../src/developer/debug/zxdb/client/session.h

const std::string connected_host ()

Defined at line 127 of file ../../src/developer/debug/zxdb/client/session.h

uint16_t connected_port ()

Defined at line 128 of file ../../src/developer/debug/zxdb/client/session.h

System & system ()

Access to the singleton corresponding to the debugged system.

Defined at line 151 of file ../../src/developer/debug/zxdb/client/session.h

debug::Arch arch ()

Platform/architecture of the attached system. Will be "kUnknown" when not connected.

Defined at line 154 of file ../../src/developer/debug/zxdb/client/session.h

debug::Platform platform ()

Defined at line 155 of file ../../src/developer/debug/zxdb/client/session.h

const ArchInfo & arch_info ()

Architecture information of the attached system.

Defined at line 158 of file ../../src/developer/debug/zxdb/client/session.h

fxl::ObserverList<TargetObserver> & target_observers ()

Observer list getters.

Defined at line 161 of file ../../src/developer/debug/zxdb/client/session.h

fxl::ObserverList<ProcessObserver> & process_observers ()

Defined at line 162 of file ../../src/developer/debug/zxdb/client/session.h

fxl::ObserverList<ThreadObserver> & thread_observers ()

Defined at line 163 of file ../../src/developer/debug/zxdb/client/session.h

fxl::ObserverList<BreakpointObserver> & breakpoint_observers ()

Defined at line 164 of file ../../src/developer/debug/zxdb/client/session.h

fxl::ObserverList<DownloadObserver> & download_observers ()

Defined at line 165 of file ../../src/developer/debug/zxdb/client/session.h

fxl::ObserverList<ComponentObserver> & component_observers ()

Defined at line 166 of file ../../src/developer/debug/zxdb/client/session.h

void set_stream (debug::StreamBuffer * stream)

For test purposes, so that the Session appears to be connected.

Defined at line 218 of file ../../src/developer/debug/zxdb/client/session.h

AnalyticsReporter & analytics ()

Defined at line 220 of file ../../src/developer/debug/zxdb/client/session.h

void Session ()

Creates a session with no connection. All sending will fail until the callback associated with

a Connect() call is issued.

Defined at line 290 of file ../../src/developer/debug/zxdb/client/session.cc

void Session (std::unique_ptr<RemoteAPI> remote_api, debug::Arch arch, debug::Platform platform, uint64_t page_size)

Creates a session using a custom RemoteAPI implementation. Use for tests to mock out sending

IPC messages.

Defined at line 297 of file ../../src/developer/debug/zxdb/client/session.cc

void Session (debug::StreamBuffer * stream)

Creates with a previously-allocated local connection. The pointer must outlive this class. In

this mode, the stream can not be disconnected.

Defined at line 306 of file ../../src/developer/debug/zxdb/client/session.cc

void ~Session ()

Defined at line 319 of file ../../src/developer/debug/zxdb/client/session.cc

void OnStreamReadable ()

Notification about the stream.

Defined at line 325 of file ../../src/developer/debug/zxdb/client/session.cc

void OnStreamError ()

Defined at line 385 of file ../../src/developer/debug/zxdb/client/session.cc

void Connect (const SessionConnectionInfo & info, fit::callback<void (const Err &)> cb)

Call with an empty host and 0 port to reconnect to the last attempted connection destination.

If there is no previous destination, this will be issue an error.

Defined at line 421 of file ../../src/developer/debug/zxdb/client/session.cc

Err Disconnect ()

Synchronously disconnects from the remote system. Calling when there is no connection will

return an error.

This can also be called when a connection is pending (Connect() has been called but the

callback has not been issued yet) which will cancel the pending connection. The Connect()

callback will still be issued but will indicate failure.

Defined at line 507 of file ../../src/developer/debug/zxdb/client/session.cc

void OpenMinidump (const std::string & path, fit::callback<void (const Err &)> callback)

Open a minidump instead of connecting to a running system. The callback will be issued with an

error if the file cannot be opened or if there is already a connection.

Defined at line 473 of file ../../src/developer/debug/zxdb/client/session.cc

bool ClearConnectionData ()

Frees all connection-related data. A helper for different modes of cleanup. Returns true if

there was a connection to clear.

Defined at line 533 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyThreadStarting (const debug_ipc::NotifyThreadStarting & notify)

Dispatches these particular notification types from the agent. These are public since tests

will commonly want to synthesize these events.

Note on DispatchNotifyException: Test code can skip setting the metadata by clearing the

set_metadata flag. This allows them to set up the thread's state manually before issuing an

exception. Production code should always set the set_metadata flag to populate the thread's

state from the data in the exception.

Defined at line 547 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyThreadExiting (const debug_ipc::NotifyThreadExiting & notify)

Defined at line 559 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyException (const debug_ipc::NotifyException & notify, bool set_metadata)

This is the main entrypoint for all thread stops notifications in the client.

Defined at line 644 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyModules (const debug_ipc::NotifyModules & notify)

Defined at line 698 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyProcessStarting (const debug_ipc::NotifyProcessStarting & notify)

Defined at line 708 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyProcessExiting (const debug_ipc::NotifyProcessExiting & notify)

Defined at line 752 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyIO (const debug_ipc::NotifyIO & notify)

Defined at line 757 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyLog (const debug_ipc::NotifyLog & notify)

Defined at line 766 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyComponentDiscovered (const debug_ipc::NotifyComponentDiscovered & notify)

Defined at line 790 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyComponentStarting (const debug_ipc::NotifyComponentStarting & notify)

Defined at line 801 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyComponentExiting (const debug_ipc::NotifyComponentExiting & notify)

Defined at line 816 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyTestExited (const debug_ipc::NotifyTestExited & notify)

Defined at line 822 of file ../../src/developer/debug/zxdb/client/session.cc

void DispatchNotifyFilterCreated (const debug_ipc::NotifyFilterCreated & notify)

Defined at line 828 of file ../../src/developer/debug/zxdb/client/session.cc

void HandleException (ThreadImpl * thread, const debug_ipc::NotifyException & notify, HandleExceptionSettings settings)

Defined at line 571 of file ../../src/developer/debug/zxdb/client/session.cc

void OnSettingChanged (const SettingStore & , const std::string & setting_name)

SettingStoreObserver

Defined at line 1000 of file ../../src/developer/debug/zxdb/client/session.cc

Records

Friends

class RemoteAPITest
class RemoteAPIImpl
class PendingConnection