mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/GP-0_ghidragon_fixing_junit_failures_related_to_AddressEvaluator'
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user