mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-27 19:45:37 +08:00
GP-0 GhidraProject cleanup of importProgram methods accepting
DomainFolder or project folder-path arg
This commit is contained in:
@@ -599,21 +599,15 @@ public class GhidraProject {
|
|||||||
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);
|
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);
|
||||||
mgr.initializeOptions();
|
mgr.initializeOptions();
|
||||||
}
|
}
|
||||||
openPrograms.put(program, new Integer(id));
|
openPrograms.put(program, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Program importProgram(File file, Language language, CompilerSpec compilerSpec)
|
public Program importProgram(File file, Language language,
|
||||||
throws CancelledException, DuplicateNameException, InvalidNameException,
|
|
||||||
VersionException, IOException {
|
|
||||||
return importProgram(file, (DomainFolder) null, language, compilerSpec);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Program importProgram(File file, DomainFolder domainFolder, Language language,
|
|
||||||
CompilerSpec compilerSpec) throws CancelledException, DuplicateNameException,
|
CompilerSpec compilerSpec) throws CancelledException, DuplicateNameException,
|
||||||
InvalidNameException, VersionException, IOException {
|
InvalidNameException, VersionException, IOException {
|
||||||
MessageLog messageLog = new MessageLog();
|
MessageLog messageLog = new MessageLog();
|
||||||
LoadResults<Program> loadResults = AutoImporter.importByLookingForLcs(file, project,
|
LoadResults<Program> loadResults = AutoImporter.importByLookingForLcs(file, project, null,
|
||||||
domainFolder.getPathname(), language, compilerSpec, this, messageLog, MONITOR);
|
language, compilerSpec, this, messageLog, MONITOR);
|
||||||
Program program = loadResults.getPrimaryDomainObject();
|
Program program = loadResults.getPrimaryDomainObject();
|
||||||
loadResults.releaseNonPrimary(this);
|
loadResults.releaseNonPrimary(this);
|
||||||
initializeProgram(program, false);
|
initializeProgram(program, false);
|
||||||
@@ -653,16 +647,11 @@ public class GhidraProject {
|
|||||||
return loadResults.getPrimaryDomainObject();
|
return loadResults.getPrimaryDomainObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Program importProgram(File file) throws CancelledException, DuplicateNameException,
|
public Program importProgram(File file) throws CancelledException,
|
||||||
InvalidNameException, VersionException, IOException {
|
|
||||||
return importProgram(file, (DomainFolder) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Program importProgram(File file, DomainFolder domainFolder) throws CancelledException,
|
|
||||||
DuplicateNameException, InvalidNameException, VersionException, IOException {
|
DuplicateNameException, InvalidNameException, VersionException, IOException {
|
||||||
MessageLog messageLog = new MessageLog();
|
MessageLog messageLog = new MessageLog();
|
||||||
LoadResults<Program> loadResults = AutoImporter.importByUsingBestGuess(file, project,
|
LoadResults<Program> loadResults = AutoImporter.importByUsingBestGuess(file, project,
|
||||||
domainFolder.getPathname(), this, messageLog, MONITOR);
|
null, this, messageLog, MONITOR);
|
||||||
Program program = loadResults.getPrimaryDomainObject();
|
Program program = loadResults.getPrimaryDomainObject();
|
||||||
loadResults.releaseNonPrimary(this);
|
loadResults.releaseNonPrimary(this);
|
||||||
initializeProgram(program, false);
|
initializeProgram(program, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user