mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 00:35:05 +00:00
Keep CallGraph widget active when seeking to other functions
This commit is contained in:
parent
1ac814c1b9
commit
ae1e15b7a2
@ -1086,6 +1086,12 @@ MemoryDockWidget *MainWindow::addNewMemoryWidget(MemoryWidgetType type, RVA addr
|
||||
case MemoryWidgetType::Decompiler:
|
||||
memoryWidget = new DecompilerWidget(this);
|
||||
break;
|
||||
case MemoryWidgetType::CallGraph:
|
||||
memoryWidget = new CallGraphWidget(this, false);
|
||||
break;
|
||||
case MemoryWidgetType::GlobalCallGraph:
|
||||
memoryWidget = new CallGraphWidget(this, true);
|
||||
break;
|
||||
}
|
||||
auto seekable = memoryWidget->getSeekable();
|
||||
seekable->setSynchronization(synchronized);
|
||||
|
@ -7,9 +7,9 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
CallGraphWidget::CallGraphWidget(MainWindow *main, bool global)
|
||||
: AddressableDockWidget(main), graphView(new CallGraphView(this, main, global)), global(global)
|
||||
: MemoryDockWidget(MemoryWidgetType::CallGraph, main), graphView(new CallGraphView(this, main, global)), global(global)
|
||||
{
|
||||
setObjectName(main->getUniqueObjectName("CallGraphWidget"));
|
||||
setObjectName(main ? main->getUniqueObjectName(getWidgetType()) : getWidgetType());
|
||||
this->setWindowTitle(getWindowTitle());
|
||||
connect(seekable, &CutterSeekable::seekableSeekChanged, this, &CallGraphWidget::onSeekChanged);
|
||||
|
||||
@ -23,6 +23,11 @@ QString CallGraphWidget::getWindowTitle() const
|
||||
return global ? tr("Global Callgraph") : tr("Callgraph");
|
||||
}
|
||||
|
||||
QString CallGraphWidget::getWidgetType() const
|
||||
{
|
||||
return global ? tr("GlobalCallgraph") : tr("Callgraph");
|
||||
}
|
||||
|
||||
void CallGraphWidget::onSeekChanged(RVA address)
|
||||
{
|
||||
if (auto function = Core()->functionIn(address)) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define CALL_GRAPH_WIDGET_H
|
||||
|
||||
#include "core/Cutter.h"
|
||||
#include "AddressableDockWidget.h"
|
||||
#include "MemoryDockWidget.h"
|
||||
#include "widgets/SimpleTextGraphView.h"
|
||||
#include "common/RefreshDeferrer.h"
|
||||
|
||||
@ -30,7 +30,7 @@ private:
|
||||
RVA lastLoadedAddress = RVA_INVALID;
|
||||
};
|
||||
|
||||
class CallGraphWidget : public AddressableDockWidget
|
||||
class CallGraphWidget : public MemoryDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -38,6 +38,8 @@ public:
|
||||
explicit CallGraphWidget(MainWindow *main, bool global);
|
||||
~CallGraphWidget();
|
||||
|
||||
QString getWidgetType() const;
|
||||
|
||||
protected:
|
||||
QString getWindowTitle() const override;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <QAction>
|
||||
|
||||
/* Disassembly/Graph/Hexdump/Decompiler view priority */
|
||||
enum class MemoryWidgetType { Disassembly, Graph, Hexdump, Decompiler };
|
||||
enum class MemoryWidgetType { Disassembly, Graph, Hexdump, Decompiler, CallGraph, GlobalCallGraph };
|
||||
|
||||
class CUTTER_EXPORT MemoryDockWidget : public AddressableDockWidget
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user