Name | pygdbstub-neo JSON |
Version |
0.0.1.2
JSON |
| download |
home_page | None |
Summary | Another GDB stub implemented in Python3 |
upload_time | 2024-12-30 08:10:22 |
maintainer | None |
docs_url | None |
author | Jan Vraný |
requires_python | None |
license | None |
keywords |
gdb
stub
python
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Another GDB stub implemented in Python3
## Setup
```sh
# 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
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pygdbstub-neo",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "gdb, stub, python",
"author": "Jan Vran\u00fd",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/63/6d/429859d27b9b3614cd891a22e5fb17976b6f11a203b9702a28bfbf11b214/pygdbstub_neo-0.0.1.2.tar.gz",
"platform": null,
"description": "# Another GDB stub implemented in Python3\n\n## Setup\n```sh\n# Install and compile urjtag (for Microwatt)\napt install libusb-1.0-0-dev libftdi1-dev python3-dev\ngit clone -b ftdi-arty https://github.com/shingarov/urjtag.git\ncd urjtag/urjtag\nPYTHON=python3 ./configure --enable-python --without-ftd2xx\nmake -j$(nproc)\ncd ../..\n\n# Clone this repository\ngit clone https://github.com/janvrany/pygdbstub.git\ncd pygdbstub\n\n# Create virtual environment for pygdbstub\nvirtualenv --prompt \"pygdbstub\" .venv\necho \"export LD_LIBRARY_PATH=$(realpath ../urjtag/urjtag/src/.libs)\" >> .venv/bin/activate\nsource .venv/bin/activate\n\n# Install dependencies\npip3 install -r requirements-dev.txt\npip3 install ../urjtag/urjtag/bindings/python\n\n# Setup pre-commit and pre-push hooks (if you want)\npre-commit install -t pre-commit\npre-commit install -t pre-push\n```\n\n## Usage examples\n\n### Using TCP port\n\n```\n.venv/bin/python -m pygdbstub -t microwatt -b Genesys2 -p 7000\n```\n\n* run *pygdbstub* (`-m pygdbstub`)\n* connect to Microwatt on Digilent Genesys2 FPGA boatd (`-t microwatt -b Genesys2`)\n* listen on localhost, port 7000 (`-p 7000`)\n\nThen in GDB, connect to stub like:\n\n```\n(gdb) set arch powerpc:common64\n(gdb) target remote :7000\n```\n\n### Starting *pygdbstub* directly from GDB\n\n```\n(gdb) set arch powerpc:common64\n(gdb) target remote | .venv/bin/python -m pygdbstub -t microwatt\n```\n\n* run *pygdbstub* (`-m pygdbstub`)\n* connect to Microwatt on Arty FPGA (`-t microwatt`, Arty is default board for Microwatt target)\n* use stdio to communicate with GDB (default)\n\n## For developers\n\n### Running tests\n\nTo run tests, just run:\n\n```\npytest\n```\n\n### Debugging communication\n\nSome hints to help debugging communication between GDB and pygdbstub:\n\n * In GDB, turn on remote protocol debugging:\n\n ```\n set debug remote 1\n ```\n\n * If you really want to see the exact bytes going back and forth, run\n stub using `socat`:\n\n ```\n socat -v tcp4-listen:7007,reuseaddr,fork 'exec:python3 -m pygdbstub'\n ```\n\n and then in GDB, connect to port 7007:\n\n ```\n target remote :7007\n ```\n",
"bugtrack_url": null,
"license": null,
"summary": "Another GDB stub implemented in Python3",
"version": "0.0.1.2",
"project_urls": null,
"split_keywords": [
"gdb",
" stub",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0465fd2a82d0851374a7a69a47346223cc70bcad4f5a76103ec4ee3583d437e4",
"md5": "6f20392da0935ddc550a5522b6bff0fe",
"sha256": "a813fde91ef476eef0c37ff259718c7af40c07b332086ad659d069fe2f8a8e36"
},
"downloads": -1,
"filename": "pygdbstub_neo-0.0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f20392da0935ddc550a5522b6bff0fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18673,
"upload_time": "2024-12-30T08:10:21",
"upload_time_iso_8601": "2024-12-30T08:10:21.186107Z",
"url": "https://files.pythonhosted.org/packages/04/65/fd2a82d0851374a7a69a47346223cc70bcad4f5a76103ec4ee3583d437e4/pygdbstub_neo-0.0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "636d429859d27b9b3614cd891a22e5fb17976b6f11a203b9702a28bfbf11b214",
"md5": "33d06141acaeebbb5833b7d39e16b721",
"sha256": "75dd3a4a733d5d4ffd17475745cc438882fac29c256e79adc6742f66f5b9784e"
},
"downloads": -1,
"filename": "pygdbstub_neo-0.0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "33d06141acaeebbb5833b7d39e16b721",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18750,
"upload_time": "2024-12-30T08:10:22",
"upload_time_iso_8601": "2024-12-30T08:10:22.524500Z",
"url": "https://files.pythonhosted.org/packages/63/6d/429859d27b9b3614cd891a22e5fb17976b6f11a203b9702a28bfbf11b214/pygdbstub_neo-0.0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-30 08:10:22",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pygdbstub-neo"
}