Ghidra is a software reverse engineering (SRE) framework
GP-1071 - Fixed decompiler hover to prevent the Data Type hover from appearing when over a scalar
dragonmacher55ebf73af2b3
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/DataTypeDecompilerHover.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/DataTypeDecompilerHover.javaindex 4dd0896557..cebf1d005e 100644--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/DataTypeDecompilerHover.java+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/DataTypeDecompilerHover.java@@ -37,6 +37,8 @@ public class DataTypeDecompilerHover extends AbstractConfigurableHoverprivate static final String NAME = "Data Type Display";private static final String DESCRIPTION ="Show data type contents when hovering over a type name.";++ // note: this is relative to other DecompilerHovers; a higher priority gets called firstprivate static final int PRIORITY = 20;protected DataTypeDecompilerHover(PluginTool tool) {diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/FunctionSignatureDecompilerHover.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/FunctionSignatureDecompilerHover.javaindex 84d94e3d13..eae5792b4e 100644--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/FunctionSignatureDecompilerHover.java+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/FunctionSignatureDecompilerHover.java@@ -47,6 +47,8 @@ public class FunctionSignatureDecompilerHover extends AbstractConfigurableHoverprivate static final String NAME = "Function Signature Display";private static final String DESCRIPTION ="Show function signatures when hovering over a function name.";++ // note: this is relative to other DecompilerHovers; a higher priority gets called firstprivate static final int PRIORITY = 20;protected FunctionSignatureDecompilerHover(PluginTool tool) {diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ReferenceDecompilerHover.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ReferenceDecompilerHover.javaindex 830be23ddf..692af1d4aa 100644--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ReferenceDecompilerHover.java+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ReferenceDecompilerHover.java@@ -34,7 +34,11 @@ public class ReferenceDecompilerHover extends AbstractReferenceHoverprivate static final String DESCRIPTION ="Shows \"referred to\" code and data from the decompiler.";- private static final int PRIORITY = 25;+ // note: this is relative to other DecompilerHovers; a higher priority gets called first+ // Use high value so this hover gets called first. The method for determining what the user+ // is hovering in the Decompiler is less then perfect. We choose to allow the more precise+ // hovers get a chance to process the request first.+ private static final int PRIORITY = 50;public ReferenceDecompilerHover(PluginTool tool) {super(tool, PRIORITY);diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ScalarValueDecompilerHover.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ScalarValueDecompilerHover.javaindex e36a659af8..faeac467bd 100644--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ScalarValueDecompilerHover.java+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/hover/ScalarValueDecompilerHover.java@@ -36,7 +36,14 @@ import ghidra.program.util.ProgramLocation;public class ScalarValueDecompilerHover extends AbstractScalarOperandHoverimplements DecompilerHoverService {- private static final int PRIORITY = 20;+ // note: this is relative to other DecompilerHovers; a higher priority gets called first+ // Use high value so this hover gets called first. The method for determining what the user+ // is hovering in the Decompiler is less then perfect. We choose to allow the more precise+ // hovers to get a chance to process the request first.+ // We want this hover to go before the data type hovers, due to how that hover decides when it+ // can show a popup, it decides to work when over a scalar. Having this hover get called+ // first prevents that.+ private static final int PRIORITY = 30;private static final String NAME = "Scalar Operand Display";private static final String DESCRIPTION =