|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Top-level dialog hosting the Lua debugger UI components. More...
#include <lua_debugger_dialog.h>
Public Slots | |
| void | onCodeViewContextMenu (const QPoint &pos) |
| Build and show the editor context menu (right-click in a code tab). Routed through Qt's signal/slot mechanism, so it must be visible from connect() sites in the code-tabs controller. | |
| void | handleEscapeKey () |
| Escape: hide inline find/go accordions if shown, else close dialog. Invoked from the script editor because keys often go to the viewport, not the top-level dialog event filter. | |
| void | runToCurrentLineInPausedEditor (LuaDebuggerCodeView *codeView, qint32 line) |
| Run-to-line dispatch from the focused paused editor. Public so LuaDebuggerKeyRouter can fire it from the dialog's event filter without reaching into private members. Same entry point used by the gutter context menu's "Run to Line". | |
| void | handleEscapeKey () |
| Escape: hide inline find/go accordions if shown, else close dialog. Invoked from the script editor because keys often go to the viewport, not the top-level dialog event filter. | |
Public Member Functions | |
| LuaDebuggerDialog (QWidget *parent=nullptr) | |
| Construct the dialog and initialize all child widgets. | |
| ~LuaDebuggerDialog () | |
| Destroy the dialog and disconnect debugger callbacks. | |
| void | handlePause (const char *file_path, int64_t line) |
| React to the debugger pausing execution at a breakpoint. | |
| void | reject () override |
| Close from Esc or programmatic reject(); queues close() so closeEvent() runs (unsaved-scripts prompt matches the window close button). The base QDialog::reject() hides via done() and skips closeEvent(); synchronous close() from Esc can fail to close. | |
| void | addWatchFromSpec (const QString &watchSpec) |
| Add a watch from an expression/path spec without opening the inline editor. Convenience used by the editor right-click menu and by the Variables panel context menu. | |
| LuaDebuggerChangeHighlightTracker & | changeHighlight () |
| Borrowed reference to the change-highlight tracker. Used by controllers that compute "changed since last pause" cues without having to friend the dialog. | |
| LuaDebuggerStackController & | stackController () |
| Borrowed reference to the stack controller. Used by Watch / Variables / Eval to read the currently inspected stack frame without friending the dialog. | |
| bool | isDebuggerPaused () const |
True while the dialog is in a pause-entry / nested event-loop UI. Mirrors the C side's wslua_debugger_is_paused on most paths but is updated from a different code path; controllers that need the Qt-side flag read it via this accessor. | |
| bool | changeHighlightAllowed () const |
| Combined "is the change-highlight cue allowed for paint this
pass?" gate. Reads the tracker policy with the active stack selection level; centralised here so callers do not have to thread the level themselves. | |
| void | applyChangedVisuals (QStandardItem *valueCell, bool changed) |
Stamp valueCell with the change-highlight visuals; the dialog supplies itself as the timer owner so the one-shot row flash gets cleaned up if the dialog is destroyed. | |
| QKeySequence | addWatchShortcut () const |
| Shortcut bound to the Add Watch toolbar action. Watch / Variables context menus mirror it on their "Add Watch" entries. | |
| QString | pausedFile () const |
| Source file path (normalized) of the line the debugger is paused on; empty when not paused. Paired with pausedLine. | |
| qlonglong | pausedLine () const |
| Line number of the pause; zero when the debugger is not paused. Paired with pausedFile. | |
| QCheckBox * | enabledToggle () |
| Borrowed reference to the toggle that mirrors the core's enable/disable state; the reload coordinator round-trips it across a forced-on reload. | |
| QString | normalizedFilePath (const QString &file_path) const |
| Normalize a path by trimming prefixes and resolving symbolic components. Public so controllers and the capture-suppression helper can canonicalise paths without friending the dialog. | |
| void | refreshDebuggerStateUi () |
| Refresh checkbox sync + all debugger state chrome/widgets. | |
| void | updateWidgets () |
| Update all widgets based on the current debugger state. | |
| void | ensureDebuggerEnabledForActiveBreakpoints () |
| Enable the debugger if any active breakpoint requires it. | |
| void | refreshVariablesForCurrentStackFrame () |
| Rebuild the variables tree after the stack frame for inspection changed. | |
| void | syncVariablesTreeToCurrentWatch () |
| Select the Variables row matching the current Watch row, or clear the Variables selection when no match exists. | |
| void | updateLuaEditorAuxFrames () |
| Point find / goto bars at the active code tab. | |
| void | updatePausedErrorFrame () |
| Populate/hide the inline error frame for paused break-on-error states. | |
| void | scheduleErrorFrameHide (int delayMs) |
| Schedule a delayed hide to avoid hide/show flicker on rapid re-pauses. | |
| void | cancelErrorFrameHide () |
| Cancel any pending delayed hide token. | |
| void | updateContinueActionState () |
| Enable or disable the Continue action based on debugger state. | |
| void | clearPausedStateUi () |
| Remove paused-state UI artifacts like stacks and highlights. | |
| void | setSaveActionEnabled (bool enabled) |
Toggle the toolbar Save Script action's enabled state. Surfaced as a typed setter so the code-tabs controller does not need to reach into the dialog's QAction members. | |
| bool | tearDownPauseLoopForReload () |
Tear down an active pause loop because the Lua engine is about to be reloaded under us. Returns true if a pause loop was active (the caller may need to defer follow-up work to the post-reload phase). Unlike resumeDebuggerAndExitLoop, the engine is NOT signalled to continue; the reload owns restarting the VM. | |
| LuaDebuggerDialog (QWidget *parent=nullptr) | |
| Construct the dialog and initialize all child widgets. | |
| ~LuaDebuggerDialog () | |
| Destroy the dialog and disconnect debugger callbacks. | |
| void | handlePause (const char *file_path, int64_t line) |
| React to the debugger pausing execution at a breakpoint. | |
| bool | ensureFileTreeEntry (const QString &file_path) |
| Ensure the hierarchical file tree contains the supplied script path. | |
| void | reject () override |
| Close from Esc or programmatic reject(); queues close() so closeEvent() runs (unsaved-scripts prompt matches the window close button). The base QDialog::reject() hides via done() and skips closeEvent(); synchronous close() from Esc can fail to close. | |
Controller accessors | |
Borrowed references to the dialog's per-panel controllers. Returned by reference because the controllers are direct (non-pointer) members of the dialog and have the same lifetime as the dialog itself. Callers must not store these references past the dialog's destruction. | |
| LuaDebuggerVariablesController & | variablesController () |
| Gets the variables controller. | |
| LuaDebuggerCodeTabsController & | codeTabsController () |
| Gets the code tabs controller. | |
| LuaDebuggerFilesController & | filesController () |
| Gets the files controller. | |
| LuaDebuggerWatchController & | watchController () |
| Gets the watch controller. | |
| LuaDebuggerBreakpointsController & | breakpointsController () |
| Gets the breakpoints controller. | |
| LuaDebuggerPauseController & | pauseController () |
| Gets the pause controller. | |
| LuaDebuggerLuaReloadCoordinator & | reloadCoordinator () |
| Gets the Lua reload coordinator. | |
| LuaDebuggerEvalController & | evalController () |
| Gets the evaluation controller. | |
| LuaDebuggerFontPolicy & | fontPolicy () |
| Gets the font policy. | |
Public Member Functions inherited from GeometryStateDialog | |
| GeometryStateDialog (QWidget *parent, Qt::WindowFlags f=Qt::Window) | |
| Constructs a new GeometryStateDialog with the specified parent and window flags. | |
| ~GeometryStateDialog () | |
| Save the geometry and splitter state and then destroy the GeometryStateDialog. | |
| void | setWindowModality (Qt::WindowModality windowModality) |
| Sets the window modality for the dialog. On non-macOS platforms, this also sets the parent to ensure modal dialogs are always on top of their parent. | |
Static Public Member Functions | |
| static int32_t | currentTheme () |
| Get the current theme setting. | |
| static LuaDebuggerDialog * | instance (QWidget *parent=nullptr) |
| Retrieve the singleton instance, creating it if needed. | |
| static LuaDebuggerDialog * | instanceIfExists () |
Like instance but never creates the dialog; returns nullptr when no instance exists yet. Used by helpers that may run before the dialog has ever been opened. | |
| static bool | handleMainCloseIfPaused (QCloseEvent *event) |
If the debugger is paused or owns unsaved scripts, defer the supplied main-window close event so the Lua C stack can unwind first; otherwise return false and let the main window close normally. | |
| static int32_t | currentTheme () |
| Get the current theme setting. | |
| static LuaDebuggerDialog * | instance (QWidget *parent=nullptr) |
| Retrieve the singleton instance, creating it if needed. | |
Protected Member Functions | |
| void | closeEvent (QCloseEvent *event) override |
| Flush state and resume execution when the dialog closes. | |
| void | showEvent (QShowEvent *event) override |
| Handle widget show events. | |
| bool | event (QEvent *event) override |
| Handle general events. | |
| bool | eventFilter (QObject *obj, QEvent *event) override |
| Filter events for child objects to intercept shortcuts. | |
| void | childEvent (QChildEvent *event) override |
| Handle child widget events. | |
| void | closeEvent (QCloseEvent *event) override |
| Flush state and resume execution when the dialog closes. | |
| bool | eventFilter (QObject *obj, QEvent *event) override |
| void | childEvent (QChildEvent *event) override |
Protected Member Functions inherited from GeometryStateDialog | |
| void | loadGeometry (int width=0, int height=0, const QString &dialog_name=QString()) |
| Loads the geometry and splitter state for the dialog. | |
| void | loadSplitterState (QSplitter *splitter=nullptr) |
| Loads the state of a splitter for the dialog. | |
Top-level dialog hosting the Lua debugger UI components.
|
explicit |
Construct the dialog and initialize all child widgets.
| parent | Optional parent widget used for ownership and stacking. |
|
explicit |
Construct the dialog and initialize all child widgets.
| parent | Optional parent widget used for ownership and stacking. |
| void LuaDebuggerDialog::addWatchFromSpec | ( | const QString & | watchSpec | ) |
Add a watch from an expression/path spec without opening the inline editor. Convenience used by the editor right-click menu and by the Variables panel context menu.
| watchSpec | The watch specification string. |
| QKeySequence LuaDebuggerDialog::addWatchShortcut | ( | ) | const |
Shortcut bound to the Add Watch toolbar action. Watch / Variables context menus mirror it on their "Add Watch" entries.
|
inline |
Stamp valueCell with the change-highlight visuals; the dialog supplies itself as the timer owner so the one-shot row flash gets cleaned up if the dialog is destroyed.
| valueCell | The cell to apply visuals to. |
| changed | True to show as changed, false otherwise. |
|
inline |
Gets the breakpoints controller.
|
inline |
Borrowed reference to the change-highlight tracker. Used by controllers that compute "changed since last pause" cues without having to friend the dialog.
|
inline |
Combined "is the change-highlight cue allowed for paint this pass?" gate. Reads the tracker policy with the active stack selection level; centralised here so callers do not have to thread the level themselves.
|
overrideprotected |
Handle child widget events.
| event | The child event. |
|
overrideprotected |
Flush state and resume execution when the dialog closes.
| event | Close request metadata from Qt. |
|
overrideprotected |
Flush state and resume execution when the dialog closes.
| event | Close request metadata from Qt. |
|
inline |
Gets the code tabs controller.
|
static |
Get the current theme setting.
|
static |
Get the current theme setting.
|
inline |
Borrowed reference to the toggle that mirrors the core's enable/disable state; the reload coordinator round-trips it across a forced-on reload.
| bool LuaDebuggerDialog::ensureFileTreeEntry | ( | const QString & | file_path | ) |
Ensure the hierarchical file tree contains the supplied script path.
This is public because it is called from a C callback that iterates loaded Lua scripts.
| file_path | Path to split and insert. |
|
inline |
Gets the evaluation controller.
|
overrideprotected |
Handle general events.
| event | The event. |
|
overrideprotected |
Filter events for child objects to intercept shortcuts.
| obj | The child object. |
| event | The event. |
|
inline |
Gets the files controller.
|
inline |
Gets the font policy.
|
static |
If the debugger is paused or owns unsaved scripts, defer the supplied main-window close event so the Lua C stack can unwind first; otherwise return false and let the main window close normally.
Called from WiresharkMainWindow::closeEvent / StratosharkMainWindow::closeEvent through LuaDebugger::tryDeferMainWindowClose.
| event | The close event from the main window. |
true if the close has been deferred (the caller MUST treat the event as ignored and return without closing); false to let the main window close normally. | void LuaDebuggerDialog::handlePause | ( | const char * | file_path, |
| int64_t | line | ||
| ) |
React to the debugger pausing execution at a breakpoint.
| file_path | Path of the Lua file that triggered the pause. |
| line | Line number where execution stopped. |
| void LuaDebuggerDialog::handlePause | ( | const char * | file_path, |
| int64_t | line | ||
| ) |
React to the debugger pausing execution at a breakpoint.
| file_path | Path of the Lua file that triggered the pause. |
| line | Line number where execution stopped. |
|
static |
Retrieve the singleton instance, creating it if needed.
| parent | Optional parent widget supplied when instantiating. |
|
static |
Retrieve the singleton instance, creating it if needed.
| parent | Optional parent widget supplied when instantiating. |
|
static |
Like instance but never creates the dialog; returns nullptr when no instance exists yet. Used by helpers that may run before the dialog has ever been opened.
|
inline |
True while the dialog is in a pause-entry / nested event-loop UI. Mirrors the C side's wslua_debugger_is_paused on most paths but is updated from a different code path; controllers that need the Qt-side flag read it via this accessor.
| QString LuaDebuggerDialog::normalizedFilePath | ( | const QString & | file_path | ) | const |
Normalize a path by trimming prefixes and resolving symbolic components. Public so controllers and the capture-suppression helper can canonicalise paths without friending the dialog.
| file_path | The path to normalize. |
|
slot |
Build and show the editor context menu (right-click in a code tab). Routed through Qt's signal/slot mechanism, so it must be visible from connect() sites in the code-tabs controller.
| pos | The position to show the menu. |
|
inline |
Gets the pause controller.
|
inline |
Source file path (normalized) of the line the debugger is paused on; empty when not paused. Paired with pausedLine.
|
inline |
Line number of the pause; zero when the debugger is not paused. Paired with pausedFile.
|
inline |
Gets the Lua reload coordinator.
|
slot |
Run-to-line dispatch from the focused paused editor. Public so LuaDebuggerKeyRouter can fire it from the dialog's event filter without reaching into private members. Same entry point used by the gutter context menu's "Run to Line".
| codeView | The code view initiating the run. |
| line | The target line number. |
| void LuaDebuggerDialog::scheduleErrorFrameHide | ( | int | delayMs | ) |
Schedule a delayed hide to avoid hide/show flicker on rapid re-pauses.
| delayMs | Delay in milliseconds before hiding. |
| void LuaDebuggerDialog::setSaveActionEnabled | ( | bool | enabled | ) |
Toggle the toolbar Save Script action's enabled state. Surfaced as a typed setter so the code-tabs controller does not need to reach into the dialog's QAction members.
| enabled | True to enable the action, false to disable. |
|
overrideprotected |
Handle widget show events.
| event | The show event. |
|
inline |
Borrowed reference to the stack controller. Used by Watch / Variables / Eval to read the currently inspected stack frame without friending the dialog.
| bool LuaDebuggerDialog::tearDownPauseLoopForReload | ( | ) |
Tear down an active pause loop because the Lua engine is about to be reloaded under us. Returns true if a pause loop was active (the caller may need to defer follow-up work to the post-reload phase). Unlike resumeDebuggerAndExitLoop, the engine is NOT signalled to continue; the reload owns restarting the VM.
true if a pause loop was active, false otherwise.
|
inline |
Gets the variables controller.
|
inline |
Gets the watch controller.