mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
PyDev source directory can now be found in the Eclipse dropins directory
Updating GhidraDev version to 2.1.1
This commit is contained in:
parent
02e017f507
commit
30df737334
5 changed files with 42 additions and 15 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site>
|
||||
<feature url="features/ghidra.ghidradev_2.1.0.qualifier.jar" id="ghidra.ghidradev" version="2.1.0.qualifier">
|
||||
<feature url="features/ghidra.ghidradev_2.1.1.qualifier.jar" id="ghidra.ghidradev" version="2.1.1.qualifier">
|
||||
<category name="ghidra.ghidradev"/>
|
||||
</feature>
|
||||
<category-def name="ghidra.ghidradev" label="Ghidra"/>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<feature
|
||||
id="ghidra.ghidradev"
|
||||
label="GhidraDev"
|
||||
version="2.1.0.qualifier"
|
||||
version="2.1.1.qualifier"
|
||||
provider-name="Ghidra">
|
||||
|
||||
<description>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<h1>GhidraDev README</h1>
|
||||
<p>GhidraDev provides support for developing and debugging Ghidra scripts and modules in Eclipse.
|
||||
</p>
|
||||
<p>The information provided in this document is effective as of GhidraDev 2.1.0 and is subject to
|
||||
<p>The information provided in this document is effective as of GhidraDev 2.1.1 and is subject to
|
||||
change with future releases.</p>
|
||||
|
||||
<ul>
|
||||
|
@ -53,6 +53,8 @@ change with future releases.</p>
|
|||
</ul>
|
||||
|
||||
<h2><a name="ChangeHistory"></a>Change History</h2>
|
||||
<p><u><b>2.1.1</b>:</u> Python debugging now works when PyDev is installed via the Eclipse "dropins"
|
||||
directory.</p>
|
||||
<p><u><b>2.1.0</b>:</u>
|
||||
<ul>
|
||||
<li>
|
||||
|
|
|
@ -3,7 +3,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: GhidraDev
|
||||
Bundle-SymbolicName: ghidra.ghidradev;singleton:=true
|
||||
Bundle-Version: 2.1.0.qualifier
|
||||
Bundle-Version: 2.1.1.qualifier
|
||||
Bundle-Activator: ghidradev.Activator
|
||||
Require-Bundle: org.eclipse.ant.core;bundle-version="3.5.200",
|
||||
org.eclipse.buildship.core;bundle-version="3.0.0",
|
||||
|
|
|
@ -16,14 +16,27 @@
|
|||
package ghidradev.ghidraprojectcreator.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.naming.OperationNotSupportedException;
|
||||
|
||||
import org.eclipse.core.runtime.*;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
|
||||
import ghidradev.Activator;
|
||||
|
||||
/**
|
||||
* Utility methods for interacting with PyDev.
|
||||
*/
|
||||
|
@ -142,21 +155,33 @@ public class PyDevUtils {
|
|||
* Gets The PyDev source directory.
|
||||
*
|
||||
* @return The PyDev source directory, or null if it was not found.
|
||||
* @throws CoreException if there was a problem searching for the PyDev source directory.
|
||||
*/
|
||||
public static File getPyDevSrcDir() {
|
||||
public static File getPyDevSrcDir() throws CoreException {
|
||||
String eclipsePath = Platform.getInstallLocation().getURL().getFile();
|
||||
File pluginsDir = new File(eclipsePath, "plugins");
|
||||
File[] pluginSubDirs = pluginsDir.listFiles(File::isDirectory);
|
||||
if (pluginSubDirs != null) {
|
||||
for (File dir : pluginSubDirs) {
|
||||
if (dir.getName().startsWith("org.python.pydev")) {
|
||||
File pysrcDir = new File(dir, "pysrc");
|
||||
if (pysrcDir.isDirectory()) {
|
||||
return pysrcDir;
|
||||
}
|
||||
|
||||
List<File> searchDirs = new ArrayList<>();
|
||||
searchDirs.add(new File(eclipsePath, "plugins"));
|
||||
searchDirs.add(new File(eclipsePath, "dropins"));
|
||||
|
||||
for (File searchRoot : searchDirs) {
|
||||
try (Stream<Path> paths = Files.walk(Paths.get(searchRoot.toURI()))) {
|
||||
Optional<File> pysrcDir = paths.filter(
|
||||
Files::isDirectory)
|
||||
.filter(p -> p.endsWith("pysrc"))
|
||||
.map(p -> p.toFile())
|
||||
.filter(f -> f.getParentFile().getName().startsWith("org.python.pydev"))
|
||||
.findFirst();
|
||||
if (pysrcDir.isPresent()) {
|
||||
return pysrcDir.get();
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
|
||||
IStatus.ERROR, "Problem searching for PyDev source directory", e));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue