mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-02 02:18:42 +08:00
Merge remote-tracking branch 'origin/GP-1140_ghizard_Improve_AbstractProgramLoader_error_reporting_for_createFile' into patch
This commit is contained in:
+17
-5
@@ -179,8 +179,7 @@ public abstract class AbstractProgramLoader implements Loader {
|
||||
public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec,
|
||||
DomainObject domainObject, boolean isLoadIntoProgram) {
|
||||
ArrayList<Option> list = new ArrayList<>();
|
||||
list.add(new Option(APPLY_LABELS_OPTION_NAME,
|
||||
shouldApplyProcessorLabelsByDefault(),
|
||||
list.add(new Option(APPLY_LABELS_OPTION_NAME, shouldApplyProcessorLabelsByDefault(),
|
||||
Boolean.class, Loader.COMMAND_LINE_ARG_PREFIX + "-applyLabels"));
|
||||
list.add(new Option(ANCHOR_LABELS_OPTION_NAME, true, Boolean.class,
|
||||
Loader.COMMAND_LINE_ARG_PREFIX + "-anchorLabels"));
|
||||
@@ -189,7 +188,8 @@ public abstract class AbstractProgramLoader implements Loader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) {
|
||||
public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options,
|
||||
Program program) {
|
||||
if (options != null) {
|
||||
for (Option option : options) {
|
||||
String name = option.getName();
|
||||
@@ -389,6 +389,19 @@ public abstract class AbstractProgramLoader implements Loader {
|
||||
throw e;
|
||||
}
|
||||
catch (Exception e) {
|
||||
Throwable t = e.getCause();
|
||||
if (t == null) {
|
||||
t = e;
|
||||
}
|
||||
String msg = t.getMessage();
|
||||
if (msg == null) {
|
||||
msg = "";
|
||||
}
|
||||
else {
|
||||
msg = "\n" + msg;
|
||||
}
|
||||
Msg.showError(this, null, "Create Program Failed",
|
||||
"Failed to create program file: " + uniqueName + msg, e);
|
||||
messageLog.appendMsg("Unexpected exception creating file: " + uniqueName);
|
||||
messageLog.appendException(e);
|
||||
return false;
|
||||
@@ -441,8 +454,7 @@ public abstract class AbstractProgramLoader implements Loader {
|
||||
if (info.getScope() != null) {
|
||||
namespace = info.getScope();
|
||||
}
|
||||
s = symTable.createLabel(addr, info.getLabel(), namespace,
|
||||
info.getSource());
|
||||
s = symTable.createLabel(addr, info.getLabel(), namespace, info.getSource());
|
||||
if (info.isEntry()) {
|
||||
symTable.addExternalEntryPoint(addr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user