Move GEF to a Python 3.10 baseline (#1133)

## Description

Move GEF to a Python 3.10 baseline

Fixes #1132

---------

Co-authored-by: Grazfather <[email protected]>
This commit is contained in:
crazy hugsy
2024-09-25 21:27:55 -07:00
committed by GitHub
co-authored by Grazfather
parent f298b7fb27
commit 115137cc05
8 changed files with 24 additions and 21 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
runner: [ubuntu-24.04, ubuntu-22.04]
name: "Run Unit tests on ${{ matrix.runner }}"
runs-on: ${{ matrix.runner }}
+1 -1
View File
@@ -52,7 +52,7 @@ persistent=yes
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.6
py-version=3.10
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
+1
View File
@@ -0,0 +1 @@
3.10.14
+1 -1
View File
@@ -17,7 +17,7 @@ from the debugging runtime.
## Instant Setup
Simply make sure you have [GDB 8.0 or higher](https://www.gnu.org/s/gdb) compiled with Python3.6+
Simply make sure you have [GDB 10.0 or higher](https://www.gnu.org/s/gdb) compiled with Python3.10+
bindings, then:
```bash
+3 -5
View File
@@ -2,11 +2,9 @@
This matrix indicates the version of Python and/or GDB
| GEF version | GDB Python compatibility* | Python compatibility** |
| GEF version | GDB Python compatibility | Python compatibility |
|:--:|:--:|:--:|
| [2018.02](https://github.com/hugsy/gef/releases/tag/2018.02) | 7.2 | Python 2.7, Python 3.4+ |
| [2020.03](https://github.com/hugsy/gef/releases/tag/2020.03) | 7.4 | Python 2.7, Python 3.4+ |
| [2022.01](https://github.com/hugsy/gef/releases/tag/2021.01) | 7.7 | Python 3.4+ |
| [Current](https://github.com/hugsy/gef/tree/main) | 8.0+ | Python 3.6+ |
** Up to (included)
| [2022.01](https://github.com/hugsy/gef/releases/tag/2022.01) | 8.0 | Python 3.6+ |
| [2024.09](https://github.com/hugsy/gef/releases/tag/2024.09) | 10.0 | Python 3.10+ |
+8 -8
View File
@@ -13,21 +13,21 @@ new architectures very easily as well!
Also, PEDA development has been quite idle for a few years now, and many new interesting features a
debugger can provide simply do not exist.
## What if my GDB is < 8.0 ?
## What if my GDB is < 10.0 ?
GDB was introduced with its Python support early 2011 with the release of GDB 7. A (very) long way
has gone since and the Python API has been massively improved, and GEF is taking advantage of them
to provide the coolest features with as little performance impact as possible.
Currently, GEF is optimized for running against GDB version 8.0+, and Python 3.6+. This allows for a
best performance and best use of the GDB Python API. However, GEF can run on older versions too,
Currently, GEF is optimized for running against GDB version 10.0+, and Python 3.10+. This allows for
the best performance and use of the GDB Python API. However, GEF can run on older versions too,
check out [the version compatibility matrix](compat.md). For really older versions of GDB, you can
use [`gef-legacy`](https://github.com/hugsy/gef-legacy) which supports a lot of older GDB, and a
Python 2/3 compatibility layer.
Therefore, it is highly recommended to run GEF with the latest version of GDB. However, all
functions should work on a GDB 8.0 and up. If not, send a [bug
report](https://github.com/hugsy/gef/issues) and provide as much details as possible.
functions should work on a GDB 10.0 and up. If not, send a [bug
report](https://github.com/hugsy/gef/issues) and provide as many details as possible.
If you are running an obsolete version, GEF will show a error and message and exit.
@@ -36,7 +36,7 @@ Some pre-compiled static binaries for both recent GDB and GDBServer can be downl
## I cannot get GEF setup
GEF will work on any GDB 8+ compiled with Python 3.6+ support. You can view that commands that
GEF will work on any GDB 10+ compiled with Python 3.10+ support. You can view that commands that
failed to load using `gef missing`, but this will not affect GEF generally.
If you experience problems setting it up on your host, first go to the [Discord
@@ -45,8 +45,8 @@ channel](https://discord.gg/HCS8Hg7) for that. You will find great people there
Note that the GitHub issue section is to be used to **report bugs** and **GEF issues** (like
unexpected crash, improper error handling, weird edge case, etc.), not a place to ask for help.
All recent distributions ship packaged GDB that should be ready-to-go, with a GDB >= 8.0 and Python
3.6+. Any version higher or equal will work just fine. So you might actually only need to run `apt
All recent distributions ship packaged GDB that should be ready-to-go, with GDB >= 10.0 and Python
3.10+. Any version higher or equal will work just fine. So you might actually only need to run `apt
install gdb` to get the full-force of GEF.
## I get a SegFault when starting GDB with GEF
+3 -4
View File
@@ -16,7 +16,7 @@ your OS package manager to install them.
### GDB
Only [GDB 8 and higher](https://www.gnu.org/s/gdb) is required. It must be compiled with Python 3.6
Only [GDB 10.0 and higher](https://www.gnu.org/s/gdb) is required. It must be compiled with Python 3.10
or higher support. For most people, simply using your distribution package manager should be enough.
As of January 2020, GEF officially doesn't support Python 2 any longer, due to Python 2 becoming
@@ -36,8 +36,7 @@ This should display your version of Python compiled with `gdb`.
```bash
$ gdb -nx -ex 'pi print(sys.version)' -ex quit
3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0]
3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0]
```
### Python dependencies
@@ -56,7 +55,7 @@ easily extended via
### Quick install
The quickest way to get started with GEF is through the installation script available. Simply make
sure you have [GDB 8.0 or higher](https://www.gnu.org/s/gdb), compiled with Python 3.6 or higher,
sure you have [GDB 10.0 or higher](https://www.gnu.org/s/gdb), compiled with Python 3.10 or higher,
and run
```bash
+6 -1
View File
@@ -743,7 +743,12 @@ class Section:
@property
def realpath(self) -> str:
# when in a `gef-remote` session, realpath returns the path to the binary on the local disk, not remote
return self.path if gef.session.remote is None else self._search_for_realpath()
if gef.session.remote is None:
return self.path
default = self._search_for_realpath()
if default:
return default
raise FileNotFoundError
def __str__(self) -> str:
return (f"Section(start={self.page_start:#x}, end={self.page_end:#x}, "