Skip to content

Commit a5b31be

Browse files
committed
Preserve the stable ABI when creating fallback frame names
1 parent b9bc2e2 commit a5b31be

5 files changed

Lines changed: 12 additions & 28 deletions

File tree

‎Include/internal/pycore_global_objects_fini_generated.h‎

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Include/internal/pycore_global_strings.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ struct _Py_global_strings {
5252
STRUCT_FOR_STR(list_err, "list index out of range")
5353
STRUCT_FOR_STR(str_replace_inf, "1e309")
5454
STRUCT_FOR_STR(type_params, ".type_params")
55-
STRUCT_FOR_STR(unknown_file, "<unknown file>")
56-
STRUCT_FOR_STR(unknown_function, "<unknown function>")
57-
STRUCT_FOR_STR(unreadable_frame, "<unreadable frame>")
5855
STRUCT_FOR_STR(utf_8, "utf-8")
5956
} literals;
6057

‎Include/internal/pycore_runtime_init_generated.h‎

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Include/internal/pycore_unicodeobject_generated.h‎

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/_remote_debugging_module.c‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,10 +2258,6 @@ parse_code_object(RemoteUnwinderObject *unwinder,
22582258
uintptr_t *previous_frame,
22592259
int32_t tlbc_index)
22602260
{
2261-
_Py_DECLARE_STR(unknown_function, "<unknown function>");
2262-
_Py_DECLARE_STR(unknown_file, "<unknown file>");
2263-
_Py_DECLARE_STR(unreadable_frame, "<unreadable frame>");
2264-
22652261
void *key = (void *)address;
22662262
CachedCodeMetadata *meta = NULL;
22672263
PyObject *func = NULL;
@@ -2292,7 +2288,10 @@ parse_code_object(RemoteUnwinderObject *unwinder,
22922288
goto error;
22932289
}
22942290
PyErr_Clear();
2295-
func = Py_NewRef(&_Py_STR(unreadable_frame));
2291+
func = PyUnicode_FromString("<unreadable frame>");
2292+
if (!func) {
2293+
goto error;
2294+
}
22962295
file = Py_NewRef(_Py_LATIN1_CHR('~'));
22972296
goto degraded;
22982297
}
@@ -2304,7 +2303,10 @@ parse_code_object(RemoteUnwinderObject *unwinder,
23042303
goto error;
23052304
}
23062305
PyErr_Clear();
2307-
func = Py_NewRef(&_Py_STR(unknown_function));
2306+
func = PyUnicode_FromString("<unknown function>");
2307+
if (!func) {
2308+
goto error;
2309+
}
23082310
code_metadata_incomplete = 1;
23092311
}
23102312

@@ -2315,7 +2317,10 @@ parse_code_object(RemoteUnwinderObject *unwinder,
23152317
goto error;
23162318
}
23172319
PyErr_Clear();
2318-
file = Py_NewRef(&_Py_STR(unknown_file));
2320+
file = PyUnicode_FromString("<unknown file>");
2321+
if (!file) {
2322+
goto error;
2323+
}
23192324
code_metadata_incomplete = 1;
23202325
}
23212326

0 commit comments

Comments
 (0)