pystack 1.4.1__tar.gz → 1.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pystack-1.4.1 → pystack-1.5.1}/.bumpversion.cfg +1 -1
- {pystack-1.4.1 → pystack-1.5.1}/MANIFEST.in +0 -1
- {pystack-1.4.1 → pystack-1.5.1}/NEWS.rst +38 -0
- {pystack-1.4.1 → pystack-1.5.1}/PKG-INFO +10 -2
- {pystack-1.4.1 → pystack-1.5.1}/pyproject.toml +13 -25
- {pystack-1.4.1 → pystack-1.5.1}/setup.py +14 -2
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/__main__.py +21 -6
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/code.h +39 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/frame.h +26 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/gc.h +24 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/interpreter.h +78 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/runtime.h +217 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/string.h +18 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/thread.h +67 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/elf_common.cpp +4 -1
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/elf_common.h +4 -1
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/mem.cpp +119 -5
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/mem.h +16 -1
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/process.cpp +34 -3
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/process.h +8 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pycode.cpp +31 -4
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pycode.h +2 -1
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pyframe.cpp +18 -5
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pytypes.cpp +0 -1
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pytypes.h +0 -3
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/version.cpp +259 -194
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/version.h +1 -1
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack.pyi +12 -11
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack.pyx +1 -0
- pystack-1.5.1/src/pystack/_version.py +1 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/process.py +7 -4
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/traceback_formatter.py +20 -6
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack.egg-info/PKG-INFO +10 -2
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack.egg-info/SOURCES.txt +0 -1
- pystack-1.4.1/build_scripts/elfutils_contiguous_segments.diff +0 -66
- pystack-1.4.1/src/pystack/_version.py +0 -1
- {pystack-1.4.1 → pystack-1.5.1}/.pre-commit-config.yaml +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/LICENSE +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/Makefile +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/README.md +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/setup.cfg +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/__init__.py +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/CMakeLists.txt +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/__init__.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/compat.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/corefile.cpp +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/corefile.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/corefile.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/dict.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/float.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/int.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/list.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/object.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/pthread.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/cpython/tuple.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/elf_common.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/logging.cpp +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/logging.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/logging.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/mem.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/native_frame.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/native_frame.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/process.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pycode.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pycompat.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pyframe.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pyframe.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pythread.cpp +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pythread.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/pythread.pxd +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/structure.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/unwinder.cpp +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/_pystack/unwinder.h +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/colors.py +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/engine.py +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/errors.py +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/maps.py +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/py.typed +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack/types.py +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack.egg-info/dependency_links.txt +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack.egg-info/entry_points.txt +0 -0
- {pystack-1.4.1 → pystack-1.5.1}/src/pystack.egg-info/top_level.txt +0 -0
|
@@ -8,6 +8,44 @@ Changelog
|
|
|
8
8
|
|
|
9
9
|
.. towncrier release notes start
|
|
10
10
|
|
|
11
|
+
pystack 1.5.1 (2025-08-18)
|
|
12
|
+
--------------------------
|
|
13
|
+
|
|
14
|
+
Bug Fixes
|
|
15
|
+
~~~~~~~~~
|
|
16
|
+
|
|
17
|
+
- Correct a bug in our GitHub Actions workflow that prevented artifacts for 1.5.0 from being uploaded to PyPI. No changes have been made to the PyStack code itself since 1.5.0 (#250)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
pystack 1.5.0 (2025-08-18)
|
|
21
|
+
--------------------------
|
|
22
|
+
|
|
23
|
+
Features
|
|
24
|
+
~~~~~~~~
|
|
25
|
+
|
|
26
|
+
- Add a new ``--native-last`` command line flag to only show the C frames after the last Python frame. (#182)
|
|
27
|
+
- Add support for Python 3.14 (#229)
|
|
28
|
+
- Support kernels that don't have CONFIG_CROSS_MEMORY_ATTACH set. (#240)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Deprecations and Removals
|
|
32
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
33
|
+
|
|
34
|
+
- We no longer provide x86-64 musllinux_1_1 wheels. The manylinux project dropped support for musllinux_1_1 on November 1st, 2024. (#237)
|
|
35
|
+
- We no longer provide Python 3.7 wheels. Python 3.7 has been end-of-life since June 2023. (#237)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
Bug Fixes
|
|
39
|
+
~~~~~~~~~
|
|
40
|
+
|
|
41
|
+
- Fix incorrect file offset calculation when analyzing ELF files with
|
|
42
|
+
non-standard ELF layouts. Previously, pystack would fail to correctly analyze
|
|
43
|
+
Python binaries that had non-standard ELF layouts (for example when compiled
|
|
44
|
+
with certain linker options). The fix properly accounts for PT_LOAD segment
|
|
45
|
+
mappings when calculating file offsets. (#220)
|
|
46
|
+
- Improve handling of core files where we cannot determine the executable. (#221)
|
|
47
|
+
|
|
48
|
+
|
|
11
49
|
pystack 1.4.1 (2024-10-04)
|
|
12
50
|
--------------------------
|
|
13
51
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pystack
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.1
|
|
4
4
|
Summary: Analysis of the stack of remote python processes
|
|
5
5
|
Home-page: https://github.com/bloomberg/pystack
|
|
6
6
|
Author: Pablo Galindo Salgado
|
|
@@ -18,6 +18,14 @@ Classifier: Topic :: Software Development :: Debuggers
|
|
|
18
18
|
Requires-Python: >=3.7.0
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: description
|
|
24
|
+
Dynamic: description-content-type
|
|
25
|
+
Dynamic: home-page
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
Dynamic: requires-python
|
|
28
|
+
Dynamic: summary
|
|
21
29
|
|
|
22
30
|
<p align="center">
|
|
23
31
|
<img src="https://user-images.githubusercontent.com/11718525/226942590-de015c9a-4d5b-4960-9c42-8c1eac0845c1.png" width="70%">
|
|
@@ -46,19 +46,18 @@ underlines = "-~"
|
|
|
46
46
|
build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
|
|
47
47
|
manylinux-x86_64-image = "manylinux2014"
|
|
48
48
|
manylinux-i686-image = "manylinux2014"
|
|
49
|
-
musllinux-x86_64-image = "
|
|
49
|
+
musllinux-x86_64-image = "musllinux_1_2"
|
|
50
50
|
skip = "*-musllinux_aarch64"
|
|
51
51
|
|
|
52
52
|
[tool.cibuildwheel.linux]
|
|
53
53
|
before-all = [
|
|
54
|
-
"yum install -y
|
|
54
|
+
"yum install -y libzstd-devel",
|
|
55
55
|
"cd /",
|
|
56
|
-
"VERS=0.
|
|
56
|
+
"VERS=0.193",
|
|
57
57
|
"curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2",
|
|
58
58
|
"tar -xf elfutils.tar.bz2",
|
|
59
59
|
"cd elfutils-$VERS",
|
|
60
|
-
"
|
|
61
|
-
"CFLAGS='-w' ./configure --enable-libdebuginfod=dummy --disable-debuginfod --prefix=/usr --libdir=/usr/lib64",
|
|
60
|
+
"CFLAGS='-Wno-error -g -O3' CXXFLAGS='-Wno-error -g -O3' ./configure --disable-nls --enable-libdebuginfod=dummy --disable-debuginfod --with-zstd",
|
|
62
61
|
"make install"
|
|
63
62
|
]
|
|
64
63
|
|
|
@@ -70,34 +69,22 @@ before-all = [
|
|
|
70
69
|
# dependency of elfutils.
|
|
71
70
|
"apk del gettext-dev glib-dev",
|
|
72
71
|
|
|
73
|
-
# Build musl-fts from source. This is a build dependency of elfutils, but
|
|
74
|
-
# isn't in the Alpine repos of the musllinux_1_1 image. The build steps come
|
|
75
|
-
# from https://git.alpinelinux.org/aports/tree/main/musl-fts/APKBUILD
|
|
76
|
-
# Setting PATH before calling boostrap.sh fixes an automake failure. I think
|
|
77
|
-
# the failure may be caused by a different pkg-config in /usr/local/bin.
|
|
78
|
-
"cd /",
|
|
79
|
-
"apk add --update automake autoconf libtool",
|
|
80
|
-
"VERS=1.2.7",
|
|
81
|
-
"curl -L https://github.com/void-linux/musl-fts/archive/refs/tags/v$VERS.tar.gz > ./musl-fts.tar.gz",
|
|
82
|
-
"tar -xf musl-fts.tar.gz",
|
|
83
|
-
"cd musl-fts-$VERS",
|
|
84
|
-
"PATH=/usr/bin:/bin ./bootstrap.sh",
|
|
85
|
-
"CFLAGS=-fPIC ./configure --prefix=/usr",
|
|
86
|
-
"make install",
|
|
87
|
-
|
|
88
72
|
# Build the latest elfutils from source. The build steps come from
|
|
89
73
|
# https://git.alpinelinux.org/aports/tree/main/elfutils, and the need to
|
|
90
74
|
# set the FNM_EXTMATCH macro to get the build to succeed is seen here:
|
|
91
75
|
# https://git.alpinelinux.org/aports/tree/main/elfutils/musl-macros.patch
|
|
92
76
|
"cd /",
|
|
93
|
-
"apk add --update argp-standalone bison bsd-compat-headers bzip2-dev flex-dev libtool linux-headers musl-libintl musl-obstack-dev xz-dev zlib-dev zstd-dev",
|
|
94
|
-
"VERS=0.
|
|
77
|
+
"apk add --update argp-standalone bison bsd-compat-headers bzip2-dev flex-dev libtool linux-headers musl-fts-dev musl-libintl musl-obstack-dev xz-dev zlib-dev zstd-dev",
|
|
78
|
+
"VERS=0.193",
|
|
95
79
|
"curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2",
|
|
96
80
|
"tar -xf elfutils.tar.bz2",
|
|
97
81
|
"cd elfutils-$VERS",
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
|
|
82
|
+
"CFLAGS='-Wno-error -DFNM_EXTMATCH=0 -g -O3' CXXFLAGS='-Wno-error -g -O3' ./configure --disable-nls --enable-libdebuginfod=dummy --disable-debuginfod --with-zstd",
|
|
83
|
+
"make install",
|
|
84
|
+
|
|
85
|
+
# Reinstall libintl, as the Python interpreter requires it
|
|
86
|
+
"apk del musl-libintl",
|
|
87
|
+
"apk add libintl",
|
|
101
88
|
]
|
|
102
89
|
|
|
103
90
|
[tool.coverage.run]
|
|
@@ -121,3 +108,4 @@ show_missing = true
|
|
|
121
108
|
# pytest retains all temp files from the last 3 test suite runs by default.
|
|
122
109
|
# Keep only ones for failed tests to avoid filling up a disk.
|
|
123
110
|
tmp_path_retention_policy = "failed"
|
|
111
|
+
testpaths = ["tests"]
|
|
@@ -33,6 +33,7 @@ COMPILER_DIRECTIVES = {
|
|
|
33
33
|
"cdivision": True,
|
|
34
34
|
"c_string_type": "unicode",
|
|
35
35
|
"c_string_encoding": "utf8",
|
|
36
|
+
"freethreading_compatible": True,
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
DEFINE_MACROS = []
|
|
@@ -50,6 +51,7 @@ if TEST_BUILD:
|
|
|
50
51
|
"infer_types": True,
|
|
51
52
|
"c_string_type": "unicode",
|
|
52
53
|
"c_string_encoding": "utf8",
|
|
54
|
+
"freethreading_compatible": True,
|
|
53
55
|
}
|
|
54
56
|
DEFINE_MACROS.extend([("CYTHON_TRACE", "1"), ("CYTHON_TRACE_NOGIL", "1")])
|
|
55
57
|
|
|
@@ -64,6 +66,11 @@ except pkgconfig.PackageNotFoundError as e:
|
|
|
64
66
|
print("Package Not Found", e)
|
|
65
67
|
print("Falling back to static flags.")
|
|
66
68
|
|
|
69
|
+
if "define_macros" not in library_flags:
|
|
70
|
+
library_flags["define_macros"] = []
|
|
71
|
+
|
|
72
|
+
library_flags["define_macros"].extend(DEFINE_MACROS)
|
|
73
|
+
|
|
67
74
|
PYSTACK_EXTENSION = setuptools.Extension(
|
|
68
75
|
name="pystack._pystack",
|
|
69
76
|
sources=[
|
|
@@ -83,7 +90,6 @@ PYSTACK_EXTENSION = setuptools.Extension(
|
|
|
83
90
|
language="c++",
|
|
84
91
|
extra_compile_args=["-std=c++17"],
|
|
85
92
|
extra_link_args=["-std=c++17"],
|
|
86
|
-
define_macros=DEFINE_MACROS,
|
|
87
93
|
**library_flags,
|
|
88
94
|
)
|
|
89
95
|
|
|
@@ -127,7 +133,13 @@ setuptools.setup(
|
|
|
127
133
|
compiler_directives=COMPILER_DIRECTIVES,
|
|
128
134
|
),
|
|
129
135
|
install_requires=install_requires,
|
|
130
|
-
include_package_data=
|
|
136
|
+
include_package_data=False,
|
|
137
|
+
package_data={
|
|
138
|
+
"pystack": [
|
|
139
|
+
"pystack/*.pyi",
|
|
140
|
+
"pystack/*.typed",
|
|
141
|
+
]
|
|
142
|
+
},
|
|
131
143
|
entry_points={
|
|
132
144
|
"console_scripts": ["pystack=pystack.__main__:main"],
|
|
133
145
|
},
|
|
@@ -166,6 +166,15 @@ def generate_cli_parser() -> argparse.ArgumentParser:
|
|
|
166
166
|
help="Include native (C) frames from threads not registered with "
|
|
167
167
|
"the interpreter (implies --native)",
|
|
168
168
|
)
|
|
169
|
+
remote_parser.add_argument(
|
|
170
|
+
"--native-last",
|
|
171
|
+
action="store_const",
|
|
172
|
+
dest="native_mode",
|
|
173
|
+
const=NativeReportingMode.LAST,
|
|
174
|
+
default=NativeReportingMode.OFF,
|
|
175
|
+
help="Include native (C) frames only after the last python frame "
|
|
176
|
+
"in the resulting stack trace",
|
|
177
|
+
)
|
|
169
178
|
remote_parser.add_argument(
|
|
170
179
|
"--locals",
|
|
171
180
|
action="store_true",
|
|
@@ -212,6 +221,15 @@ def generate_cli_parser() -> argparse.ArgumentParser:
|
|
|
212
221
|
help="Include native (C) frames from threads not registered with "
|
|
213
222
|
"the interpreter (implies --native)",
|
|
214
223
|
)
|
|
224
|
+
core_parser.add_argument(
|
|
225
|
+
"--native-last",
|
|
226
|
+
action="store_const",
|
|
227
|
+
dest="native_mode",
|
|
228
|
+
const=NativeReportingMode.LAST,
|
|
229
|
+
default=NativeReportingMode.OFF,
|
|
230
|
+
help="Include native (C) frames only after the last python frame "
|
|
231
|
+
"in the resulting stack trace",
|
|
232
|
+
)
|
|
215
233
|
core_parser.add_argument(
|
|
216
234
|
"--locals",
|
|
217
235
|
action="store_true",
|
|
@@ -274,8 +292,7 @@ def process_remote(parser: argparse.ArgumentParser, args: argparse.Namespace) ->
|
|
|
274
292
|
locals=args.locals,
|
|
275
293
|
method=StackMethod.ALL if args.exhaustive else StackMethod.AUTO,
|
|
276
294
|
):
|
|
277
|
-
|
|
278
|
-
print_thread(thread, native)
|
|
295
|
+
print_thread(thread, args.native_mode)
|
|
279
296
|
|
|
280
297
|
|
|
281
298
|
def format_psinfo_information(psinfo: Dict[str, Any]) -> str:
|
|
@@ -331,7 +348,7 @@ def process_core(parser: argparse.ArgumentParser, args: argparse.Namespace) -> N
|
|
|
331
348
|
if args.executable is None:
|
|
332
349
|
corefile_analyzer = CoreFileAnalyzer(corefile)
|
|
333
350
|
executable = pathlib.Path(corefile_analyzer.extract_executable())
|
|
334
|
-
if not
|
|
351
|
+
if not is_elf(executable):
|
|
335
352
|
first_map = next(
|
|
336
353
|
(
|
|
337
354
|
map
|
|
@@ -343,7 +360,6 @@ def process_core(parser: argparse.ArgumentParser, args: argparse.Namespace) -> N
|
|
|
343
360
|
if (
|
|
344
361
|
first_map is not None
|
|
345
362
|
and first_map.path is not None
|
|
346
|
-
and first_map.path.exists()
|
|
347
363
|
and is_elf(first_map.path)
|
|
348
364
|
):
|
|
349
365
|
executable = first_map.path
|
|
@@ -406,8 +422,7 @@ def process_core(parser: argparse.ArgumentParser, args: argparse.Namespace) -> N
|
|
|
406
422
|
locals=args.locals,
|
|
407
423
|
method=StackMethod.ALL if args.exhaustive else StackMethod.AUTO,
|
|
408
424
|
):
|
|
409
|
-
|
|
410
|
-
print_thread(thread, native)
|
|
425
|
+
print_thread(thread, args.native_mode)
|
|
411
426
|
|
|
412
427
|
|
|
413
428
|
if __name__ == "__main__": # pragma: no cover
|
|
@@ -197,4 +197,43 @@ typedef struct
|
|
|
197
197
|
} PyCodeObject;
|
|
198
198
|
} // namespace Python3_13
|
|
199
199
|
|
|
200
|
+
namespace Python3_14 {
|
|
201
|
+
typedef uint16_t _Py_CODEUNIT;
|
|
202
|
+
|
|
203
|
+
typedef struct
|
|
204
|
+
{
|
|
205
|
+
PyObject_VAR_HEAD PyObject* co_consts;
|
|
206
|
+
PyObject* co_names;
|
|
207
|
+
PyObject* co_exceptiontable;
|
|
208
|
+
int co_flags;
|
|
209
|
+
int co_argcount;
|
|
210
|
+
int co_posonlyargcount;
|
|
211
|
+
int co_kwonlyargcount;
|
|
212
|
+
int co_stacksize;
|
|
213
|
+
int co_firstlineno;
|
|
214
|
+
int co_nlocalsplus;
|
|
215
|
+
int co_framesize;
|
|
216
|
+
int co_nlocals;
|
|
217
|
+
int co_ncellvars;
|
|
218
|
+
int co_nfreevars;
|
|
219
|
+
uint32_t co_version;
|
|
220
|
+
PyObject* co_localsplusnames;
|
|
221
|
+
PyObject* co_localspluskinds;
|
|
222
|
+
PyObject* co_filename;
|
|
223
|
+
PyObject* co_name;
|
|
224
|
+
PyObject* co_qualname;
|
|
225
|
+
PyObject* co_linetable;
|
|
226
|
+
PyObject* co_weakreflist;
|
|
227
|
+
void* co_executors;
|
|
228
|
+
void* _co_cached;
|
|
229
|
+
uintptr_t _co_instrumentation_version;
|
|
230
|
+
void* _co_monitoring;
|
|
231
|
+
Py_ssize_t _co_unique_id;
|
|
232
|
+
int _co_firsttraceable;
|
|
233
|
+
void* co_extra;
|
|
234
|
+
/* deal with co_tlbc somehow */
|
|
235
|
+
char co_code_adaptive[1];
|
|
236
|
+
} PyCodeObject;
|
|
237
|
+
} // namespace Python3_14
|
|
238
|
+
|
|
200
239
|
} // namespace pystack
|
|
@@ -126,4 +126,30 @@ typedef struct _interpreter_frame
|
|
|
126
126
|
|
|
127
127
|
} // namespace Python3_12
|
|
128
128
|
|
|
129
|
+
namespace Python3_14 {
|
|
130
|
+
|
|
131
|
+
typedef union _PyStackRef {
|
|
132
|
+
uintptr_t bits;
|
|
133
|
+
} _PyStackRef;
|
|
134
|
+
|
|
135
|
+
typedef struct _interpreter_frame
|
|
136
|
+
{
|
|
137
|
+
_PyStackRef f_executable;
|
|
138
|
+
void* previous;
|
|
139
|
+
void* f_funcobj;
|
|
140
|
+
PyObject* f_globals;
|
|
141
|
+
PyObject* f_builtins;
|
|
142
|
+
PyObject* f_locals;
|
|
143
|
+
PyObject* frame_obj;
|
|
144
|
+
_Py_CODEUNIT* instr_ptr;
|
|
145
|
+
_PyStackRef stackpointer;
|
|
146
|
+
/* int32_t tlbc_index; */
|
|
147
|
+
uint16_t return_offset;
|
|
148
|
+
char owner;
|
|
149
|
+
uint8_t visited;
|
|
150
|
+
void* localsplus[1];
|
|
151
|
+
} PyFrameObject;
|
|
152
|
+
|
|
153
|
+
} // namespace Python3_14
|
|
154
|
+
|
|
129
155
|
} // namespace pystack
|
|
@@ -82,4 +82,28 @@ struct _gc_runtime_state
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
} // namespace Python3_8
|
|
85
|
+
|
|
86
|
+
namespace Python3_14 {
|
|
87
|
+
|
|
88
|
+
struct _gc_runtime_state
|
|
89
|
+
{
|
|
90
|
+
PyObject* trash_delete_later;
|
|
91
|
+
int trash_delete_nesting;
|
|
92
|
+
int enabled;
|
|
93
|
+
int debug;
|
|
94
|
+
struct Python3_8::gc_generation young;
|
|
95
|
+
struct Python3_8::gc_generation old[2];
|
|
96
|
+
struct Python3_8::gc_generation permanent_generation;
|
|
97
|
+
struct gc_generation_stats generation_stats[NUM_GENERATIONS];
|
|
98
|
+
int collecting;
|
|
99
|
+
PyObject* garbage;
|
|
100
|
+
PyObject* callbacks;
|
|
101
|
+
Py_ssize_t heap_size;
|
|
102
|
+
Py_ssize_t work_to_do;
|
|
103
|
+
int visited_space;
|
|
104
|
+
int phase;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
} // namespace Python3_14
|
|
108
|
+
|
|
85
109
|
} // namespace pystack
|
|
@@ -338,4 +338,82 @@ typedef struct _is
|
|
|
338
338
|
struct _import_state imports;
|
|
339
339
|
} PyInterpreterState;
|
|
340
340
|
} // namespace Python3_13
|
|
341
|
+
|
|
342
|
+
namespace Python3_14 {
|
|
343
|
+
|
|
344
|
+
struct _pythreadstate;
|
|
345
|
+
|
|
346
|
+
typedef struct
|
|
347
|
+
{
|
|
348
|
+
Python3_13::PyMutex mutex;
|
|
349
|
+
unsigned long long thread;
|
|
350
|
+
size_t level;
|
|
351
|
+
} _PyRecursiveMutex;
|
|
352
|
+
|
|
353
|
+
struct _import_state
|
|
354
|
+
{
|
|
355
|
+
PyObject* modules;
|
|
356
|
+
PyObject* modules_by_index;
|
|
357
|
+
PyObject* importlib;
|
|
358
|
+
int override_frozen_modules;
|
|
359
|
+
int override_multi_interp_extensions_check;
|
|
360
|
+
PyObject* import_func;
|
|
361
|
+
_PyRecursiveMutex lock;
|
|
362
|
+
/* diagnostic info in PyImport_ImportModuleLevelObject() */
|
|
363
|
+
struct
|
|
364
|
+
{
|
|
365
|
+
int import_level;
|
|
366
|
+
int64_t accumulated;
|
|
367
|
+
int header;
|
|
368
|
+
} find_and_load;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
struct _gil_runtime_state
|
|
372
|
+
{
|
|
373
|
+
unsigned long interval;
|
|
374
|
+
struct _pythreadstate* last_holder;
|
|
375
|
+
int locked;
|
|
376
|
+
unsigned long switch_number;
|
|
377
|
+
pthread_cond_t cond;
|
|
378
|
+
pthread_cond_t mutex;
|
|
379
|
+
#ifdef FORCE_SWITCHING
|
|
380
|
+
pthread_cond_t switch_cond;
|
|
381
|
+
pthread_cond_t switch_mutex;
|
|
382
|
+
#endif
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
typedef struct _is
|
|
386
|
+
{
|
|
387
|
+
struct _ceval_state ceval;
|
|
388
|
+
void* _malloced;
|
|
389
|
+
struct _is* next;
|
|
390
|
+
int64_t id;
|
|
391
|
+
Py_ssize_t id_refcount;
|
|
392
|
+
int requires_idref;
|
|
393
|
+
long _whence;
|
|
394
|
+
int _initialized;
|
|
395
|
+
int _ready;
|
|
396
|
+
int finalizing;
|
|
397
|
+
uintptr_t last_restart_version;
|
|
398
|
+
struct pythreads
|
|
399
|
+
{
|
|
400
|
+
uint64_t next_unique_id;
|
|
401
|
+
struct _pythreadstate* head;
|
|
402
|
+
struct _pythreadstate* preallocated;
|
|
403
|
+
struct _pythreadstate* main;
|
|
404
|
+
Py_ssize_t count;
|
|
405
|
+
size_t stacksize;
|
|
406
|
+
} threads;
|
|
407
|
+
void* runtime;
|
|
408
|
+
struct _pythreadstate* _finalizing;
|
|
409
|
+
unsigned long _finalizing_id;
|
|
410
|
+
struct _gc_runtime_state gc;
|
|
411
|
+
PyObject* sysdict;
|
|
412
|
+
PyObject* builtins;
|
|
413
|
+
struct _import_state imports;
|
|
414
|
+
struct _gil_runtime_state _gil;
|
|
415
|
+
} PyInterpreterState;
|
|
416
|
+
|
|
417
|
+
} // namespace Python3_14
|
|
418
|
+
|
|
341
419
|
} // namespace pystack
|
|
@@ -422,6 +422,222 @@ typedef struct pyruntimestate
|
|
|
422
422
|
} PyRuntimeState;
|
|
423
423
|
|
|
424
424
|
} // namespace Python3_13
|
|
425
|
+
|
|
426
|
+
namespace Python3_14 {
|
|
427
|
+
|
|
428
|
+
typedef struct _Py_DebugOffsets
|
|
429
|
+
{
|
|
430
|
+
char cookie[8];
|
|
431
|
+
uint64_t version;
|
|
432
|
+
uint64_t free_threaded;
|
|
433
|
+
// Runtime state offset;
|
|
434
|
+
struct _runtime_state
|
|
435
|
+
{
|
|
436
|
+
uint64_t size;
|
|
437
|
+
uint64_t finalizing;
|
|
438
|
+
uint64_t interpreters_head;
|
|
439
|
+
} runtime_state;
|
|
440
|
+
|
|
441
|
+
// Interpreter state offset;
|
|
442
|
+
struct _interpreter_state
|
|
443
|
+
{
|
|
444
|
+
uint64_t size;
|
|
445
|
+
uint64_t id;
|
|
446
|
+
uint64_t next;
|
|
447
|
+
uint64_t threads_head;
|
|
448
|
+
uint64_t threads_main;
|
|
449
|
+
uint64_t gc;
|
|
450
|
+
uint64_t imports_modules;
|
|
451
|
+
uint64_t sysdict;
|
|
452
|
+
uint64_t builtins;
|
|
453
|
+
uint64_t ceval_gil;
|
|
454
|
+
uint64_t gil_runtime_state;
|
|
455
|
+
uint64_t gil_runtime_state_enabled;
|
|
456
|
+
uint64_t gil_runtime_state_locked;
|
|
457
|
+
uint64_t gil_runtime_state_holder;
|
|
458
|
+
uint64_t code_object_generation;
|
|
459
|
+
uint64_t tlbc_generation;
|
|
460
|
+
} interpreter_state;
|
|
461
|
+
|
|
462
|
+
// Thread state offset;
|
|
463
|
+
struct _thread_state
|
|
464
|
+
{
|
|
465
|
+
uint64_t size;
|
|
466
|
+
uint64_t prev;
|
|
467
|
+
uint64_t next;
|
|
468
|
+
uint64_t interp;
|
|
469
|
+
uint64_t current_frame;
|
|
470
|
+
uint64_t thread_id;
|
|
471
|
+
uint64_t native_thread_id;
|
|
472
|
+
uint64_t datastack_chunk;
|
|
473
|
+
uint64_t status;
|
|
474
|
+
} thread_state;
|
|
475
|
+
|
|
476
|
+
// InterpreterFrame offset;
|
|
477
|
+
struct _interpreter_frame
|
|
478
|
+
{
|
|
479
|
+
uint64_t size;
|
|
480
|
+
uint64_t previous;
|
|
481
|
+
uint64_t executable;
|
|
482
|
+
uint64_t instr_ptr;
|
|
483
|
+
uint64_t localsplus;
|
|
484
|
+
uint64_t owner;
|
|
485
|
+
uint64_t stackpointer;
|
|
486
|
+
uint64_t tlbc_index;
|
|
487
|
+
} interpreter_frame;
|
|
488
|
+
|
|
489
|
+
// Code object offset;
|
|
490
|
+
struct _code_object
|
|
491
|
+
{
|
|
492
|
+
uint64_t size;
|
|
493
|
+
uint64_t filename;
|
|
494
|
+
uint64_t name;
|
|
495
|
+
uint64_t qualname;
|
|
496
|
+
uint64_t linetable;
|
|
497
|
+
uint64_t firstlineno;
|
|
498
|
+
uint64_t argcount;
|
|
499
|
+
uint64_t localsplusnames;
|
|
500
|
+
uint64_t localspluskinds;
|
|
501
|
+
uint64_t co_code_adaptive;
|
|
502
|
+
uint64_t co_tlbc;
|
|
503
|
+
} code_object;
|
|
504
|
+
|
|
505
|
+
// PyObject offset;
|
|
506
|
+
struct _pyobject
|
|
507
|
+
{
|
|
508
|
+
uint64_t size;
|
|
509
|
+
uint64_t ob_type;
|
|
510
|
+
} pyobject;
|
|
511
|
+
|
|
512
|
+
// PyTypeObject object offset;
|
|
513
|
+
struct _type_object
|
|
514
|
+
{
|
|
515
|
+
uint64_t size;
|
|
516
|
+
uint64_t tp_name;
|
|
517
|
+
uint64_t tp_repr;
|
|
518
|
+
uint64_t tp_flags;
|
|
519
|
+
} type_object;
|
|
520
|
+
|
|
521
|
+
// PyTuple object offset;
|
|
522
|
+
struct _tuple_object
|
|
523
|
+
{
|
|
524
|
+
uint64_t size;
|
|
525
|
+
uint64_t ob_item;
|
|
526
|
+
uint64_t ob_size;
|
|
527
|
+
} tuple_object;
|
|
528
|
+
|
|
529
|
+
// PyList object offset;
|
|
530
|
+
struct _list_object
|
|
531
|
+
{
|
|
532
|
+
uint64_t size;
|
|
533
|
+
uint64_t ob_item;
|
|
534
|
+
uint64_t ob_size;
|
|
535
|
+
} list_object;
|
|
536
|
+
|
|
537
|
+
// PySet object offset;
|
|
538
|
+
struct _set_object
|
|
539
|
+
{
|
|
540
|
+
uint64_t size;
|
|
541
|
+
uint64_t used;
|
|
542
|
+
uint64_t table;
|
|
543
|
+
uint64_t mask;
|
|
544
|
+
} set_object;
|
|
545
|
+
|
|
546
|
+
// PyDict object offset;
|
|
547
|
+
struct _dict_object
|
|
548
|
+
{
|
|
549
|
+
uint64_t size;
|
|
550
|
+
uint64_t ma_keys;
|
|
551
|
+
uint64_t ma_values;
|
|
552
|
+
} dict_object;
|
|
553
|
+
|
|
554
|
+
// PyFloat object offset;
|
|
555
|
+
struct _float_object
|
|
556
|
+
{
|
|
557
|
+
uint64_t size;
|
|
558
|
+
uint64_t ob_fval;
|
|
559
|
+
} float_object;
|
|
560
|
+
|
|
561
|
+
// PyLong object offset;
|
|
562
|
+
struct _long_object
|
|
563
|
+
{
|
|
564
|
+
uint64_t size;
|
|
565
|
+
uint64_t lv_tag;
|
|
566
|
+
uint64_t ob_digit;
|
|
567
|
+
} long_object;
|
|
568
|
+
|
|
569
|
+
// PyBytes object offset;
|
|
570
|
+
struct _bytes_object
|
|
571
|
+
{
|
|
572
|
+
uint64_t size;
|
|
573
|
+
uint64_t ob_size;
|
|
574
|
+
uint64_t ob_sval;
|
|
575
|
+
} bytes_object;
|
|
576
|
+
|
|
577
|
+
// Unicode object offset;
|
|
578
|
+
struct _unicode_object
|
|
579
|
+
{
|
|
580
|
+
uint64_t size;
|
|
581
|
+
uint64_t state;
|
|
582
|
+
uint64_t length;
|
|
583
|
+
uint64_t asciiobject_size;
|
|
584
|
+
} unicode_object;
|
|
585
|
+
|
|
586
|
+
// GC runtime state offset;
|
|
587
|
+
struct _gc
|
|
588
|
+
{
|
|
589
|
+
uint64_t size;
|
|
590
|
+
uint64_t collecting;
|
|
591
|
+
} gc;
|
|
592
|
+
|
|
593
|
+
// Generator object offset;
|
|
594
|
+
struct _gen_object
|
|
595
|
+
{
|
|
596
|
+
uint64_t size;
|
|
597
|
+
uint64_t gi_name;
|
|
598
|
+
uint64_t gi_iframe;
|
|
599
|
+
uint64_t gi_frame_state;
|
|
600
|
+
} gen_object;
|
|
601
|
+
|
|
602
|
+
struct _llist_node
|
|
603
|
+
{
|
|
604
|
+
uint64_t next;
|
|
605
|
+
uint64_t prev;
|
|
606
|
+
} llist_node;
|
|
607
|
+
|
|
608
|
+
struct _debugger_support
|
|
609
|
+
{
|
|
610
|
+
uint64_t eval_breaker;
|
|
611
|
+
uint64_t remote_debugger_support;
|
|
612
|
+
uint64_t remote_debugging_enabled;
|
|
613
|
+
uint64_t debugger_pending_call;
|
|
614
|
+
uint64_t debugger_script_path;
|
|
615
|
+
uint64_t debugger_script_path_size;
|
|
616
|
+
} debugger_support;
|
|
617
|
+
} _Py_DebugOffsets;
|
|
618
|
+
|
|
619
|
+
typedef struct pyruntimestate
|
|
620
|
+
{
|
|
621
|
+
_Py_DebugOffsets debug_offsets;
|
|
622
|
+
int _initialized;
|
|
623
|
+
int preinitializing;
|
|
624
|
+
int preinitialized;
|
|
625
|
+
int core_initialized;
|
|
626
|
+
int initialized;
|
|
627
|
+
struct _pythreadstate* finalizing;
|
|
628
|
+
unsigned long _finalizing_id;
|
|
629
|
+
|
|
630
|
+
struct pyinterpreters
|
|
631
|
+
{
|
|
632
|
+
Python3_13::PyMutex mutex;
|
|
633
|
+
PyInterpreterState* head;
|
|
634
|
+
PyInterpreterState* main;
|
|
635
|
+
int64_t next_id;
|
|
636
|
+
} interpreters;
|
|
637
|
+
} PyRuntimeState;
|
|
638
|
+
|
|
639
|
+
} // namespace Python3_14
|
|
640
|
+
|
|
425
641
|
typedef union {
|
|
426
642
|
Python3_7::PyRuntimeState v3_7;
|
|
427
643
|
Python3_8::PyRuntimeState v3_8;
|
|
@@ -429,6 +645,7 @@ typedef union {
|
|
|
429
645
|
Python3_11::PyRuntimeState v3_11;
|
|
430
646
|
Python3_12::PyRuntimeState v3_12;
|
|
431
647
|
Python3_13::PyRuntimeState v3_13;
|
|
648
|
+
Python3_14::PyRuntimeState v3_14;
|
|
432
649
|
} PyRuntimeState;
|
|
433
650
|
|
|
434
651
|
} // namespace pystack
|