Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Gordon Messmer
95a5bc6459 Temporarily disable tcache tests 2025-09-03 23:05:03 -07:00
Gordon Messmer
d14ef7968c Replace ByteString with Buffer 2025-09-03 21:53:07 -07:00
3 changed files with 61 additions and 2 deletions

View file

@ -18,6 +18,8 @@ Source1: gdb-gef
# https://github.com/hugsy/gef/pull/1094
Patch0: gef-got-audit.patch
Patch1: gef-gcc15.patch
Patch2: gef-buffer.patch
Patch3: gef-tcache-tests.patch
BuildArch: noarch
ExclusiveArch: x86_64
@ -35,7 +37,6 @@ BuildRequires: file
BuildRequires: binutils
BuildRequires: procps-ng
BuildRequires: python3
BuildRequires: python3-pylint
BuildRequires: python3-pytest
BuildRequires: python3-pytest-benchmark
BuildRequires: python3-pytest-cov
@ -67,6 +68,8 @@ the relevant information from the debugging runtime.
%forgesetup
%patch 0 -p1
%patch 1 -p1
%patch 2 -p1
%patch 3 -p1
%build
@ -84,7 +87,7 @@ install -m 0755 %{SOURCE1}.sh %{buildroot}/%{_bindir}/gdb-gef
%if %{with check}
%check
make -C tests/binaries
python3 -m pytest -v -m "not benchmark" -m "not online" tests/
python3 -m pytest -v -m "not benchmark and not online and not tcache" tests/
%endif

18
gef-buffer.patch Normal file
View file

@ -0,0 +1,18 @@
diff --git a/gef.py b/gef.py
index 7ce988f..61a75f5 100644
--- a/gef.py
+++ b/gef.py
@@ -82,8 +82,12 @@ import warnings
from functools import lru_cache
from io import StringIO, TextIOWrapper
from types import ModuleType
-from typing import (Any, ByteString, Callable, Generator, Iterable, Iterator,
+from typing import (Any, Callable, Generator, Iterable, Iterator,
NoReturn, Sequence, Type, TypeVar, cast)
+try:
+ from typing import ByteString
+except ImportError:
+ from collections.abc import Buffer as ByteString
from urllib.request import urlopen

38
gef-tcache-tests.patch Normal file
View file

@ -0,0 +1,38 @@
diff --git a/tests/commands/heap.py b/tests/commands/heap.py
index b3bce6f..49226ba 100644
--- a/tests/commands/heap.py
+++ b/tests/commands/heap.py
@@ -2,6 +2,8 @@
Heap commands test module
"""
+import pytest
+
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import (
ARCH,
@@ -179,6 +181,7 @@ class HeapCommandNonMain(RemoteGefUnitTestGeneric):
res = gdb.execute(cmd, to_string=True)
self.assertIn("size=0x20", res)
+ @pytest.mark.tcache
def test_cmd_heap_bins_tcache(self):
gdb = self._gdb
gdb.execute("run")
@@ -292,6 +295,7 @@ class HeapCommandTcache(RemoteGefUnitTestGeneric):
self.expected_tcache_bin_size = 0x20 if ARCH == "i686" or is_64b() else 0x18
return super().setUp()
+ @pytest.mark.tcache
def test_cmd_heap_bins_tcache_all(self):
gdb = self._gdb
gdb.execute("run")
diff --git a/tests/pytest.ini b/tests/pytest.ini
index 726db8e..7b86b98 100644
--- a/tests/pytest.ini
+++ b/tests/pytest.ini
@@ -14,3 +14,4 @@ testpaths =
markers =
slow: flag test as slow (deselect with '-m "not slow"')
online: flag test as requiring internet to work (deselect with '-m "not online"')
+ tcache: flag test as checking glibc tcache (deselect with '-m "not tcache"')