mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-1956 update metadata on set language
This commit is contained in:
parent
47f76c78d6
commit
352fe6fd8c
2 changed files with 18 additions and 12 deletions
|
@ -15,12 +15,12 @@
|
|||
*/
|
||||
// Reloads the language specification associated with a program at runtime.
|
||||
// @category sleigh
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.program.model.lang.Language;
|
||||
import ghidra.util.Msg;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ReloadSleighLangauge extends GhidraScript {
|
||||
|
||||
@Override
|
||||
|
@ -37,7 +37,6 @@ public class ReloadSleighLangauge extends GhidraScript {
|
|||
e.getMessage());
|
||||
return;
|
||||
}
|
||||
currentProgram.setLanguage(language, currentProgram.getCompilerSpec().getCompilerSpecID(),
|
||||
true, monitor);
|
||||
currentProgram.setLanguage(language, null, true, monitor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1903,15 +1903,22 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
throws IllegalStateException, IncompatibleLanguageException, LockException {
|
||||
if (newLanguage == language) {
|
||||
setLanguage((LanguageTranslator) null, newCompilerSpecID, forceRedisassembly, monitor);
|
||||
return;
|
||||
}
|
||||
LanguageTranslator languageTranslator =
|
||||
LanguageTranslatorFactory.getLanguageTranslatorFactory()
|
||||
.getLanguageTranslator(language, newLanguage);
|
||||
if (languageTranslator == null) {
|
||||
throw new IncompatibleLanguageException("Language translation not supported");
|
||||
else {
|
||||
LanguageTranslator languageTranslator =
|
||||
LanguageTranslatorFactory.getLanguageTranslatorFactory()
|
||||
.getLanguageTranslator(language, newLanguage);
|
||||
if (languageTranslator == null) {
|
||||
throw new IncompatibleLanguageException("Language translation not supported");
|
||||
}
|
||||
setLanguage(languageTranslator, newCompilerSpecID, forceRedisassembly, monitor);
|
||||
}
|
||||
try {
|
||||
updateMetadata();
|
||||
}
|
||||
catch (IOException e) {
|
||||
dbError(e);
|
||||
}
|
||||
setLanguage(languageTranslator, newCompilerSpecID, forceRedisassembly, monitor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1922,7 +1929,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
|||
* @param monitor task monitor
|
||||
* @throws LockException if exclusive access is missing
|
||||
*/
|
||||
public void setLanguage(LanguageTranslator translator, CompilerSpecID newCompilerSpecID,
|
||||
private void setLanguage(LanguageTranslator translator, CompilerSpecID newCompilerSpecID,
|
||||
boolean forceRedisassembly, TaskMonitor monitor) throws LockException {
|
||||
|
||||
checkExclusiveAccess();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue