package debugger

Import Path
	github.com/pancsta/asyncmachine-go/tools/debugger (on go.dev)

Dependency Relation
	imports 44 packages, and imported by 5 packages

Involved Source Files client_list.go Package debugger provides a TUI debugger with multi-client support. Runnable command can be found in tools/cmd/am-dbg. handlers.go keyboard.go log.go misc_dbg.go tree.go ui.go utils.go
Package-Level Type Names (total 8)
/* sort by: | */
Client *server.Client Client.ConnId string Client.Connected atomic.Bool indexes of txs with errors, desc order for bisects TOOD refresh on GC bits which get saved into the go file TODO refac to MsgSchema TODO version schemas Client.Exportable.MsgTxs []*telemetry.DbgMsgTx Client.Id string cache of processed log entries Client.MTimeSum uint64 Client.MsgSchemaParsed *types.MsgSchemaParsed processed list of filtered tx _indexes_ processed Client.SchemaHash string Client.SelectedGroup string CursorStep1 int CursorTx1 int extracted log entries per tx ID TODO GC when all entries are closedAt and the first client's tx is later than the latest closedAt; whole tx needs to be disposed at the same time ReaderCollapsed bool SelectedReaderEntry *types.LogReaderEntryPtr SelectedState string (*Client) AddReaderEntry(txId string, entry *types.LogReaderEntry) int ( Client) ClearCache() ( Client) FilterIndexByCursor1(cursor1 int) int (*Client) GetReaderEntry(txId string, idx int) *types.LogReaderEntry ( Client) HadErrSinceTx(tx, distance int) bool ( Client) IndexesToStates(indexes []int) am.S ( Client) LastActive() time.Time ( Client) LastTxTill(hTime time.Time) int ( Client) ParseSchema() ( Client) StatesToIndexes(states am.S) []int ( Client) Tx(idx int) *telemetry.DbgMsgTx ( Client) TxByMachTime(sum uint64) int TxIndex returns the index of transition ID [id] or -1 if not found. ( Client) TxParsed(idx int) *types.MsgTxParsed func (*Debugger).Client() *Client
App *cview.Application selected client TODO atomic, drop eval Clients map[string]*Client ExceptionHandler *am.ExceptionHandler TODO GC removed machines HistoryCursor int LayoutRoot *cview.Panels Mach *am.Machine TODO make threadsafe printer for numbers TODO global (*Debugger) AddressFocusedEnd(_ *am.Event) (*Debugger) AddressFocusedState(e *am.Event) (*Debugger) AfterFocusEnter(e *am.Event) bool (*Debugger) AfterFocusState(e *am.Event) AnyEnter prevents most of mutations during a UI redraw (and vice versa) forceful race solving AnyState is a global final handler (*Debugger) BackEnter(e *am.Event) bool (*Debugger) BackState(e *am.Event) (*Debugger) BackStepEnter(_ *am.Event) bool (*Debugger) BackStepState(e *am.Event) (*Debugger) BuildingLogEnter(e *am.Event) bool (*Debugger) BuildingLogState(e *am.Event) Client returns the current Client. Thread safe via Eval(). (*Debugger) ClientListVisibleEnd(e *am.Event) (*Debugger) ClientListVisibleState(e *am.Event) (*Debugger) ClientMsgEnter(e *am.Event) bool (*Debugger) ClientMsgState(e *am.Event) (*Debugger) ClientSelectedEnd(e *am.Event) (*Debugger) ClientSelectedState(e *am.Event) (*Debugger) ConnectEventEnter(e *am.Event) bool (*Debugger) ConnectEventState(e *am.Event) CurrentTx returns the current transition. Thread safe via Eval(). (*Debugger) DiagramsReadyState(e *am.Event) (*Debugger) DiagramsRenderingEnter(e *am.Event) bool (*Debugger) DiagramsRenderingState(e *am.Event) (*Debugger) DiagramsScheduledEnter(e *am.Event) bool (*Debugger) DiagramsScheduledState(e *am.Event) (*Debugger) DisconnectEventEnter(e *am.Event) bool (*Debugger) DisconnectEventState(e *am.Event) (*Debugger) Dispose() (*Debugger) ExceptionEnter(e *am.Event) bool ExceptionState creates a log file with the error and stack trace, after calling the super exception handler. (*Debugger) ExportDialogEnd(e *am.Event) (*Debugger) ExportDialogState(_ *am.Event) (*Debugger) FilterCanceledTxEnd(e *am.Event) (*Debugger) FilterQueuedTxEnd(e *am.Event) (*Debugger) FwdEnter(e *am.Event) bool (*Debugger) FwdState(e *am.Event) (*Debugger) FwdStepEnter(_ *am.Event) bool (*Debugger) FwdStepState(_ *am.Event) (*Debugger) GcMsgsEnter(e *am.Event) bool (*Debugger) GcMsgsState(e *am.Event) (*Debugger) HeartbeatState(e *am.Event) (*Debugger) HelpDialogEnd(e *am.Event) (*Debugger) HelpDialogState(e *am.Event) (*Debugger) LogBuiltState(e *am.Event) (*Debugger) LogReaderVisibleEnd(e *am.Event) (*Debugger) LogReaderVisibleState(e *am.Event) (*Debugger) LogUpdatedState(e *am.Event) (*Debugger) MatrixRainEnter(e *am.Event) bool (*Debugger) MatrixRainSelectedState(e *am.Event) (*Debugger) MatrixRainState(_ *am.Event) (*Debugger) MatrixViewEnd(_ *am.Event) (*Debugger) MatrixViewState(_ *am.Event) (*Debugger) NarrowLayoutEnd(e *am.Event) (*Debugger) NarrowLayoutExit(e *am.Event) bool (*Debugger) NarrowLayoutState(e *am.Event) NextTx returns the next transition. Thread safe via Eval(). (*Debugger) PausedState(_ *am.Event) (*Debugger) PlayingEnd(_ *am.Event) (*Debugger) PlayingState(_ *am.Event) PrevTx returns the previous transition. Thread safe via Eval(). (*Debugger) ReadyEnd(_ *am.Event) (*Debugger) ReadyState(e *am.Event) (*Debugger) RedrawState(e *am.Event) (*Debugger) RemoveClientEnter(e *am.Event) bool (*Debugger) RemoveClientState(e *am.Event) (*Debugger) ResizedState(e *am.Event) ScrollToMutTxState scrolls to a transition which mutated the passed state, If fwd is true, it scrolls forward, otherwise backwards. (*Debugger) ScrollToStepEnter(e *am.Event) bool ScrollToStepState scrolls to a specific transition (cursor position 1-based). (*Debugger) ScrollToTxEnter(e *am.Event) bool ScrollToTxState scrolls to a specific transition (cursor position 1-based). (*Debugger) SelectingClientEnter(e *am.Event) bool (*Debugger) SelectingClientState(e *am.Event) (*Debugger) SetCursorEnter(e *am.Event) bool TODO remove? TODO state: SetOptsState (*Debugger) SetGroupEnter(e *am.Event) bool (*Debugger) SetGroupState(e *am.Event) TODO config param to New( (*Debugger) StartEnd(_ *am.Event) (*Debugger) StartState(e *am.Event) (*Debugger) StateNameSelectedEnd(_ *am.Event) (*Debugger) StateNameSelectedEnter(e *am.Event) bool (*Debugger) StateNameSelectedState(e *am.Event) (*Debugger) SwitchedClientTxState(_ *am.Event) (*Debugger) SwitchingClientTxState(e *am.Event) (*Debugger) TailModeEnd(_ *am.Event) (*Debugger) TailModeState(e *am.Event) (*Debugger) TimelineStepsFocusedEnd(_ *am.Event) (*Debugger) TimelineStepsFocusedState(_ *am.Event) (*Debugger) TimelineStepsHiddenEnd(e *am.Event) (*Debugger) TimelineStepsHiddenState(e *am.Event) (*Debugger) TimelineStepsScrolledEnd(_ *am.Event) (*Debugger) TimelineStepsScrolledState(_ *am.Event) (*Debugger) TimelineTxHiddenEnd(e *am.Event) (*Debugger) TimelineTxHiddenState(e *am.Event) (*Debugger) ToggleToolEnter(e *am.Event) bool (*Debugger) ToggleToolState(e *am.Event) (*Debugger) ToolRainState(e *am.Event) (*Debugger) ToolToggledState(e *am.Event) (*Debugger) Toolbar1FocusedEnd(_ *am.Event) (*Debugger) Toolbar1FocusedState(e *am.Event) (*Debugger) Toolbar2FocusedEnd(_ *am.Event) (*Debugger) Toolbar2FocusedState(e *am.Event) (*Debugger) Toolbar3FocusedEnd(_ *am.Event) (*Debugger) Toolbar3FocusedState(e *am.Event) (*Debugger) TreeGroupsFocusedEnd(_ *am.Event) (*Debugger) TreeGroupsFocusedState(e *am.Event) (*Debugger) TreeMatrixViewEnd(_ *am.Event) (*Debugger) TreeMatrixViewState(_ *am.Event) (*Debugger) UpdateFocusState(e *am.Event) (*Debugger) UpdateLogScheduledState(e *am.Event) UpdatingLogState decorates the rendered log, and rebuilds when needed. (*Debugger) UserBackState(_ *am.Event) (*Debugger) UserBackStepState(_ *am.Event) (*Debugger) UserFwdState(_ *am.Event) (*Debugger) UserFwdStepState(_ *am.Event) (*Debugger) WebReqState(e *am.Event) (*Debugger) WebSocketState(e *am.Event) func New(ctx context.Context, opts Opts) (*Debugger, error) func github.com/pancsta/asyncmachine-go/internal/testing.NewDbgWorker(realTty bool, opts Opts) (*Debugger, error) func RpcGetter(d *Debugger) func(string) any
Box *cview.Box Primitive cview.Primitive GetBackgroundColor returns the box's background color. GetBorder returns a value indicating whether the box have a border or not. GetBorderPadding returns the size of the padding around the box content. Deprecated: This function is provided for backwards compatibility. Developers should use GetPadding instead. GetDrawFunc returns the callback function which was installed with SetDrawFunc() or nil if no such function has been installed. GetInnerRect returns the position of the inner rectangle (x, y, width, height), without the border and without any padding. Width and height values will clamp to 0 and thus never be negative. GetInputCapture returns the function installed with SetInputCapture() or nil if no such function has been installed. GetMouseCapture returns the function installed with SetMouseCapture() or nil if no such function has been installed. GetPadding returns the size of the padding around the box content. GetTitle returns the box's current title. HasFocus returns whether or not this primitive has focus. InRect returns true if the given coordinate is within the bounds of the box's rectangle. SetBackgroundColor sets the box's background color. SetBackgroundTransparent sets the flag indicating whether or not the box's background is transparent. The screen is not cleared before drawing the application. Overlaying transparent widgets directly onto the screen may result in artifacts. To resolve this, add a blank, non-transparent Box to the bottom layer of the interface via Panels, or set a handler via SetBeforeDrawFunc which clears the screen. SetBorder sets the flag indicating whether or not the box should have a border. SetBorderAttributes sets the border's style attributes. You can combine different attributes using bitmask operations: box.SetBorderAttributes(tcell.AttrUnderline | tcell.AttrBold) SetBorderColor sets the box's border color. SetBorderColorFocused sets the box's border color when the box is focused. SetBorderPadding sets the size of the padding around the box content. Deprecated: This function is provided for backwards compatibility. Developers should use SetPadding instead. SetDrawFunc sets a callback function which is invoked after the box primitive has been drawn. This allows you to add a more individual style to the box (and all primitives which extend it). The function is provided with the box's dimensions (set via SetRect()). It must return the box's inner dimensions (x, y, width, height) which will be returned by GetInnerRect(), used by descendent primitives to draw their own content. SetInputCapture installs a function which captures key events before they are forwarded to the primitive's default key event handler. This function can then choose to forward that key event (or a different one) to the default handler by returning it. If nil is returned, the default handler will not be called. Providing a nil handler will remove a previously existing handler. Note that this function will not have an effect on primitives composed of other primitives, such as Form, Flex, or Grid. Key events are only captured by the primitives that have focus (e.g. InputField) and only one primitive can have focus at a time. Composing primitives such as Form pass the focus on to their contained primitives and thus never receive any key events themselves. Therefore, they cannot intercept key events. SetMouseCapture sets a function which captures mouse events (consisting of the original tcell mouse event and the semantic mouse action) before they are forwarded to the primitive's default mouse event handler. This function can then choose to forward that event (or a different one) by returning it or returning a nil mouse event, in which case the default handler will not be called. Providing a nil handler will remove a previously existing handler. SetPadding sets the size of the padding around the box content. SetTitle sets the box's title. SetTitleAlign sets the alignment of the title, one of AlignLeft, AlignCenter, or AlignRight. SetTitleColor sets the box's title color. ShowFocus sets the flag indicating whether or not the borders of this primitive should change thickness when focused. WrapInputHandler wraps an input handler (see InputHandler()) with the functionality to capture input (see SetInputCapture()) before passing it on to the provided (default) input handler. This is only meant to be used by subclassing primitives. WrapMouseHandler wraps a mouse event handler (see MouseHandler()) with the functionality to capture mouse events (see SetMouseCapture()) before passing them on to the provided (default) event handler. This is only meant to be used by subclassing primitives. Focusable : github.com/pancsta/cview.Focusable
AddrHttp string MachAddress to listen on CleanOnConnect bool Log level of the debugger's machine DbgLogger *log.Logger Go race detector is enabled EnableClipboard bool EnableMouse bool Filters for the transitions and logging Debugger's ID File path to import (brotli) Log2Ttl time.Duration MachUrl string MaxMemMb int File to dump client list into. OutputDiagrams is the details level of the current machine's diagram (0-3). 0 - off, 3 - most detailed Root dir for output files OutputTx bool Screen overload for tests & ssh SelectConnected bool ShowReader bool TailMode bool Timelines is the number of timelines to show (0-2). version of this instance ViewNarrow bool ViewRain bool func New(ctx context.Context, opts Opts) (*Debugger, error) func github.com/pancsta/asyncmachine-go/internal/testing.NewDbgWorker(realTty bool, opts Opts) (*Debugger, error)
LogLevel am.LogLevel SkipAutoCanceledTx bool SkipAutoTx bool SkipCanceledTx bool SkipChecks bool SkipEmptyTx bool SkipHealthTx bool SkipOutGroup bool SkipQueuedTx bool (*OptsFilters) Equal(filters *OptsFilters) bool func (*OptsFilters).Equal(filters *OptsFilters) bool
type RelCol (struct)
type S = am.S ([])
const ToolFilterTraces const ToolLogTimestamps
Package-Level Functions (total 3)
New creates a new debugger instance and optionally import a data file.
TODO migrate to Provide-Delivered
Package-Level Constants (total 4)
const DialogExport = "export"
const DialogHelp = "help"
const ToolFilterTraces ToolName = "hide-traces"
const ToolLogTimestamps ToolName = "hide-timestamps"