Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
lua_debugger_stack.h
Go to the documentation of this file.
1/* lua_debugger_stack.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
15#ifndef LUA_DEBUGGER_STACK_H
16#define LUA_DEBUGGER_STACK_H
17
18#include <QObject>
19
20#include "lua_debugger_utils.h"
21
23class QModelIndex;
24class QPoint;
25class QStandardItemModel;
26class QTreeView;
27
29namespace StackColumn
30{
31constexpr int Function = 0;
32constexpr int Location = 1;
33constexpr int Count = 2;
34} // namespace StackColumn
35
40class LuaDebuggerStackController : public QObject
41{
42 Q_OBJECT
43
44 public:
50
56 void attach(QTreeView *tree, QStandardItemModel *model);
57
61 void configureColumns() const;
62
64 void updateFromEngine();
65
71 int selectionLevel() const { return selectionLevel_; }
72
78 void setSelectionLevel(int level) { selectionLevel_ = level; }
79
80 public slots:
86 void onCurrentItemChanged(const QModelIndex &current, const QModelIndex &previous);
87
92 void onItemDoubleClicked(const QModelIndex &index);
93
98 void showContextMenu(const QPoint &pos);
99
100 private:
102 LuaDebuggerDialog *host_ = nullptr;
103
105 QTreeView *tree_ = nullptr;
106
108 QStandardItemModel *model_ = nullptr;
109
111 int selectionLevel_ = 0;
112};
113
114#endif
Top-level dialog hosting the Lua debugger UI components.
Definition lua_debugger_dialog.h:189
Stack trace panel: column layout, rebuild from the engine, selection → variables frame,...
Definition lua_debugger_stack.h:41
void updateFromEngine()
Rebuild rows from wslua_debugger_get_stack.
Definition lua_debugger_stack.cpp:58
void setSelectionLevel(int level)
Update the active stack frame index. Does not refresh anything; callers are expected to follow up wit...
Definition lua_debugger_stack.h:78
int selectionLevel() const
Stack frame index whose locals/upvalues currently drive the Variables and Watch panels (0 = topmost /...
Definition lua_debugger_stack.h:71
void attach(QTreeView *tree, QStandardItemModel *model)
Attaches the controller to the given tree view and model.
Definition lua_debugger_stack.cpp:36
void onCurrentItemChanged(const QModelIndex &current, const QModelIndex &previous)
Handles the event when the current item in the stack tree changes.
Definition lua_debugger_stack.cpp:153
void showContextMenu(const QPoint &pos)
Displays the context menu for the stack tree.
Definition lua_debugger_stack.cpp:206
void onItemDoubleClicked(const QModelIndex &index)
Handles the event when an item in the stack tree is double-clicked.
Definition lua_debugger_stack.cpp:178
void configureColumns() const
Configures the tree view columns for the stack trace panel.
Definition lua_debugger_stack.cpp:44
Column indices for the Stack Trace tree model.
Definition lua_debugger_stack.h:30