8000 gh-78607: Replace __ltrace__ with __lltrace__ (GH-91619) · python/cpython@37965d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 37965d2

Browse files
authored
gh-78607: Replace __ltrace__ with __lltrace__ (GH-91619)
1 parent 8560f4a commit 37965d2

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

Doc/using/configure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Effects of a debug build:
273273
* Add :func:`sys.gettotalrefcount` function.
274274
* Add :option:`-X showrefcount <-X>` command line option.
275275
* Add :envvar:`PYTHONTHREADDEBUG` environment variable.
276-
* Add support for the ``__ltrace__`` variable: enable low-level tracing in the
276+
* Add support for the ``__lltrace__`` variable: enable low-level tracing in the
277277
bytecode evaluation loop if the variable is defined.
278278
* Install :ref:`debug hooks on memory allocators <default-memory-allocators>`
279279
to detect buffer overflow and other memory errors.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ struct _Py_global_strings {
137137
STRUCT_FOR_ID(__le__)
138138
STRUCT_FOR_ID(__len__)
139139
STRUCT_FOR_ID(__length_hint__)
140+
STRUCT_FOR_ID(__lltrace__)
140141
STRUCT_FOR_ID(__loader__)
141142
STRUCT_FOR_ID(__lshift__)
142143
STRUCT_FOR_ID(__lt__)
143-
STRUCT_FOR_ID(__ltrace__)
144144
STRUCT_FOR_ID(__main__)
145145
STRUCT_FOR_ID(__matmul__)
146146
STRUCT_FOR_ID(__missing__)

Include/internal/pycore_runtime_init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,10 @@ extern "C" {
760760
INIT_ID(__le__), \
761761
INIT_ID(__len__), \
762762
INIT_ID(__length_hint__), \
763+
INIT_ID(__lltrace__), \
763764
INIT_ID(__loader__), \
764765
INIT_ID(__lshift__), \
765766
INIT_ID(__lt__), \
766-
INIT_ID(__ltrace__), \
767767
INIT_ID(__main__), \
768768
INIT_ID(__matmul__), \
769769
INIT_ID(__missing__), \

Lib/test/test_lltrace.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def dont_trace_2():
4848
x = 42
4949
y = -x
5050
dont_trace_1()
51-
__ltrace__ = 1
51+
__lltrace__ = 1
5252
trace_me()
53-
del __ltrace__
53+
del __lltrace__
5454
dont_trace_2()
5555
""")
5656
self.assertIn("GET_ITER", stdout)
@@ -67,7 +67,7 @@ def dont_trace_2():
6767
def test_lltrace_different_module(self):
6868
stdout = self.run_code("""
6969
from test import test_lltrace
70-
test_lltrace.__ltrace__ = 1
70+
test_lltrace.__lltrace__ = 1
7171
test_lltrace.example()
7272
""")
7373
self.assertIn("'example' in module 'test.test_lltrace'", stdout)
@@ -95,13 +95,13 @@ def test_lltrace_different_module(self):
9595
def test_lltrace_does_not_crash_on_subscript_operator(self):
9696
# If this test fails, it will reproduce a crash reported as
9797
# bpo-34113. The crash happened at the command line console of
98-
# debug Python builds with __ltrace__ enabled (only possible in console),
98+
# debug Python builds with __lltrace__ enabled (only possible in console),
9999
# when the internal Python stack was negatively adjusted
100100
stdout = self.run_code("""
101101
import code
102102
103103
console = code.InteractiveConsole()
104-
console.push('__ltrace__ = 1')
104+
console.push('__lltrace__ = 1')
105105
console.push('a = [1, 2, 3]')
106106
console.push('a[0] = 1')
107107
print('unreachable if bug exists')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The LLTRACE special build now looks for the name ``__lltrace__`` defined in module globals, rather than the name ``__ltrace__``, which had been introduced as a typo.

Misc/SpecialBuilds.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Compile in support for Low Level TRACE-ing of the main interpreter loop.
9494

9595
When this preprocessor symbol is defined, before PyEval_EvalFrame executes a
9696
frame's code it checks the frame's global namespace for a variable
97-
"__ltrace__". If such a variable is found, mounds of information about what
97+
"__lltrace__". If such a variable is found, mounds of information about what
9898
the interpreter is doing are sprayed to stdout, such as every opcode and opcode
9999
argument and values pushed onto and popped off the value stack.
100100

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
17291729

17301730
#ifdef LLTRACE
17311731
{
1732-
int r = PyDict_Contains(GLOBALS(), &_Py_ID(__ltrace__));
1732+
int r = PyDict_Contains(GLOBALS(), &_Py_ID(__lltrace__));
17331733
if (r < 0) {
17341734
goto exit_unwind;
17351735
}

Tools/c-analyzer/TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ Python/ceval.c:_PyEval_EvalFrameDefault():PyId___annotations__ _Py_IDENTIFIER(
468468
Python/ceval.c:_PyEval_EvalFrameDefault():PyId___build_class__ _Py_IDENTIFIER(__build_class__)
469469
Python/ceval.c:_PyEval_EvalFrameDefault():PyId___enter__ _Py_IDENTIFIER(__enter__)
470470
Python/ceval.c:_PyEval_EvalFrameDefault():PyId___exit__ _Py_IDENTIFIER(__exit__)
471-
Python/ceval.c:_PyEval_EvalFrameDefault():PyId___ltrace__ _Py_IDENTIFIER(__ltrace__)
472471
Python/ceval.c:_PyEval_EvalFrameDefault():PyId_displayhook _Py_IDENTIFIER(displayhook)
473472
Python/ceval.c:_PyEval_EvalFrameDefault():PyId_send _Py_IDENTIFIER(send)
474473
Python/ceval.c:import_all_from():PyId___all__ _Py_IDENTIFIER(__all__)

0 commit comments

Comments
 (0)
0