|
1 | 1 | import json |
2 | 2 | import os |
3 | 3 | import platform |
4 | | -import shlex |
5 | 4 | import subprocess |
6 | 5 | import sys |
7 | 6 | import sysconfig |
@@ -105,63 +104,6 @@ def _is_arm32_build(): |
105 | 104 | return "arm" in abi |
106 | 105 |
|
107 | 106 |
|
108 | | -def _cflags_have_unwind_tables(cflags): |
109 | | - unwind_tables = False |
110 | | - asynchronous_unwind_tables = False |
111 | | - exceptions = False |
112 | | - |
113 | | - try: |
114 | | - options = shlex.split(cflags) |
115 | | - except ValueError: |
116 | | - options = cflags.split() |
117 | | - |
118 | | - for option in options: |
119 | | - if option == "-funwind-tables": |
120 | | - unwind_tables = True |
121 | | - elif option == "-fno-unwind-tables": |
122 | | - unwind_tables = False |
123 | | - elif option == "-fasynchronous-unwind-tables": |
124 | | - asynchronous_unwind_tables = True |
125 | | - elif option == "-fno-asynchronous-unwind-tables": |
126 | | - asynchronous_unwind_tables = False |
127 | | - elif option == "-fexceptions": |
128 | | - exceptions = True |
129 | | - elif option == "-fno-exceptions": |
130 | | - exceptions = False |
131 | | - |
132 | | - return unwind_tables or asynchronous_unwind_tables or exceptions |
133 | | - |
134 | | - |
135 | | -def _build_has_unwind_tables(): |
136 | | - cflags = [ |
137 | | - value for value in ( |
138 | | - sysconfig.get_config_var("PY_CORE_CFLAGS"), |
139 | | - sysconfig.get_config_var("PY_STDMODULE_CFLAGS"), |
140 | | - ) |
141 | | - if value |
142 | | - ] |
143 | | - if not cflags: |
144 | | - cflags = [ |
145 | | - value for value in ( |
146 | | - sysconfig.get_config_var("PY_CFLAGS"), |
147 | | - sysconfig.get_config_var("CFLAGS"), |
148 | | - ) |
149 | | - if value |
150 | | - ] |
151 | | - |
152 | | - return ( |
153 | | - bool(cflags) |
154 | | - and all(_cflags_have_unwind_tables(value) for value in cflags) |
155 | | - ) |
156 | | - |
157 | | - |
158 | | -def _gnu_backtrace_requires_unwind_tables(): |
159 | | - if not _is_arm32_build(): |
160 | | - return False |
161 | | - |
162 | | - return not _build_has_unwind_tables() |
163 | | - |
164 | | - |
165 | 107 | def _build_stack_and_unwind(unwinder): |
166 | 108 | import operator |
167 | 109 |
|
@@ -369,8 +311,8 @@ def test_manual_unwind_respects_frame_pointers(self): |
369 | 311 | @unittest.skipIf(support.is_wasi, "test not supported on WASI") |
370 | 312 | @unittest.skipUnless(sys.platform == "linux", "GNU backtrace unwinding test requires Linux") |
371 | 313 | @unittest.skipIf( |
372 | | - _gnu_backtrace_requires_unwind_tables(), |
373 | | - "GNU backtrace unwinding on Arm 32-bit requires unwind tables", |
| 314 | + _is_arm32_build(), |
| 315 | + "GNU backtrace unwinding skipped on Arm 32-bit", |
374 | 316 | ) |
375 | 317 | class GnuBacktraceUnwindTests(unittest.TestCase): |
376 | 318 |
|
|
0 commit comments