mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +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.
|
// Reloads the language specification associated with a program at runtime.
|
||||||
// @category sleigh
|
// @category sleigh
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import ghidra.app.script.GhidraScript;
|
import ghidra.app.script.GhidraScript;
|
||||||
import ghidra.program.model.lang.Language;
|
import ghidra.program.model.lang.Language;
|
||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class ReloadSleighLangauge extends GhidraScript {
|
public class ReloadSleighLangauge extends GhidraScript {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,7 +37,6 @@ public class ReloadSleighLangauge extends GhidraScript {
|
||||||
e.getMessage());
|
e.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
currentProgram.setLanguage(language, currentProgram.getCompilerSpec().getCompilerSpecID(),
|
currentProgram.setLanguage(language, null, true, monitor);
|
||||||
true, monitor);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1903,8 +1903,8 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
||||||
throws IllegalStateException, IncompatibleLanguageException, LockException {
|
throws IllegalStateException, IncompatibleLanguageException, LockException {
|
||||||
if (newLanguage == language) {
|
if (newLanguage == language) {
|
||||||
setLanguage((LanguageTranslator) null, newCompilerSpecID, forceRedisassembly, monitor);
|
setLanguage((LanguageTranslator) null, newCompilerSpecID, forceRedisassembly, monitor);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
LanguageTranslator languageTranslator =
|
LanguageTranslator languageTranslator =
|
||||||
LanguageTranslatorFactory.getLanguageTranslatorFactory()
|
LanguageTranslatorFactory.getLanguageTranslatorFactory()
|
||||||
.getLanguageTranslator(language, newLanguage);
|
.getLanguageTranslator(language, newLanguage);
|
||||||
|
@ -1913,6 +1913,13 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
||||||
}
|
}
|
||||||
setLanguage(languageTranslator, newCompilerSpecID, forceRedisassembly, monitor);
|
setLanguage(languageTranslator, newCompilerSpecID, forceRedisassembly, monitor);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
updateMetadata();
|
||||||
|
}
|
||||||
|
catch (IOException e) {
|
||||||
|
dbError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate language
|
* Translate language
|
||||||
|
@ -1922,7 +1929,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
|
||||||
* @param monitor task monitor
|
* @param monitor task monitor
|
||||||
* @throws LockException if exclusive access is missing
|
* @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 {
|
boolean forceRedisassembly, TaskMonitor monitor) throws LockException {
|
||||||
|
|
||||||
checkExclusiveAccess();
|
checkExclusiveAccess();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue