@@ -26,6 +26,8 @@ SourceView::SourceView(QString path, duint addr, QWidget* parent)
26
26
setupContextMenu ();
27
27
28
28
connect (this , SIGNAL (contextMenuSignal (QPoint)), this , SLOT (contextMenuSlot (QPoint)));
29
+ connect (this , SIGNAL (doubleClickedSignal ()), this , SLOT (followDisassemblerSlot ()));
30
+ connect (this , SIGNAL (enterPressedSignal ()), this , SLOT (followDisassemblerSlot ()));
29
31
30
32
Initialize ();
31
33
@@ -116,9 +118,35 @@ void SourceView::contextMenuSlot(const QPoint & pos)
116
118
void SourceView::followDisassemblerSlot ()
117
119
{
118
120
duint addr = addrFromIndex (getInitialSelection ());
121
+ if (!DbgMemIsValidReadPtr (addr))
122
+ return ;
119
123
DbgCmdExec (QString (" disasm %1" ).arg (ToPtrString (addr)).toUtf8 ().constData ());
120
124
}
121
125
126
+ void SourceView::followDumpSlot ()
127
+ {
128
+ duint addr = addrFromIndex (getInitialSelection ());
129
+ if (!DbgMemIsValidReadPtr (addr))
130
+ return ;
131
+ DbgCmdExec (QString (" dump %1" ).arg (ToPtrString (addr)).toUtf8 ().constData ());
132
+ }
133
+
134
+ void SourceView::toggleBookmarkSlot ()
135
+ {
136
+ duint addr = addrFromIndex (getInitialSelection ());
137
+ if (!DbgMemIsValidReadPtr (addr))
138
+ return ;
139
+
140
+ bool result;
141
+ if (DbgGetBookmarkAt (addr))
142
+ result = DbgSetBookmarkAt (addr, false );
143
+ else
144
+ result = DbgSetBookmarkAt (addr, true );
145
+ if (!result)
146
+ SimpleErrorBox (this , tr (" Error!" ), tr (" DbgSetBookmarkAt failed!" ));
147
+ GuiUpdateAllViews ();
148
+ }
149
+
122
150
void SourceView::gotoLineSlot ()
123
151
{
124
152
bool ok = false ;
@@ -150,9 +178,22 @@ void SourceView::setupContextMenu()
150
178
{
151
179
return DbgMemIsValidReadPtr (addrFromIndex (getInitialSelection ()));
152
180
});
181
+ mMenuBuilder ->addAction (makeAction (DIcon (" dump.png" ), tr (" Follow in &Dump" ), SLOT (followDumpSlot ())), [this ](QMenu*)
182
+ {
183
+ return DbgMemIsValidReadPtr (addrFromIndex (getInitialSelection ()));
184
+ });
185
+ mMenuBuilder ->addSeparator ();
186
+ mBreakpointMenu = new BreakpointMenu (this , getActionHelperFuncs (), [this ]()
187
+ {
188
+ return addrFromIndex (getInitialSelection ());
189
+ });
190
+ mBreakpointMenu ->build (mMenuBuilder );
191
+ mMenuBuilder ->addAction (makeShortcutAction (DIcon (" bookmark_toggle.png" ), tr (" Toggle Bookmark" ), SLOT (toggleBookmarkSlot ()), " ActionToggleBookmark" ));
192
+ mMenuBuilder ->addSeparator ();
153
193
mMenuBuilder ->addAction (makeShortcutAction (DIcon (" geolocation-goto.png" ), tr (" Go to line" ), SLOT (gotoLineSlot ()), " ActionGotoExpression" ));
154
194
mMenuBuilder ->addAction (makeAction (DIcon (" source.png" ), tr (" Open source file" ), SLOT (openSourceFileSlot ())));
155
195
mMenuBuilder ->addAction (makeAction (DIcon (" source_show_in_folder.png" ), tr (" Show source file in directory" ), SLOT (showInDirectorySlot ())));
196
+ mMenuBuilder ->addSeparator ();
156
197
MenuBuilder* copyMenu = new MenuBuilder (this );
157
198
setupCopyColumnMenu (copyMenu);
158
199
mMenuBuilder ->addMenu (makeMenu (DIcon (" copy.png" ), tr (" &Copy" )), copyMenu);
0 commit comments