mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Merge remote-tracking branch 'origin/GP-0_ghidragon_fixing_junit_failures_related_to_AddressEvaluator'
This commit is contained in:
commit
18ef5ceea3
3 changed files with 15 additions and 3 deletions
|
@ -197,6 +197,14 @@ public class AddressInput extends JPanel implements FocusableEditor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the selected AddressSpace to the given space.
|
||||||
|
* @param addressSpace the address space to set selected
|
||||||
|
*/
|
||||||
|
public void setAddressSpace(AddressSpace addressSpace) {
|
||||||
|
addressSpaceField.setAddressSpace(addressSpace);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the address in the field or null if the address can't
|
* Returns the address in the field or null if the address can't
|
||||||
* be parsed.
|
* be parsed.
|
||||||
|
@ -577,4 +585,5 @@ public class AddressInput extends JPanel implements FocusableEditor {
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -435,6 +435,9 @@ public abstract class AbstractSymbolTreePluginExternalsTest
|
||||||
createDialog.getComponent().getRootPane(), EditExternalLocationPanel.class);
|
createDialog.getComponent().getRootPane(), EditExternalLocationPanel.class);
|
||||||
AddressInput extAddressInputWidget =
|
AddressInput extAddressInputWidget =
|
||||||
(AddressInput) getInstanceField("extAddressInputWidget", extLocPanel);
|
(AddressInput) getInstanceField("extAddressInputWidget", extLocPanel);
|
||||||
|
extAddressInputWidget.setAddressSpace(addressSpace);
|
||||||
|
extAddressInputWidget.setText(address);
|
||||||
|
|
||||||
if (extAddressInputWidget.containsAddressSpaces()) {
|
if (extAddressInputWidget.containsAddressSpaces()) {
|
||||||
JComboBox<?> addressSpaceWidget =
|
JComboBox<?> addressSpaceWidget =
|
||||||
(JComboBox<?>) getInstanceField("combo", extAddressInputWidget);
|
(JComboBox<?>) getInstanceField("combo", extAddressInputWidget);
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class AddressEvaluator extends ExpressionEvaluator {
|
||||||
public static Address evaluate(Program p, Address baseAddr, String inputExpression) {
|
public static Address evaluate(Program p, Address baseAddr, String inputExpression) {
|
||||||
AddressEvaluator evaluator = new AddressEvaluator(p, true);
|
AddressEvaluator evaluator = new AddressEvaluator(p, true);
|
||||||
try {
|
try {
|
||||||
return evaluator.parseAsAddress(inputExpression);
|
return evaluator.parseAsRelativeAddress(inputExpression, baseAddr);
|
||||||
}
|
}
|
||||||
catch (ExpressionException e) {
|
catch (ExpressionException e) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue