@@ -60,7 +60,7 @@ def run_gdb(self, *args):
6060 return out .decode ('iso-8859-1' ), err .decode ('iso-8859-1' )
6161
6262 def get_stack_trace (self , source = None , script = None ,
63- breakpoint = 'PyObject_Print ' ,
63+ breakpoint = 'textiowrapper_write ' ,
6464 cmds_after_breakpoint = None ,
6565 import_site = False ):
6666 '''
@@ -78,7 +78,7 @@ def get_stack_trace(self, source=None, script=None,
7878 # error, which typically happens python is dynamically linked (the
7979 # breakpoints of interest are to be found in the shared library)
8080 # When this happens, we still get:
81- # Function "PyObject_Print " not defined.
81+ # Function "textiowrapper_write " not defined.
8282 # emitted to stderr each time, alas.
8383
8484 # Initially I had "--eval-command=continue" here, but removed it to
@@ -130,18 +130,18 @@ def get_gdb_repr(self, source,
130130 import_site = False ):
131131 # Given an input python source representation of data,
132132 # run "python -c'print DATA'" under gdb with a breakpoint on
133- # PyObject_Print and scrape out gdb's representation of the "op"
133+ # textiowrapper_write and scrape out gdb's representation of the "op"
134134 # parameter, and verify that the gdb displays the same string
135135 #
136136 # For a nested structure, the first time we hit the breakpoint will
137137 # give us the top-level structure
138- gdb_output = self .get_stack_trace (source , breakpoint = 'PyObject_Print ' ,
138+ gdb_output = self .get_stack_trace (source , breakpoint = 'textiowrapper_write ' ,
139139 cmds_after_breakpoint = cmds_after_breakpoint ,
140140 import_site = import_site )
141141 # gdb can insert additional '\n' and space characters in various places
142142 # in its output, depending on the width of the terminal it's connected
143143 # to (using its "wrap_here" function)
144- m = re .match ('.*#0\s+PyObject_Print \s+\(\s*op\=\s*(.*?),\s+fp=.*\).*' ,
144+ m = re .match ('.*#0\s+textiowrapper_write \s+\(\s*op\=\s*(.*?),\s+fp=.*\).*' ,
145145 gdb_output , re .DOTALL )
146146 if not m :
147147 self .fail ('Unexpected gdb output: %r\n %s' % (gdb_output , gdb_output ))
@@ -163,7 +163,7 @@ def get_sample_script(self):
163163class PrettyPrintTests (DebuggerTests ):
164164 def test_getting_backtrace (self ):
165165 gdb_output = self .get_stack_trace ('print(42)' )
166- self .assertTrue ('PyObject_Print ' in gdb_output )
166+ self .assertTrue ('textiowrapper_write ' in gdb_output )
167167
168168 def assertGdbRepr (self , val , cmds_after_breakpoint = None ):
169169 # Ensure that gdb's rendering of the value in a debugged process
@@ -533,7 +533,7 @@ def foo(a, b, c):
533533
534534foo(3, 4, 5)
535535print foo.__code__''' ,
536- breakpoint = 'PyObject_Print ' ,
536+ breakpoint = 'textiowrapper_write ' ,
537537 cmds_after_breakpoint = ['print (PyFrameObject*)(((PyCodeObject*)op)->co_zombieframe)' ]
538538 )
539539 self .assertTrue (re .match (r'.*\s+\$1 =\s+Frame 0x[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*' ,
0 commit comments