GP-0: Some README.md and DevGuide.md updates for PyGhidra and VSCode

This commit is contained in:
Ryan Kurtz 2025-01-03 09:03:23 -05:00
parent 20285e267d
commit a1f243ebba
2 changed files with 32 additions and 7 deletions

View file

@ -2,7 +2,7 @@
## Environment ## Environment
* Primary Language: [Java][java] * Primary Language: [Java][java]
* Secondary Languages: [C++][cpp], [Sleigh][sleigh], [Jython][jython] * Secondary Languages: [C++][cpp], [Sleigh][sleigh], [Python 3][python] [Jython 2.7][jython]
* Integrated Development Environment: [Eclipse][eclipse] * Integrated Development Environment: [Eclipse][eclipse]
* Build System: [Gradle][gradle] * Build System: [Gradle][gradle]
* Source Control: [Git][git] * Source Control: [Git][git]
@ -62,7 +62,7 @@ Build Javadoc:
gradle createJavadocs gradle createJavadocs
``` ```
Build Python3 packages for the Debugger: Build Python3 packages for PyGhidra and the Debugger:
``` ```
gradle buildPyPackage gradle buildPyPackage
``` ```
@ -87,6 +87,25 @@ prevent specific tasks from running:
gradle buildGhidra -x ip gradle buildGhidra -x ip
``` ```
## PyGhidra
The supported way to develop and debug PyGhidra is with the _[PyDev][pydev]_ plugin for Eclipse.
When PyDev is installed and configured, several new Eclipse run configurations will appear that
enable running and debugging PyGhidra from both _GUI_ and _Interpreter_ modes.
When you perform a `gradle prepdev`, a Python virtual environment gets setup at `build/venv/`. PyDev
should be pointed at this virtual environment so it has access to the editable PyGhidra module, as
well as the typing/stub information. From Eclipse (with PyDev installed):
1. _Settings -> PyDev -> Interpreters -> Python Interpreter_
2. Click _New..._
3. Click _Browse for python/pypy exe_
4. Choose `build/venv/bin/python3`
5. Enter a value for _Interpreter Name_
6. Check _Select All_ and press _OK_
7. Click the _Prefined_ tab, and then _New..._
8. Choose `build/typestubs/pypredef`
9. Click _Apply and Close_
## Known Issues ## Known Issues
* There is a known issue in Gradle that can prevent it from discovering native toolchains on Linux * There is a known issue in Gradle that can prevent it from discovering native toolchains on Linux
if a non-English system locale is being used. As a workaround, set the following environment if a non-English system locale is being used. As a workaround, set the following environment
@ -111,10 +130,10 @@ along with the rest of the repo.
Developing the GhidraDev Eclipse plugin requires the Developing the GhidraDev Eclipse plugin requires the
_Eclipse PDE (Plug-in Development Environment)_, which can be installed via the Eclipse marketplace. _Eclipse PDE (Plug-in Development Environment)_, which can be installed via the Eclipse marketplace.
It is also included in the _Eclipse IDE for RCP and RAP Developers_. To generate the GhidraDev It is also included in the _Eclipse IDE for RCP and RAP Developers_. To generate the GhidraDev
Eclipse projects, execute: Eclipse projects and prepare the necessary dependencies, execute:
``` ```
gradle eclipse -PeclipsePDE gradle prepGhidraDev eclipse -PeclipsePDE
``` ```
Import the newly generated GhidraDev projects into an Eclipse that supports this type of project. Import the newly generated GhidraDev projects into an Eclipse that supports this type of project.
@ -345,8 +364,10 @@ When submitting help tickets and pull requests, please tag those related to the
[java]: https://dev.java [java]: https://dev.java
[cpp]: https://isocpp.org [cpp]: https://isocpp.org
[sleigh]: https://htmlpreview.github.io/?https://github.com/NationalSecurityAgency/ghidra/blob/master/GhidraDocs/languages/index.html [sleigh]: https://htmlpreview.github.io/?https://github.com/NationalSecurityAgency/ghidra/blob/master/GhidraDocs/languages/index.html
[python]: https://www.python.org
[jython]: https://www.jython.org [jython]: https://www.jython.org
[eclipse]: https://www.eclipse.org/downloads/ [eclipse]: https://www.eclipse.org/downloads/
[pydev]: https://www.pydev.org
[gradle]: https://gradle.org [gradle]: https://gradle.org
[git]: https://git-scm.com [git]: https://git-scm.com
[apache]: https://www.apache.org/licenses/LICENSE-2.0 [apache]: https://www.apache.org/licenses/LICENSE-2.0

View file

@ -87,10 +87,14 @@ For issues building, please check the [Known Issues][known-issues] section for p
### User Scripts and Extensions ### User Scripts and Extensions
Ghidra installations support users writing custom scripts and extensions via the *GhidraDev* plugin Ghidra installations support users writing custom scripts and extensions via the *GhidraDev* plugin
for Eclipse. The plugin and its corresponding instructions can be found within a Ghidra release at for Eclipse. The plugin and its corresponding instructions can be found within a Ghidra release at
`Extensions/Eclipse/GhidraDev/` or at [this link][ghidradev]. `Extensions/Eclipse/GhidraDev/` or at [this link][ghidradev]. Alternatively, Visual Studio Code may
be used to edit scripts by clicking the Visual Studio Code icon in the Script Manager.
Fully-featured Visual Studio Code projects can be created from a Ghidra CodeBrowser window at
_Tools -> Create VSCode Module project_.
**NOTE:** The *GhidraDev* plugin for Eclipse only supports developing against fully built **NOTE:** Both the *GhidraDev* plugin for Eclipse and Visual Studio Code integrations only support
Ghidra installations which can be downloaded from the [Releases][releases] page. developing against fully built Ghidra installations which can be downloaded from the
[Releases][releases] page.
### Advanced Development ### Advanced Development
To develop the Ghidra tool itself, it is highly recommended to use Eclipse, which the Ghidra To develop the Ghidra tool itself, it is highly recommended to use Eclipse, which the Ghidra