class ConsoleContext

Defined at line 45 of file ../../src/developer/debug/zxdb/console/console_context.h

The context for console commands. In a model-view-controller UI, this would

represent the state associated with the view and controller (depending on

how one splits things up). It keeps track of the currently selected

objects and watches for changes.

This class maintains the mapping between objects and IDs.

Public Methods

void ConsoleContext (Session * session)

Defined at line 51 of file ../../src/developer/debug/zxdb/console/console_context.cc

Session * session ()

Defined at line 58 of file ../../src/developer/debug/zxdb/console/console_context.h

const Session * session ()

Defined at line 59 of file ../../src/developer/debug/zxdb/console/console_context.h

void ~ConsoleContext ()

Defined at line 79 of file ../../src/developer/debug/zxdb/console/console_context.cc

int IdForTarget (const Target * target)

Returns the ID for the object. Asserts and returns 0 if not found.

Defined at line 92 of file ../../src/developer/debug/zxdb/console/console_context.cc

int IdForThread (const Thread * thread)

Defined at line 101 of file ../../src/developer/debug/zxdb/console/console_context.cc

int IdForFrame (const Frame * frame)

Defined at line 115 of file ../../src/developer/debug/zxdb/console/console_context.cc

const fxl::RefPtr<PrettyStackManager> & pretty_stack_manager ()

Returns the PrettyStackManager for this session.

This object is currently sitting on the ConsoleContext as a convenient place to hold the

singleton for the console frontend. Depending on how this evolve, it might be better to have

the client layer manage this object.

Defined at line 128 of file ../../src/developer/debug/zxdb/console/console_context.h

int IdForSymbolServer (const SymbolServer * symbol_server)

Defined at line 129 of file ../../src/developer/debug/zxdb/console/console_context.cc

const fxl::RefPtr<TestFailureStackMatcher> & test_failure_stack_matcher ()

Returns the TestFailureStackMatcher for this session.

Defined at line 131 of file ../../src/developer/debug/zxdb/console/console_context.h

int IdForBreakpoint (const Breakpoint * breakpoint)

Defined at line 138 of file ../../src/developer/debug/zxdb/console/console_context.cc

int IdForFilter (const Filter * filter)

Defined at line 151 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetActiveTarget (const Target * target)

The active target will always exist except during setup and teardown.

Defined at line 160 of file ../../src/developer/debug/zxdb/console/console_context.cc

int GetActiveTargetId ()

Defined at line 169 of file ../../src/developer/debug/zxdb/console/console_context.cc

Target * GetActiveTarget ()

Defined at line 171 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetActiveSymbolServer (const SymbolServer * target)

The active symbol server may or may not exist.

Defined at line 178 of file ../../src/developer/debug/zxdb/console/console_context.cc

int GetActiveSymbolServerId ()

Defined at line 187 of file ../../src/developer/debug/zxdb/console/console_context.cc

SymbolServer * GetActiveSymbolServer ()

Defined at line 189 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetActiveThreadForTarget (const Thread * thread)

The active thread for its target. The active target is not affected. The

active thread ID for a target not running will be 0.

Defined at line 196 of file ../../src/developer/debug/zxdb/console/console_context.cc

int GetActiveThreadIdForTarget (const Target * target)

Defined at line 209 of file ../../src/developer/debug/zxdb/console/console_context.cc

Thread * GetActiveThreadForTarget (const Target * target)

Defined at line 218 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetActiveFrameForThread (const Frame * frame)

Frames are a little bit different than threads and targets since they

have an intrinsic numbering supplied by the Thread object (the index into

the backtrace). If there are no frames on the thread, the return value

will be 0 (so the return value can't be blindly indexed into the frames

list).

Defined at line 231 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetActiveFrameIdForThread (const Thread * thread, int id)

Defined at line 240 of file ../../src/developer/debug/zxdb/console/console_context.cc

int GetActiveFrameIdForThread (const Thread * thread)

Defined at line 249 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetActiveBreakpoint (const Breakpoint * breakpoint)

Sets the active breakpoint. Can be null/0 if there is no active breakpoint

(set to null to clear).

Defined at line 263 of file ../../src/developer/debug/zxdb/console/console_context.cc

int GetActiveBreakpointId ()

Defined at line 269 of file ../../src/developer/debug/zxdb/console/console_context.cc

Breakpoint * GetActiveBreakpoint ()

Defined at line 271 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetActiveFilter (const Filter * filter)

Sets the active filter. Can be null/0 if there is no active filter (set to

null to clear).

Defined at line 282 of file ../../src/developer/debug/zxdb/console/console_context.cc

int GetActiveFilterId ()

Defined at line 288 of file ../../src/developer/debug/zxdb/console/console_context.cc

Filter * GetActiveFilter ()

Defined at line 290 of file ../../src/developer/debug/zxdb/console/console_context.cc

SourceAffinity GetSourceAffinityForThread (const Thread * thread)

Each thread maintains a source affinity which was the last command that

implies either source code or disassembly viewing. This is used to control

what gets displayed by default for the next stop of that thread. Defaults

to kSource for new and unknown threads. Setting SourceAffinity::kNone does

nothing so calling code can unconditionally call for all commands.

Defined at line 301 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetSourceAffinityForThread (const Thread * thread, SourceAffinity source_affinity)

Defined at line 308 of file ../../src/developer/debug/zxdb/console/console_context.cc

void ScheduleDisplayExpressions (Thread * thread)

Schedules evaluation and subsequent display of the "display" expressions. These are the things

printed out for every thread stop.

Defined at line 319 of file ../../src/developer/debug/zxdb/console/console_context.cc

Err FillOutCommand (Command * cmd)

Fills the current effective process, thread, etc. into the given Command

structure based on what the command specifies and the current context.

Returns an error if any of the referenced IDs are invalid.

Defined at line 344 of file ../../src/developer/debug/zxdb/console/console_context.cc

void InitConsoleMode ()

Defined at line 424 of file ../../src/developer/debug/zxdb/console/console_context.cc

std::string GetConsoleMode ()

Defined at line 380 of file ../../src/developer/debug/zxdb/console/console_context.cc

std::string GetEmbeddedModeContextOrDefault (std::optional<debug_ipc::ExceptionType> type)

Defined at line 384 of file ../../src/developer/debug/zxdb/console/console_context.cc

void SetConsoleMode (std::string mode)

Defined at line 398 of file ../../src/developer/debug/zxdb/console/console_context.cc

void MaybeReturnToEmbeddedMode (Process * process)

If the current console mode is EmbeddedInteractive, return to Embedded mode (i.e. disable input

and hide zxdb output). If the console mode is Shell, do nothing.

|process| may be a process that should be filtered from all running processes the frontend

knows about. This is because the notification we receive for a process that has been

detached/exited/killed/etc comes _before_ the process object is actually destructed. If null,

then the presence of any running process will keep interactive mode.

Defined at line 403 of file ../../src/developer/debug/zxdb/console/console_context.cc

void HandleNotification (NotificationType , const std::string & )

SessionObserver implementation:

Defined at line 447 of file ../../src/developer/debug/zxdb/console/console_context.cc

void HandlePreviousConnectedProcesses (const std::vector<debug_ipc::ProcessRecord> & )

Defined at line 471 of file ../../src/developer/debug/zxdb/console/console_context.cc

void HandleProcessesInLimbo (const std::vector<debug_ipc::ProcessRecord> & )

Defined at line 483 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidCreateBreakpoint (Breakpoint * breakpoint)

SystemObserver implementation:

Defined at line 500 of file ../../src/developer/debug/zxdb/console/console_context.cc

void WillDestroyBreakpoint (Breakpoint * breakpoint)

Defined at line 508 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidCreateFilter (Filter * filter)

Defined at line 524 of file ../../src/developer/debug/zxdb/console/console_context.cc

void WillDestroyFilter (Filter * filter)

Defined at line 532 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidCreateSymbolServer (SymbolServer * symbol_server)

Defined at line 546 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidCreateTarget (Target * target)

TargetObserver implementation:

Defined at line 558 of file ../../src/developer/debug/zxdb/console/console_context.cc

void WillDestroyTarget (Target * target)

Defined at line 574 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidCreateProcess (Process * process, uint64_t timestamp)

ProcessObserver implementation:

Defined at line 609 of file ../../src/developer/debug/zxdb/console/console_context.cc

void WillDestroyProcess (Process * process, DestroyReason reason, int exit_code, uint64_t timestamp)

Defined at line 654 of file ../../src/developer/debug/zxdb/console/console_context.cc

void WillLoadModuleSymbols (Process * process, int num_modules)

Defined at line 684 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidLoadAllModuleSymbols (Process * process)

Defined at line 636 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnSymbolLoadFailure (Process * process, const Err & err)

Defined at line 777 of file ../../src/developer/debug/zxdb/console/console_context.cc

void WillAutomaticallyContinue (debug_ipc::ResumeRequest::How how, const StopInfo & info)

Defined at line 781 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidCreateThread (Thread * thread)

ThreadObserver implementation:

Defined at line 727 of file ../../src/developer/debug/zxdb/console/console_context.cc

void WillDestroyThread (Thread * thread)

Defined at line 747 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnThreadStopped (Thread * thread, const StopInfo & info)

Defined at line 804 of file ../../src/developer/debug/zxdb/console/console_context.cc

void DidUpdateStackFrames (Thread * thread)

Defined at line 870 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnDownloadsStarted ()

DownloadObserver implementation:

Defined at line 890 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnDownloadsStopped (size_t success, size_t fail)

Defined at line 892 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnBreakpointMatched (Breakpoint * breakpoint, bool user_requested)

BreakpointObserver implementation.

Defined at line 945 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnBreakpointUpdateFailure (Breakpoint * breakpoint, const Err & err)

Defined at line 960 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnBreakpointImplicitUpdate (Breakpoint * breakpoint, BreakpointObserver::What what)

Defined at line 903 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnComponentStarted (const std::string & moniker, const std::string & url)

ComponentObserver implementation.

Defined at line 980 of file ../../src/developer/debug/zxdb/console/console_context.cc

void OnComponentExited (const std::string & moniker, const std::string & url)

Defined at line 989 of file ../../src/developer/debug/zxdb/console/console_context.cc

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

SettingStoreObserver implementation.

Defined at line 998 of file ../../src/developer/debug/zxdb/console/console_context.cc