mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch
'origin/GP-5346-dragonmacher-decompiler-function-color-bug' (Closes #7453)
This commit is contained in:
commit
ec743e0280
3 changed files with 20 additions and 13 deletions
|
@ -53,7 +53,6 @@ public class AttributedStringPcodeFormatter extends
|
|||
* Constructor
|
||||
*/
|
||||
public AttributedStringPcodeFormatter() {
|
||||
initPunctuation();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -206,14 +206,21 @@ public class ClangLayoutController implements LayoutModel, LayoutModelListener {
|
|||
if (token instanceof ClangFuncNameToken clangFunctionToken) {
|
||||
Program program = decompilerPanel.getProgram();
|
||||
Function function = DecompilerUtils.getFunction(program, clangFunctionToken);
|
||||
if (function == null || function instanceof UndefinedFunction) {
|
||||
return null;
|
||||
}
|
||||
if (isValidFunction(function)) {
|
||||
Symbol symbol = function.getSymbol();
|
||||
return symbolInspector.getColor(symbol);
|
||||
tokenColor = symbolInspector.getColor(symbol);
|
||||
}
|
||||
}
|
||||
|
||||
if (tokenColor != null) {
|
||||
return tokenColor;
|
||||
}
|
||||
return syntaxColor[ClangToken.ERROR_COLOR];
|
||||
}
|
||||
|
||||
private boolean isValidFunction(Function f) {
|
||||
return f != null && !(f instanceof UndefinedFunction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update to the current Decompiler display options
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
package docking.widgets.fieldpanel.field;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
|
@ -94,9 +95,9 @@ public class AttributedString {
|
|||
throw new NullPointerException("underline color cannot be null when underlining.");
|
||||
}
|
||||
this.icon = icon;
|
||||
this.text = text;
|
||||
this.fontMetrics = fontMetrics;
|
||||
this.textColor = textColor;
|
||||
this.text = Objects.requireNonNull(text);
|
||||
this.fontMetrics = Objects.requireNonNull(fontMetrics);
|
||||
this.textColor = Objects.requireNonNull(textColor);
|
||||
this.isUnderlined = underline;
|
||||
this.underlineColor = underlineColor;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue