From b228dd9aad4cb2aaa35f7232f661f94d87db69b2 Mon Sep 17 00:00:00 2001 From: u Date: Fri, 1 Mar 2024 18:08:59 +0300 Subject: [PATCH] #91 invalidate cache on server start (#92) --- .../src/main/java/decomp2dbg/D2DPlugin.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/decompilers/d2d_ghidra/src/main/java/decomp2dbg/D2DPlugin.java b/decompilers/d2d_ghidra/src/main/java/decomp2dbg/D2DPlugin.java index 77083ef..9386f50 100644 --- a/decompilers/d2d_ghidra/src/main/java/decomp2dbg/D2DPlugin.java +++ b/decompilers/d2d_ghidra/src/main/java/decomp2dbg/D2DPlugin.java @@ -102,6 +102,18 @@ public void actionPerformed(ActionContext context) { configureD2DAction.setKeyBindingData(new KeyBindingData(KeyStroke.getKeyStroke('D', Event.CTRL_MASK + Event.SHIFT_MASK))); return configureD2DAction; } + + private void clearCache() { + this.decompileCache.clear(); + this.gVarCache.clear(); + this.funcSymCache.clear(); + this.funcDataCache.clear(); + this.structCache.clear(); + this.typeAliasCache.clear(); + this.unionCache.clear(); + this.enumCache.clear(); + this.elfInfoCache.clear(); + } private void configureD2DServer() { Msg.info(this, "Configuring decomp2dbg..."); @@ -125,7 +137,7 @@ private void configureD2DServer() { } } else return; - + this.server = new D2DGhidraServer(host, port, this); try { @@ -134,7 +146,9 @@ private void configureD2DServer() { JOptionPane.showMessageDialog(null, "Encountered error: " + e.toString()); return; } - + + this.clearCache(); + JOptionPane.showMessageDialog(null, "Sever configured and running!"); }