Update to 0.0.14; Fixes: RHBZ#1993354

This commit is contained in:
Davide Cavalca 2021-08-12 14:31:39 -07:00
parent fb29a14912
commit d57538e7d2
5 changed files with 38 additions and 34 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/drgn-0.0.11.tar.gz
/drgn-0.0.13.tar.gz
/drgn-0.0.14.tar.gz

View File

@ -1,30 +0,0 @@
From 82ca5634b513cca4bf40fd99e97fef6652dcc75f Mon Sep 17 00:00:00 2001
From: Omar Sandoval <osandov@osandov.com>
Date: Tue, 8 Jun 2021 12:05:42 -0700
Subject: [PATCH] libdrgn: fix copying value to big-endian from little-endian
copy_lsbytes() doesn't copy enough bytes when copying from a smaller
little-endian value to a larger big-endian value. This was caught by the
test cases for DW_OP_deref{,_size}, but it can affect other places when
debugging a little-endian target from a big-endian host or vice-versa.
Closes #105.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
---
libdrgn/serialize.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdrgn/serialize.h b/libdrgn/serialize.h
index da3ba91a..0f4783f3 100644
--- a/libdrgn/serialize.h
+++ b/libdrgn/serialize.h
@@ -65,7 +65,7 @@ static inline void copy_lsbytes(void *dst, size_t dst_size,
} else {
memset(d, 0, dst_size - size);
if (src_little_endian) {
- for (size_t i = dst_size - size; i < size; i++)
+ for (size_t i = dst_size - size; i < dst_size; i++)
d[i] = s[dst_size - 1 - i];
} else {
memcpy(d + dst_size - size, s + src_size - size, size);

View File

@ -0,0 +1,33 @@
From ad2119aaa3a08896a94c0ae0ad5c12a3af96197a Mon Sep 17 00:00:00 2001
From: Omar Sandoval <osandov@osandov.com>
Date: Thu, 12 Aug 2021 14:39:29 -0700
Subject: [PATCH] Tell pytest not to match classes/functions starting with
"test"
I run tests with setup.py or with the unittest module, but Fedora uses
pytest. pytest assumes that any class or function starting with "test"
is a test case, which is not always the case (e.g.,
drgn.helpers.linux.bitops.test_bit()). We've hit this at least twice, in
#94 and #112.
All of our tests are unittest.TestCase cases, so we can tell pytest to
not match anything else. I'm using pytest.ini instead of pyproject.toml
because pytest only started supporting the latter relatively recently.
Closes #112.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
---
pytest.ini | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 pytest.ini
diff --git a/pytest.ini b/pytest.ini
new file mode 100644
index 00000000..976c8482
--- /dev/null
+++ b/pytest.ini
@@ -0,0 +1,3 @@
+[pytest]
+python_classes =
+python_functions =

View File

@ -14,15 +14,15 @@ drgn exposes the types and variables in a program for easy, expressive
scripting in Python.}
Name: python-%{pypi_name}
Version: 0.0.13
Version: 0.0.14
Release: %autorelease
Summary: Scriptable debugger library
License: GPLv3+
URL: https://github.com/osandov/drgn
Source0: %{pypi_source}
# libdrgn: fix copying value to big-endian from little-endian
Patch0: %{url}/commit/82ca5634b513cca4bf40fd99e97fef6652dcc75f.patch
# Tell pytest not to match classes/functions starting with "test"
Patch0: %{url}/commit/ad2119aaa3a08896a94c0ae0ad5c12a3af96197a.patch
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)

View File

@ -1 +1 @@
SHA512 (drgn-0.0.13.tar.gz) = 5a693c69ebf28b3225c86c636ffa6775c5effbb417b3efb3941ff7456bbb8e4b67576ce28732ddc411cd934b5953d6e51b6418ed723c454eac00a675e10dd7d0
SHA512 (drgn-0.0.14.tar.gz) = 453e823330894147b179fe2284ff5d3ecd7bd47e8eeb3cb7794b6c1a31c1f6c54bb4797eed88039651e4f80eb1575ab87a7e9f02fad38a8ff9733380f65d4908