Merge remote-tracking branch 'origin/Ghidra_9.0'

This commit is contained in:
ghidra1 2019-03-29 18:01:04 -04:00
commit 3a27a22fed
42 changed files with 389 additions and 1814 deletions

1
.gitignore vendored
View File

@ -23,6 +23,7 @@ ghidra.repos.config
**/dist
repositories/
*.sla
**/data/build.xml
# Misc files
*.setting

View File

@ -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>

View File

@ -75,9 +75,9 @@ of Visual Studio and DIA SDK.</li>
<p>First, check to see if you already have the <i>msdia140.dll</i> library installed on your system.
It is generally installed installed with Microsoft Visual Studio 2017 when C/C++ development support
is included.
is included (<DISTRO> may be Community, Professional, or other VS 2017 distribution package name).
<pre>
C:\\Program Files (x86)\Microsoft Visual Studio\2017\DIA SDK\bin\amd64\msdia140.dll
C:\Program Files (x86)\Microsoft Visual Studio\2017\<DISTRO>\DIA SDK\bin\amd64\msdia140.dll
</pre>
<p>This file is commonly located here, although it may be installed in other locations as well. Any 64-bit
copy may be registered provided it is the correct version. There is no need to register more than
@ -86,8 +86,8 @@ one.
<h3>Register 'msdia140.dll' in the Windows registry</h3>
<p>Please register 64-bit <i>msdia140.dll</i> even if you already had a copy of it on your computer
since it is not registered by the Visual Studio installation process. You will need administrative rights/privileges in order to register the DLL in the Windows
registry.
since it is not registered by the Visual Studio installation process. You will need administrative
rights/privileges in order to register the DLL in the Windows registry.
<blockquote>
<ol>
<li>Start a command prompt as an administrator:</li>

View File

@ -576,6 +576,9 @@ public class PdbParserNEW {
}
catch (Exception e) {
if (!isXML) {
if (hasErrors()) {
throw new PdbException(getErrorAndWarningMessages());
}
throw new PdbException("PDB Execution failure of " + PDB_EXE + ".\n" +
"This was likely caused by severe execution failure which can occur if executed\n" +
"on an unsupported platform. It may be neccessary to rebuild the PDB executable\n" +

View File

@ -1,6 +1,5 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -26,9 +25,7 @@ void warning( const char * msg )
void fatal( const char * msg )
{
fprintf( stderr, "ERROR:\n" );
fprintf( stderr, msg );
fprintf( stderr, "\n" );
fprintf( stderr, "ERROR: %s\n", msg );
exit( -1 );
}

View File

@ -46,9 +46,8 @@ int init(const char * szFilename, const char * szSignature, const char * szAge)
if (hr < 0) {
switch (hr) {
case REGDB_E_CLASSNOTREG:
fatal("Unable to locate the DIA SDK. It is required to load PDB files.\n\n" \
"* Open {Ghidra install root}/docs/README_PDB.html\n"
" and follow the instructions therein.\n");
fatal("Unable to locate the DIA SDK. It is required to load PDB files.\n" \
"* See docs/README_PDB.html for DLL registration instructions.\n");
break;
default:
char msg[256];

View File

@ -72,7 +72,7 @@
<PostBuildEvent>
<Command>
rem copy /y /v /b "$(VSInstallDir)DIA SDK\bin\amd64\msdia*.dll" "$(OutDir)"
set OS_DIR="$(SolutionDir)..\..\os"
set OS_DIR=$(SolutionDir)..\..\os
if exist "%OS_DIR%\win64" (
mkdir "%OS_DIR%"
mkdir "%OS_DIR%\win64"
@ -104,7 +104,7 @@ if exist "%OS_DIR%\win64" (
<PostBuildEvent>
<Command>
rem copy /y /v /b "$(VSInstallDir)DIA SDK\bin\amd64\msdia*.dll" "$(OutDir)"
set OS_DIR="$(SolutionDir)..\..\os"
set OS_DIR=$(SolutionDir)..\..\os
if exist "%OS_DIR%\win64" (
mkdir "%OS_DIR%"
mkdir "%OS_DIR%\win64"

View File

@ -461,8 +461,8 @@ public class Application {
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(),
@ -471,7 +471,8 @@ public class Application {
// Allow win32 to be used for win64 as fallback
if (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,7 +493,8 @@ 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);
@ -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();

View File

@ -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 &quot;${project_loc}/data/languages&quot;"/>
<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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry path=&quot;5&quot; projectName=&quot;Framework Utility&quot; type=&quot;1&quot;/&gt;&#10;"/>
</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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11&quot; path=&quot;4&quot; type=&quot;4&quot;/&gt;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="ghidra.pcodeCPort.slgh_compile.SleighCompileLauncher -i &quot;${project_loc}/build/data/sleighArgs.txt&quot; -a &quot;${project_loc}/data/languages&quot;"/>
<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=&quot;Sleigh&quot; -Dvisualvm.display.name=Sleigh"/>
</launchConfiguration>

View File

@ -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 {

View File

@ -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");

View File

@ -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>()));
}
}

View File

@ -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 {
@Override
public 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:on
return 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 compile
SleighCompile 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);
}
// cout << "fileinPreExt = " << fileinPreExt << endl;
filein = baseName + FILE_IN_DEFAULT_EXT;
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);
String baseOutName = fileout;
if (fileout == null) {
baseOutName = baseName;
}
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);
}
else {
retval = run_xml(filein, 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;
}
return retval;
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");
}
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 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);
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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|

View File

@ -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>

View File

@ -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>

View File

@ -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|

View File

@ -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>

View File

@ -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
#

View File

@ -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 get

View File

@ -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/**"

View File

@ -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.
@ -27,12 +84,11 @@ task sleighCompile (type: JavaExec) {
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.
// 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
@ -53,7 +110,8 @@ rootProject.assembleCommon.dependsOn(sleighCompile)
// 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)) {
boolean isSupporProject = subproject.findProperty("isSupportProject") ?: false;
if (!isSupporProject) {
subproject.tasks.withType(Test).all {
it.dependsOn(sleighCompile)
}
@ -91,25 +149,8 @@ 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