Ghidra is a software reverse engineering (SRE) framework
GT-2667 added support for generating sleigh build.xml files
ghidra17179c6de814e
diff --git a/.gitignore b/.gitignoreindex 04e661f556..c3fb9d3ddc 100644--- a/.gitignore+++ b/.gitignore@@ -23,6 +23,7 @@ ghidra.repos.config**/distrepositories/*.sla+**/data/build.xml# Misc files*.settingdiff --git a/Ghidra/Features/FileFormats/data/build.xml b/Ghidra/Features/FileFormats/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Features/FileFormats/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.javaindex e6f02965f7..09572b2b80 100644--- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.java+++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/Application.java@@ -460,18 +460,19 @@ public class Application {if (module == null) {return null;}-- File file = getModuleFile(module, "build/os/" + Platform.CURRENT_PLATFORM.getDirectoryName(),- exactFilename);++ File file = getModuleFile(module,+ "build/os/" + Platform.CURRENT_PLATFORM.getDirectoryName(), exactFilename);if (file == null) {file = getModuleFile(module, "os/" + Platform.CURRENT_PLATFORM.getDirectoryName(),exactFilename);}-+// Allow win32 to be used for win64 as fallbackif (file == null && Platform.CURRENT_PLATFORM == Platform.WIN_64) {- file = getModuleFile(module, "build/os/" + Platform.WIN_32.getDirectoryName(), exactFilename);+ file = getModuleFile(module, "build/os/" + Platform.WIN_32.getDirectoryName(),+ exactFilename);}if (file == null && Platform.CURRENT_PLATFORM == Platform.WIN_64) {file = getModuleFile(module, "os/" + Platform.WIN_32.getDirectoryName(), exactFilename);@@ -492,12 +493,13 @@ public class Application {private File getOSFileInAnyModule(String path) throws FileNotFoundException {- File file = findModuleFile("build/os/" + Platform.CURRENT_PLATFORM.getDirectoryName(), path);-+ File file =+ findModuleFile("build/os/" + Platform.CURRENT_PLATFORM.getDirectoryName(), path);+if (file == null) {file = findModuleFile("os/" + Platform.CURRENT_PLATFORM.getDirectoryName(), path);}-+// Allow win32 to be used for win64 as fallbackif (file == null && Platform.CURRENT_PLATFORM == Platform.WIN_64) {file = findModuleFile("build/os/" + Platform.WIN_32.getDirectoryName(), path);@@ -657,7 +659,7 @@ public class Application {/*** Return the module root directory for the module with the given name.* @param moduleName the name of the module.- * @return the module root directory for the module with the given name.+ * @return the module root directory for the module with the given name or null if not found.*/public static ResourceFile getModuleRootDir(String moduleName) {checkAppInitialized();diff --git a/Ghidra/Framework/SoftwareModeling/Sleigh.launch b/Ghidra/Framework/SoftwareModeling/Sleigh.launchindex b4f8e30e41..b8273f84bc 100644--- a/Ghidra/Framework/SoftwareModeling/Sleigh.launch+++ b/Ghidra/Framework/SoftwareModeling/Sleigh.launch@@ -1,19 +1,27 @@<?xml version="1.0" encoding="UTF-8" standalone="no"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">- <listEntry value="/Framework SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompile.java"/>- </listAttribute>- <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">- <listEntry value="1"/>- </listAttribute>- <listAttribute key="org.eclipse.debug.ui.favoriteGroups">- <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>- <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>- </listAttribute>- <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>- <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>- <listAttribute key="org.eclipse.jdt.launching.MODULEPATH"/>- <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-a "${project_loc}/data/languages""/>- <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Framework SoftwareModeling"/>- <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.awt.headless=true -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant"/>+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">+<listEntry value="/Framework Utility/src/main/java/ghidra/GhidraLauncher.java"/>+</listAttribute>+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">+<listEntry value="1"/>+</listAttribute>+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>+</listAttribute>+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="5" projectName="Framework Utility" type="1"/> "/>+</listAttribute>+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ghidra.GhidraLauncher"/>+<listAttribute key="org.eclipse.jdt.launching.MODULEPATH">+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11" path="4" type="4"/> "/>+</listAttribute>+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="ghidra.pcodeCPort.slgh_compile.SleighCompileLauncher -i "${project_loc}/build/data/sleighArgs.txt" -a "${project_loc}/data/languages""/>+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Framework Utility"/>+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.awt.headless=true -Xmx1048M -XX:+IgnoreUnrecognizedVMOptions -Djava.system.class.loader=ghidra.GhidraClassLoader -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -Xdock:name="Sleigh" -Dvisualvm.display.name=Sleigh"/></launchConfiguration>diff --git a/Ghidra/Framework/SoftwareModeling/build.gradle b/Ghidra/Framework/SoftwareModeling/build.gradleindex ea5e731db3..afcc62f929 100644--- a/Ghidra/Framework/SoftwareModeling/build.gradle+++ b/Ghidra/Framework/SoftwareModeling/build.gradle@@ -23,6 +23,10 @@ dependencies {antlr "org.antlr:antlr:3.5.2"}+// Define classpath needed to execute sleigh compiler during development+// (see gradleScripts/processorUtils.gradle)+ext.sleighDevClasspath = project.sourceSets.main.runtimeClasspath.collect { it.absolutePath }.join(':')+def genSrcDir = 'generated-src/antlr/main'generateGrammarSource {diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.javaindex a0cf138fdb..8c12ac945a 100644--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java@@ -412,11 +412,39 @@ public class SleighLanguage implements Language {String languageName = specName + ".slaspec";ResourceFile languageFile = new ResourceFile(slaFile.getParentFile(), languageName);+ // see gradleScripts/processorUtils.gradle for sleighArgs.txt generation+ ResourceFile sleighArgsFile = null;+ ResourceFile languageModule = Application.getModuleContainingResourceFile(languageFile);+ if (languageModule != null) {+ if (SystemUtilities.isInReleaseMode()) {+ sleighArgsFile = new ResourceFile(languageModule, "data/sleighArgs.txt");+ }+ else {+ sleighArgsFile = new ResourceFile(languageModule, "build/data/sleighArgs.txt");+ }+ }++ Map<String, String> defineMap;+ String[] args;+ if (sleighArgsFile != null && sleighArgsFile.isFile()) {+ args = new String[] { "-i", sleighArgsFile.getAbsolutePath(),+ languageFile.getAbsolutePath(), description.getSlaFile().getAbsolutePath() };+ defineMap = new HashMap<>();+ }+ else {+ args = new String[] { languageFile.getAbsolutePath(),+ description.getSlaFile().getAbsolutePath() };+ defineMap = ModuleDefinitionsMap.getModuleMap();+ }+try {- int returnCode = SleighCompileLauncher.runMain(- new String[] { languageFile.getAbsolutePath(),- description.getSlaFile().getAbsolutePath() },- ModuleDefinitionsMap.getModuleMap());+ StringBuilder buf = new StringBuilder();+ for (String str : args) {+ buf.append(str);+ buf.append(" ");+ }+ Msg.debug(this, "Sleigh compile: " + buf);+ int returnCode = SleighCompileLauncher.runMain(args, defineMap);if (returnCode != 0) {throw new SleighException("Errors compiling " + languageFile.getAbsolutePath() +" -- please check log messages for details");diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompile.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompile.javaindex cd3f56fad9..895c894be6 100644--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompile.java+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompile.java@@ -963,10 +963,9 @@ public class SleighCompile extends SleighBase {continue;}if (firstContextField != null && sym.getId() == firstContextField) {- reportError(location,- sym.getName() +- " cannot be used to attach variables because it occurs at the lowest bit position in context at " +- sym.getLocation());+ reportError(location, sym.getName() ++ " cannot be used to attach variables because it occurs at the lowest bit position in context at " ++ sym.getLocation());continue;}PatternValue patval = sym.getPatternValue();@@ -1569,7 +1568,9 @@ public class SleighCompile extends SleighBase {}/**- * Run the sleigh compiler.+ * Run the sleigh compiler. This provides a direct means of invoking the+ * compiler without using the launcher. The full SoftwareModeling classpath+ * must be established including any dependencies.* @param args compiler command line arguments* @throws JDOMException* @throws IOException@@ -1578,5 +1579,4 @@ public class SleighCompile extends SleighBase {public static void main(String[] args) throws JDOMException, IOException, RecognitionException {System.exit(SleighCompileLauncher.runMain(args, new HashMap<String, String>()));}-}diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompileLauncher.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompileLauncher.javaindex 299ffdc938..c678b37ef7 100644--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompileLauncher.java+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/SleighCompileLauncher.java@@ -21,17 +21,18 @@ import java.util.Map.Entry;import org.antlr.runtime.*;import org.antlr.runtime.tree.CommonTreeNodeStream;-import org.jdom.*;-import org.jdom.input.SAXBuilder;+import org.jdom.JDOMException;+import generic.jar.ResourceFile;import generic.stl.IteratorSTL;import ghidra.GhidraApplicationLayout;import ghidra.GhidraLaunchable;+import ghidra.framework.Application;+import ghidra.framework.ApplicationConfiguration;import ghidra.pcodeCPort.context.SleighError;-import ghidra.pcodeCPort.translate.XmlError;import ghidra.sleigh.grammar.*;import ghidra.util.Msg;-import ghidra.util.xml.XmlUtilities;+import ghidra.util.SystemUtilities;import utilities.util.FileResolutionResult;import utilities.util.FileUtilities;@@ -63,6 +64,11 @@ public class SleighCompileLauncher implements GhidraLaunchable {@Overridepublic void launch(GhidraApplicationLayout layout, String[] args)throws JDOMException, IOException, RecognitionException {++ // Initialize the application+ ApplicationConfiguration configuration = new ApplicationConfiguration();+ Application.initializeApplication(layout, configuration);+System.exit(runMain(args, new HashMap<String, String>()));}@@ -87,17 +93,24 @@ public class SleighCompileLauncher implements GhidraLaunchable {if (args.length < 1) {// @formatter:off- Msg.info(SleighCompile.class, "USAGE: sleigh [-x] [-dNAME=VALUE] inputfile outputfile");- Msg.info(SleighCompile.class, " -x turns on parser debugging");- Msg.info(SleighCompile.class, " -u print warnings for unnecessary pcode instructions");- Msg.info(SleighCompile.class, " -l report pattern conflicts");- Msg.info(SleighCompile.class, " -n print warnings for all NOP constructors");- Msg.info(SleighCompile.class, " -t print warnings for dead temporaries");- Msg.info(SleighCompile.class, " -e enforce use of 'local' keyword for temporaries");- Msg.info(SleighCompile.class, " -f print warnings for unused token fields");- Msg.info(SleighCompile.class, " -DNAME=VALUE defines a preprocessor macro NAME with value VALUE");- Msg.info(SleighCompile.class, " OR sleigh -a directory-root");- Msg.info(SleighCompile.class, " compiles all .slaspec files to .sla files anywhere under directory-root");+ Msg.info(SleighCompile.class, "Usage: sleigh [options...] [<infile.slaspec> [<outfile.sla>] | -a <directory-path>]");+ Msg.info(SleighCompile.class, " sleigh [options...] <infile.slaspec> [<outfile.sla>]");+ Msg.info(SleighCompile.class, " <infile.slaspec> source slaspec file to be compiled");+ Msg.info(SleighCompile.class, " <outfile.sla> optional output sla file (infile.sla assumed)");+ Msg.info(SleighCompile.class, " or");+ Msg.info(SleighCompile.class, " sleigh [options...] -a <directory-path>");+ Msg.info(SleighCompile.class, " <directory-path> directory to have all slaspec files compiled");+ Msg.info(SleighCompile.class, " options:");+ Msg.info(SleighCompile.class, " -x turns on parser debugging");+ Msg.info(SleighCompile.class, " -u print warnings for unnecessary pcode instructions");+ Msg.info(SleighCompile.class, " -l report pattern conflicts");+ Msg.info(SleighCompile.class, " -n print warnings for all NOP constructors");+ Msg.info(SleighCompile.class, " -t print warnings for dead temporaries");+ Msg.info(SleighCompile.class, " -e enforce use of 'local' keyword for temporaries");+ Msg.info(SleighCompile.class, " -f print warnings for unused token fields");+ Msg.info(SleighCompile.class, " -DNAME=VALUE defines a preprocessor macro NAME with value VALUE (option may be repeated)");+ Msg.info(SleighCompile.class, " -dMODULE defines a preprocessor macro MODULE with a value of its module path (option may be repeated)");+ Msg.info(SleighCompile.class, " -i <options-file> inject options from specified file");// @formatter:onreturn 2;}@@ -114,6 +127,13 @@ public class SleighCompileLauncher implements GhidraLaunchable {if (args[i].charAt(0) != '-') {break;}+ else if (args[i].charAt(1) == 'i') {+ // inject options from file specified by next argument+ args = injectOptionsFromFile(args, ++i);+ if (args == null) {+ return 1;+ }+ }else if (args[i].charAt(1) == 'D') {String preproc = args[i].substring(2);int pos = preproc.indexOf('=');@@ -125,6 +145,18 @@ public class SleighCompileLauncher implements GhidraLaunchable {String value = preproc.substring(pos + 1);preprocs.put(name, value); // Preprocessor macro definitions}+ else if (args[i].charAt(1) == 'd') {+ String moduleName = args[i].substring(2);+ ResourceFile module = Application.getModuleRootDir(moduleName);+ if (module == null || !module.isDirectory()) {+ Msg.error(SleighCompile.class,+ "Failed to resolve module reference: " + args[i]);+ return 1;+ }+ Msg.debug(SleighCompile.class,+ "Sleigh resolved module: " + moduleName + "=" + module.getAbsolutePath());+ preprocs.put(moduleName, module.getAbsolutePath()); // Preprocessor macro definitions+ }else if (args[i].charAt(1) == 'u') {unnecessaryPcodeWarning = true;}@@ -155,7 +187,16 @@ public class SleighCompileLauncher implements GhidraLaunchable {}}+ if (i < args.length - 2) {+ Msg.error(SleighCompile.class, "Too many parameters");+ return 1;+ }+if (allMode) {+ if (i == args.length) {+ Msg.error(SleighCompile.class, "Missing input directory path");+ return 1;+ }String directory = args[i];File dir = new File(directory);if (!dir.exists() || !dir.isDirectory()) {@@ -195,6 +236,7 @@ public class SleighCompileLauncher implements GhidraLaunchable {return -totalFailures;}+ // single file compileSleighCompile compiler = new SleighCompile();initCompiler(compiler, preprocs, unnecessaryPcodeWarning, lenientConflict, allNopWarning,deadTempWarning, unusedFieldWarning, enforceLocalKeyWord);@@ -202,60 +244,71 @@ public class SleighCompileLauncher implements GhidraLaunchable {Msg.error(SleighCompile.class, "Missing input file name");return 1;}- if (i < args.length - 2) {- Msg.error(SleighCompile.class, "Too many parameters");- return 1;- }filein = args[i];if (i < args.length - 1) {fileout = args[i + 1];}- String fileinExamine = filein;- int extInPos = fileinExamine.indexOf(FILE_IN_DEFAULT_EXT);- boolean autoExtInSet = false;- String fileinPreExt = "";- if (extInPos == -1) {// No Extension Given...- // cout << "No Ext Given" << endl;- fileinPreExt = fileinExamine;- fileinExamine += FILE_IN_DEFAULT_EXT;- filein = fileinExamine;- // cout << "filein = " << filein << endl;- autoExtInSet = true;+ String baseName = filein;+ if (filein.toLowerCase().endsWith(FILE_IN_DEFAULT_EXT)) {+ baseName = filein.substring(0, filein.length() - FILE_IN_DEFAULT_EXT.length());}- else {- fileinPreExt = fileinExamine.substring(0, extInPos);+ filein = baseName + FILE_IN_DEFAULT_EXT;++ String baseOutName = fileout;+ if (fileout == null) {+ baseOutName = baseName;}- // cout << "fileinPreExt = " << fileinPreExt << endl;-- if (fileout != null) {- String fileoutExamine = fileout;- int extOutPos = fileoutExamine.indexOf(FILE_OUT_DEFAULT_EXT);- if (extOutPos == -1) {// No Extension Given...- // cout << "No Ext Given" << endl;- fileoutExamine += FILE_OUT_DEFAULT_EXT;- fileout = fileoutExamine;- // cout << "fileout = " << fileout << endl;- }- retval = run_compilation(filein, fileout, compiler);+ else if (fileout.toLowerCase().endsWith(FILE_OUT_DEFAULT_EXT)) {+ baseOutName = fileout.substring(0, fileout.length() - FILE_OUT_DEFAULT_EXT.length());+ }+ fileout = baseOutName + FILE_OUT_DEFAULT_EXT;++ return run_compilation(filein, fileout, compiler);+ }++ private static String[] injectOptionsFromFile(String[] args, int index) {+ if (index >= args.length) {+ Msg.error(SleighCompile.class, "Missing options input file name");+ return null;}- else {- // First determine whether or not to use Run_XML...- if (autoExtInSet) {// Assumed format of at least "sleigh file" .- // "sleigh file.slaspec file.sla"- String fileoutSTR = fileinPreExt;- fileoutSTR += FILE_OUT_DEFAULT_EXT;- fileout = fileoutSTR;- // cout << "generated fileout = " << fileout << endl;- retval = run_compilation(filein, fileout, compiler);++ File optionsFile = new File(args[index]);+ if (!optionsFile.isFile()) {+ Msg.error(SleighCompile.class,+ "Options file not found: " + optionsFile.getAbsolutePath());+ if (SystemUtilities.isInDevelopmentMode()) {+ Msg.error(SleighCompile.class,+ "Eclipse language module must be selected and 'gradle prepdev' prevously run");}- else {- retval = run_xml(filein, compiler);+ return null;+ }+ ArrayList<String> list = new ArrayList<>();+ for (int i = 0; i <= index; i++) {+ list.add(args[i]);+ }++ try (BufferedReader r = new BufferedReader(new FileReader(optionsFile))) {+ String option = r.readLine();+ while (option != null) {+ option = option.trim();+ if (option.length() != 0 && !option.startsWith("#")) {+ list.add(option);+ }+ option = r.readLine();}+ }+ catch (IOException e) {+ Msg.error(SleighCompile.class,+ "Reading options file failed (" + optionsFile.getName() + "): " + e.getMessage());+ return null;+ }+ for (int i = index + 1; i < args.length; i++) {+ list.add(args[i]);}- return retval;+ return list.toArray(new String[list.size()]);}private static int run_compilation(String filein, String fileout, SleighCompile compiler)@@ -384,64 +437,4 @@ public class SleighCompileLauncher implements GhidraLaunchable {return 0;}- private static int run_xml(String filein, SleighCompile compiler)- throws JDOMException, IOException, RecognitionException {- FileInputStream s = new FileInputStream(new File(filein));- Document doc = null;- String specfileout = "";- String specfilein = "";-- try {- SAXBuilder builder = XmlUtilities.createSecureSAXBuilder(false, false);- doc = builder.build(s);- }- catch (XmlError err) {- Msg.error(SleighCompile.class,- "Unable to parse single input file as XML spec: " + filein, err);- return 1;- }- s.close();-- Element el = doc.getRootElement();- for (;;) {- List<?> list = el.getChildren();- Iterator<?> iter = list.iterator();- while (iter.hasNext()) {- el = (Element) iter.next();- if (el.getName().equals("processorfile")) {- specfileout = el.getText();- List<?> atts = el.getAttributes();- Iterator<?> i = atts.iterator();- while (i.hasNext()) {- Attribute att = (Attribute) i.next();- if (att.getName().equals("slaspec")) {- specfilein = att.getValue();- }- else {- compiler.setPreprocValue(att.getName(), att.getValue());- }- }- }- else if (el.getName().equals("language_spec")) {- break;- }- else if (el.getName().equals("language_description")) {- break;- }- }- if (!iter.hasNext()) {- break;- }- }-- if (specfilein.length() == 0) {- Msg.error(SleighCompile.class, "Input slaspec file was not specified in " + filein);- return 1;- }- if (specfileout.length() == 0) {- Msg.error(SleighCompile.class, "Output sla file was not specified in " + filein);- return 1;- }- return run_compilation(specfilein, specfileout, compiler);- }}diff --git a/Ghidra/Processors/6502/data/build.xml b/Ghidra/Processors/6502/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/6502/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/68000/data/build.xml b/Ghidra/Processors/68000/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/68000/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/6805/data/build.xml b/Ghidra/Processors/6805/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/6805/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/8051/data/build.xml b/Ghidra/Processors/8051/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/8051/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/8085/data/build.xml b/Ghidra/Processors/8085/data/build.xmldeleted file mode 100644index 2164d961ae..0000000000--- a/Ghidra/Processors/8085/data/build.xml+++ /dev/null@@ -1,76 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleighCompile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="buildSleighClasspathDev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/SoftwareModeling/build/classes/main"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Generic/build/classes/main"/>- <pathelement location="${framework.path}/Utility/bin"/>- <pathelement location="${framework.path}/Utility/build/classes/main"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="buildSleighClasspathDist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleighCompile" depends="buildSleighClasspathDist, buildSleighClasspathDev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/AARCH64/data/build.xml b/Ghidra/Processors/AARCH64/data/build.xmldeleted file mode 100644index 7c1d69306c..0000000000--- a/Ghidra/Processors/AARCH64/data/build.xml+++ /dev/null@@ -1,76 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="-u"/>- <arg value="-t"/>- <arg value="-l"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/ARM/data/build.xml b/Ghidra/Processors/ARM/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/ARM/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/Atmel/data/build.xml b/Ghidra/Processors/Atmel/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/Atmel/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/CR16/data/build.xml b/Ghidra/Processors/CR16/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/CR16/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/DATA/data/build.xml b/Ghidra/Processors/DATA/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/DATA/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/JVM/data/build.xml b/Ghidra/Processors/JVM/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/JVM/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/MIPS/data/build.xml b/Ghidra/Processors/MIPS/data/build.xmldeleted file mode 100644index a6301d23ca..0000000000--- a/Ghidra/Processors/MIPS/data/build.xml+++ /dev/null@@ -1,74 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="-l"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/PA-RISC/data/build.xml b/Ghidra/Processors/PA-RISC/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/PA-RISC/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/PIC/data/build.xml b/Ghidra/Processors/PIC/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/PIC/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/PowerPC/data/build.xml b/Ghidra/Processors/PowerPC/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/PowerPC/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/Sparc/data/build.xml b/Ghidra/Processors/Sparc/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/Sparc/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/TI_MSP430/data/build.xml b/Ghidra/Processors/TI_MSP430/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/TI_MSP430/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/Toy/data/build.xml b/Ghidra/Processors/Toy/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/Toy/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/Z80/data/build.xml b/Ghidra/Processors/Z80/data/build.xmldeleted file mode 100644index 8f72019712..0000000000--- a/Ghidra/Processors/Z80/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/Ghidra/Processors/x86/data/build.xml b/Ghidra/Processors/x86/data/build.xmldeleted file mode 100644index b80b6d91fa..0000000000--- a/Ghidra/Processors/x86/data/build.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleigh-compile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="build-sleigh-classpath-dev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin/main"/>- <pathelement location="${framework.path}/Generic/bin/main"/>- <pathelement location="${framework.path}/Utility/bin/main"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="build-sleigh-classpath-dist" unless="devmode">- <property name="framework.path" value="../../../Framework"/>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleigh-compile" depends="build-sleigh-classpath-dist, build-sleigh-classpath-dev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/GhidraBuild/BuildFiles/certification.manifest b/GhidraBuild/BuildFiles/certification.manifestindex 40d82f7a77..95930675a6 100644--- a/GhidraBuild/BuildFiles/certification.manifest+++ b/GhidraBuild/BuildFiles/certification.manifest@@ -6,3 +6,5 @@ JsonDoclet/.project||GHIDRA||||END|JsonDoclet/Module.manifest||GHIDRA||||END|JsonDoclet/build.gradle||GHIDRA||||END|build.gradle||GHIDRA||||END|+sleighDevBuild.template||GHIDRA||||END|+sleighDistBuild.template||GHIDRA||||END|diff --git a/GhidraBuild/BuildFiles/sleighDevBuild.template b/GhidraBuild/BuildFiles/sleighDevBuild.templatenew file mode 100644index 0000000000..d81928bd61--- /dev/null+++ b/GhidraBuild/BuildFiles/sleighDevBuild.template@@ -0,0 +1,57 @@+<?xml version="1.0" encoding="UTF-8"?>++<!--+ + Compile sleigh languages within this source language module.+ + Sleigh compiler options are read from build/data/sleighArgs.txt which is+ + updated by "gradle prepdev" based upon specification within module's build.gradle.+ ++ + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"+ + From command line (requires ant install)+ + - cd to data directory containing this file+ + - run ant+ -->++<project name="privateBuildDeveloper" default="sleigh-compile">++ <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>++ <target name="sleigh-compile">++ <path id="sleigh.class.path">+ <pathelement path="${gradleSleighDevClasspath}"/>+ </path>++ <available classname="\${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>++ <fail unless="sleigh.compile.exists" />++ <!--+ NOTE: sleighArgs.txt contains sleigh compile which are established by build.gradle+ for the corresponding language module and output to this file with the execution of+ the gradle prepDev or distribution build tasks. The '-a' and '-i' options+ should not be specified by build.gradle. Other sleigh compile options may be specified+ within build.gradle by inclusion of the sleighCompile args following all+ 'apply' statements. Example:++ sleighCompile {+ args '-l'+ }++ Available options may be determined by executing the sleigh script.+ (see Ghidra/RuntimeScripts/Linux/support, Ghidra/RuntimeScripts/Windows/support)+ -->++ <java classname="\${sleigh.compile.class}"+ classpathref="sleigh.class.path"+ fork="true"+ failonerror="true">+ <jvmarg value="-Xmx2048M"/>+ <arg value="-i"/>+ <arg value="../build/data/sleighArgs.txt"/>+ <arg value="-a"/>+ <arg value="./languages"/>+ </java>++ </target>++</project>diff --git a/GhidraBuild/BuildFiles/sleighDistBuild.template b/GhidraBuild/BuildFiles/sleighDistBuild.templatenew file mode 100644index 0000000000..ec9976b7c3--- /dev/null+++ b/GhidraBuild/BuildFiles/sleighDistBuild.template@@ -0,0 +1,50 @@+<?xml version="1.0" encoding="UTF-8"?>++<!--+ + Compile sleigh languages within this distribution language module.+ + Sleigh compiler options are read from the sleighArgs.txt file.+ ++ + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"+ + From command line (requires ant install)+ + - cd to data directory containing this file+ + - run ant+ -->++<project name="privateBuildDistribution" default="sleigh-compile">++ <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>++ <target name="sleigh-compile">++ <property name="framework.path" value="../../../Framework"/>++ <path id="sleigh.class.path">+ <fileset dir="${framework.path}/SoftwareModeling/lib">+ <include name="*.jar"/>+ </fileset>+ <fileset dir="${framework.path}/Generic/lib">+ <include name="*.jar"/>+ </fileset>+ <fileset dir="${framework.path}/Utility/lib">+ <include name="*.jar"/>+ </fileset>+ </path>++ <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>++ <fail unless="sleigh.compile.exists" />++ <java classname="${sleigh.compile.class}"+ classpathref="sleigh.class.path"+ fork="true"+ failonerror="true">+ <jvmarg value="-Xmx2048M"/>+ <arg value="-i"/>+ <arg value="sleighArgs.txt"/>+ <arg value="-a"/>+ <arg value="./languages"/>+ </java>++ </target>++</project>diff --git a/GhidraBuild/Skeleton/certification.manifest b/GhidraBuild/Skeleton/certification.manifestindex 25a6ffeb28..89c984df68 100644--- a/GhidraBuild/Skeleton/certification.manifest+++ b/GhidraBuild/Skeleton/certification.manifest@@ -12,6 +12,7 @@ data/languages/skel.opinion||GHIDRA||||END|data/languages/skel.pspec||GHIDRA||||END|data/languages/skel.sinc||GHIDRA||||END|data/languages/skel.slaspec||GHIDRA||||END|+data/sleighArgs.txt||GHIDRA||||END|extension.properties||GHIDRA||||END|ghidra_scripts/README.txt||GHIDRA||||END|lib/README.txt||GHIDRA||||END|diff --git a/GhidraBuild/Skeleton/data/build.xml b/GhidraBuild/Skeleton/data/build.xmldeleted file mode 100644index b83278c5e4..0000000000--- a/GhidraBuild/Skeleton/data/build.xml+++ /dev/null@@ -1,80 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>--<!--- + Compile sleigh languages within this module.- + Eclipse: right-click on this file and choose menu item "Run As->Ant Build"- + From command line (requires ant install)- + - cd to data directory containing this file- + - run ant- -->--<project name="privateBuildDeveloper" default="sleighCompile">-- <property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>-- <property name="repo.dir" value="../../../.." />- <property name="repo.marker.dir" value="${repo.dir}/.git" />-- <!--Import optional ant properties. GhidraDev Eclipse plugin produces this so this file can find the Ghidra installation-->- <import file="../.antProperties.xml" optional="true" />-- <condition property="devmode">- <available file="${repo.marker.dir}" type="dir" />- </condition>-- <target name="buildSleighClasspathDev" if="devmode">-- <property name="framework.path" value="${repo.dir}/../ghidra.git/Ghidra/Framework"/>- <property name="libs.path" value="${repo.dir}/../ghidra.bin.git/ExternalLibraries/libsForRuntime"/>-- <path id="sleigh.class.path">- <pathelement location="${framework.path}/SoftwareModeling/bin"/>- <pathelement location="${framework.path}/Generic/bin"/>- <pathelement location="${framework.path}/Utility/bin"/>- <fileset dir="${libs.path}">- <include name="*.jar"/>- </fileset>- </path>-- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="buildSleighClasspathDist" unless="devmode">-- <!-- If language module is detached from installation, get Ghidra installation directory path from imported properties -->- <condition property="framework.path" value="${ghidra.install.dir}/Ghidra/Framework" else="../../../Framework">- <available file="${ghidra.install.dir}" type="dir" />- </condition>-- <path id="sleigh.class.path">- <fileset dir="${framework.path}/SoftwareModeling/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Generic/lib">- <include name="*.jar"/>- </fileset>- <fileset dir="${framework.path}/Utility/lib">- <include name="*.jar"/>- </fileset>- </path>- <available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>-- </target>-- <target name="sleighCompile" depends="buildSleighClasspathDist, buildSleighClasspathDev">-- <fail unless="sleigh.compile.exists" />-- <java classname="${sleigh.compile.class}"- classpathref="sleigh.class.path"- fork="true"- failonerror="true">- <jvmarg value="-Xmx2048M"/>- <arg value="-a"/>- <arg value="./languages"/>- </java>-- </target>--</project>diff --git a/GhidraBuild/Skeleton/data/sleighArgs.txt b/GhidraBuild/Skeleton/data/sleighArgs.txtnew file mode 100644index 0000000000..ce06926358--- /dev/null+++ b/GhidraBuild/Skeleton/data/sleighArgs.txt@@ -0,0 +1,6 @@+# Add sleigh compiler options to this file (one per line) which will+# be used when compiling each language within this module.+# All options should start with a '-' character.+#+# IMPORTANT: The -a option should NOT be specified+#\ No newline at end of filediff --git a/gradleScripts/distribution.gradle b/gradleScripts/distribution.gradleindex 69df51a986..7aaf03b2f4 100644--- a/gradleScripts/distribution.gradle+++ b/gradleScripts/distribution.gradle@@ -223,6 +223,7 @@ task assembleCommon (type: Copy) {from (p.projectDir.toString() + "/data") {into { getZipPath(p) + "/data" }+ exclude 'build.xml' // associated with language modules (dev use only)}from (BIN_REPO + '/' + getZipPath(p) + "/data") {@@ -697,6 +698,7 @@ subprojects { p ->exclude 'bin/**'exclude 'src/**'exclude 'test/**'+ exclude 'data/build.xml'exclude 'developer_scripts'// general place where extension modules can put files that won't getdiff --git a/gradleScripts/ip.gradle b/gradleScripts/ip.gradleindex 16b0c91b08..18a778c275 100644--- a/gradleScripts/ip.gradle+++ b/gradleScripts/ip.gradle@@ -120,6 +120,7 @@ def Map<String, List<String>> getIpForModule(Project p) {exclude "build.gradle"exclude "**/Misc/Tips.htm"exclude "**/*.sla"+ exclude "**/data/build.xml" // language build file (generated for dev only)exclude "**/.gradle/**"exclude "**/.settings/**"exclude "**/.vs/**"diff --git a/gradleScripts/processorUtils.gradle b/gradleScripts/processorUtils.gradleindex 99bb843875..7d83c68ccc 100644--- a/gradleScripts/processorUtils.gradle+++ b/gradleScripts/processorUtils.gradle@@ -1,4 +1,3 @@-/******************************************************************************************* Create a configuration so the a dependency can be declared on the the software modeling@@ -14,6 +13,64 @@ dependencies {sleighConfig project(':SoftwareModeling')}+/*****************************************************************************************+ *+ * Task to write sleigh compiler args to build/data/sleighArgs.txt for use with sleigh+ * external sleigh compiler.+ *+ *****************************************************************************************/+task saveSleighArgs {+ def sleighArgsFile = file("build/data/sleighArgs.txt")+ outputs.files sleighArgsFile+ outputs.upToDateWhen { false }+ doLast {+ sleighArgsFile.withWriter { out->+ project.sleighCompile.args.each { a->+ // don't save -a option+ if (!"-a".equals(a)) {+ out.println a+ }+ }+ }+ }+}++prepDev.dependsOn(saveSleighArgs)++/*****************************************************************************************+ *+ * Task to write sleigh build.xml file for use is development mode only.+ *+ *****************************************************************************************/+task writeSleighDevBuild {+ def templateFilePath = project(':BuildFiles').projectDir.toString() + "/sleighDevBuild.template"+ doLast {+ // Generate build.xml with injected classpath for running sleigh compiler+ copy {+ into "data"+ from (templateFilePath) {+ rename { "build.xml" }+ expand ( [ 'gradleSleighDevClasspath': project(':SoftwareModeling').sleighDevClasspath ] )+ }+ }+ }+}++prepDev.dependsOn(writeSleighDevBuild)++/*****************************************************************************************+ *+ * Write sleigh build.xml file for each language module into assembleCommon+ *+ *****************************************************************************************/+rootProject.assembleCommon {+ into (getZipPath(this.project) + "/data") {+ from (rootProject.projectDir.toString() + "/GhidraBuild/BuildFiles/sleighDistBuild.template") {+ rename { "build.xml" }+ }+ }+}+/******************************************************************************************* Task to compile language files using the sleigh compiler.@@ -22,17 +79,16 @@ dependencies {task sleighCompile (type: JavaExec) {group = rootProject.GHIDRA_GROUPdescription " Compiles all the sleigh languages. [processorUtils.gradle]\n"-+// define standard parameters for JavaExecclasspath configurations.sleighConfigmain = 'ghidra.pcodeCPort.slgh_compile.SleighCompile'- args '-a'-// Delay adding the directory argument until the first part of the execution phase, so// that any extra args added by a project override will be added to the arg list before- // this argument.+ // these arguments.doFirst {+ args '-a'args './data/languages'}@@ -40,8 +96,9 @@ task sleighCompile (type: JavaExec) {}// The task that copies the common files to the distribution folder must depend on-// this sleigh task before executing.+// the sleigh tasks before executing.rootProject.assembleCommon.dependsOn(sleighCompile)+rootProject.assembleCommon.dependsOn(saveSleighArgs)// For all tasks of type:Test (i.e., integrationTest, cunitTest, etc.), add a task dependency to// sleighCompile. The sleighCompile task inputs and outputs are defined such that the *.slaspec@@ -52,8 +109,9 @@ rootProject.assembleCommon.dependsOn(sleighCompile)// modules as seen in the use of ghidra.test.ToyProgramBuilder.// The tasks of type:Test do not know about sleighCompile during their configuration phase, so the// dependency must be done in this gradle file.-rootProject.subprojects.findAll { subproject ->- if (!isSupportModule(subproject)) {+rootProject.subprojects.findAll { subproject ->+ boolean isSupporProject = subproject.findProperty("isSupportProject") ?: false;+ if (!isSupporProject) {subproject.tasks.withType(Test).all {it.dependsOn(sleighCompile)}@@ -91,26 +149,9 @@ def taskOutputs = fileTree(dir: 'data/languages', include: '**/*.sla')sleighCompile.inputs.files (taskInputs)sleighCompile.outputs.files (taskOutputs)-task eclipseSleighLauncher(type: WriteEclipseLauncher) {- dest = forName("Sleigh $project.name")- isRunFave = true- isDbgFave = false-- classpath = configurations.sleighConfig- main 'ghidra.pcodeCPort.slgh_compile.SleighCompile'-- args '-a'-- // Delay adding the directory argument until the first part of the execution phase, so- // that any extra args added by a project override will be added to the arg list before- // this argument.- doFirst {- args './data/languages'- }-- jvmArgs '-Xmx2048M'-}+// define the sleigh compile inputs to saveSleighArgs to limit task creation to language modules+saveSleighArgs.inputs.files (taskInputs)def isSupportModule(Project p) {return p.findProperty("isSupportProject") ?: false-}\ No newline at end of file+}