Another GDB stub implemented in Python3
Project description
Another GDB stub implemented in Python3
Setup
# Install and compile urjtag (for Microwatt)
apt install libusb-1.0-0-dev libftdi1-dev python3-dev
git clone -b ftdi-arty https://github.com/shingarov/urjtag.git
cd urjtag/urjtag
PYTHON=python3 ./configure --enable-python --without-ftd2xx
make -j$(nproc)
cd ../..
# Clone this repository
git clone https://github.com/janvrany/pygdbstub.git
cd pygdbstub
# Create virtual environment for pygdbstub
virtualenv --prompt "pygdbstub" .venv
echo "export LD_LIBRARY_PATH=$(realpath ../urjtag/urjtag/src/.libs)" >> .venv/bin/activate
source .venv/bin/activate
# Install dependencies
pip3 install -r requirements-dev.txt
pip3 install ../urjtag/urjtag/bindings/python
# Setup pre-commit and pre-push hooks (if you want)
pre-commit install -t pre-commit
pre-commit install -t pre-push
Usage examples
Using TCP port
.venv/bin/python -m pygdbstub -t microwatt -b Genesys2 -p 7000
- run pygdbstub (
-m pygdbstub) - connect to Microwatt on Digilent Genesys2 FPGA boatd (
-t microwatt -b Genesys2) - listen on localhost, port 7000 (
-p 7000)
Then in GDB, connect to stub like:
(gdb) set arch powerpc:common64
(gdb) target remote :7000
Starting pygdbstub directly from GDB
(gdb) set arch powerpc:common64
(gdb) target remote | .venv/bin/python -m pygdbstub -t microwatt
- run pygdbstub (
-m pygdbstub) - connect to Microwatt on Arty FPGA (
-t microwatt, Arty is default board for Microwatt target) - use stdio to communicate with GDB (default)
For developers
Running tests
To run tests, just run:
pytest
Debugging communication
Some hints to help debugging communication between GDB and pygdbstub:
-
In GDB, turn on remote protocol debugging:
set debug remote 1 -
If you really want to see the exact bytes going back and forth, run stub using
socat:socat -v tcp4-listen:7007,reuseaddr,fork 'exec:python3 -m pygdbstub'and then in GDB, connect to port 7007:
target remote :7007
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygdbstub_neo-0.0.1.2.tar.gz.
File metadata
- Download URL: pygdbstub_neo-0.0.1.2.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75dd3a4a733d5d4ffd17475745cc438882fac29c256e79adc6742f66f5b9784e
|
|
| MD5 |
33d06141acaeebbb5833b7d39e16b721
|
|
| BLAKE2b-256 |
636d429859d27b9b3614cd891a22e5fb17976b6f11a203b9702a28bfbf11b214
|
Provenance
The following attestation bundles were made for pygdbstub_neo-0.0.1.2.tar.gz:
Publisher:
publish.yml on XuNeo/pygdbstub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygdbstub_neo-0.0.1.2.tar.gz -
Subject digest:
75dd3a4a733d5d4ffd17475745cc438882fac29c256e79adc6742f66f5b9784e - Sigstore transparency entry: 158205404
- Sigstore integration time:
-
Permalink:
XuNeo/pygdbstub@746eaa157b8b39229c1183d0d3a2bf5789337e77 -
Branch / Tag:
refs/tags/v0.0.1.2 - Owner: https://github.com/XuNeo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@746eaa157b8b39229c1183d0d3a2bf5789337e77 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pygdbstub_neo-0.0.1.2-py3-none-any.whl.
File metadata
- Download URL: pygdbstub_neo-0.0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a813fde91ef476eef0c37ff259718c7af40c07b332086ad659d069fe2f8a8e36
|
|
| MD5 |
6f20392da0935ddc550a5522b6bff0fe
|
|
| BLAKE2b-256 |
0465fd2a82d0851374a7a69a47346223cc70bcad4f5a76103ec4ee3583d437e4
|
Provenance
The following attestation bundles were made for pygdbstub_neo-0.0.1.2-py3-none-any.whl:
Publisher:
publish.yml on XuNeo/pygdbstub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygdbstub_neo-0.0.1.2-py3-none-any.whl -
Subject digest:
a813fde91ef476eef0c37ff259718c7af40c07b332086ad659d069fe2f8a8e36 - Sigstore transparency entry: 158205405
- Sigstore integration time:
-
Permalink:
XuNeo/pygdbstub@746eaa157b8b39229c1183d0d3a2bf5789337e77 -
Branch / Tag:
refs/tags/v0.0.1.2 - Owner: https://github.com/XuNeo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@746eaa157b8b39229c1183d0d3a2bf5789337e77 -
Trigger Event:
release
-
Statement type: