[Python-checkins] r73118 - in python/branches/release26-maint: Lib/test/test_trace.py Misc/NEWS Objects/frameobject.c

amaury.forgeotdarc python-checkins at python.org
Tue Jun 2 00:04:41 CEST 2009


Author: amaury.forgeotdarc
Date: Tue Jun 2 00:04:41 2009
New Revision: 73118
Log:
Merged revisions 73114 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk
........
 r73114 | amaury.forgeotdarc | 2009年06月01日 22:53:18 +0200 (lun., 01 juin 2009) | 3 lines
 
 #4547: When debugging a very large function, it was not always
 possible to update the lineno attribute of the current frame.
........
Modified:
 python/branches/release26-maint/ (props changed)
 python/branches/release26-maint/Lib/test/test_trace.py
 python/branches/release26-maint/Misc/NEWS
 python/branches/release26-maint/Objects/frameobject.c
Modified: python/branches/release26-maint/Lib/test/test_trace.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_trace.py	(original)
+++ python/branches/release26-maint/Lib/test/test_trace.py	Tue Jun 2 00:04:41 2009
@@ -740,6 +740,23 @@
 def test_19_no_jump_without_trace_function(self):
 no_jump_without_trace_function()
 
+ def test_20_large_function(self):
+ d = {}
+ exec("""def f(output): # line 0
+ x = 0 # line 1
+ y = 1 # line 2
+ ''' # line 3
+ %s # lines 4-1004
+ ''' # line 1005
+ x += 1 # line 1006
+ output.append(x) # line 1007
+ return""" % ('\n' * 1000,), d)
+ f = d['f']
+
+ f.jump = (2, 1007)
+ f.output = [0]
+ self.run_test(f)
+
 def test_main():
 test_support.run_unittest(
 TraceTestCase,
Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Tue Jun 2 00:04:41 2009
@@ -12,6 +12,9 @@
 Core and Builtins
 -----------------
 
+- Issue #4547: When debugging a very large function, it was not always
+ possible to update the lineno attribute of the current frame.
+
 - Issue #5330: C functions called with keyword arguments were not reported by
 the various profiling modules (profile, cProfile). Patch by Hagen F�rstenau.
 
Modified: python/branches/release26-maint/Objects/frameobject.c
==============================================================================
--- python/branches/release26-maint/Objects/frameobject.c	(original)
+++ python/branches/release26-maint/Objects/frameobject.c	Tue Jun 2 00:04:41 2009
@@ -70,7 +70,7 @@
 	int new_iblock = 0;		/* The new value of f_iblock */
 	unsigned char *code = NULL;	/* The bytecode for the frame... */
 	Py_ssize_t code_len = 0;	/* ...and its length */
-	char *lnotab = NULL;		/* Iterating over co_lnotab */
+	unsigned char *lnotab = NULL;	/* Iterating over co_lnotab */
 	Py_ssize_t lnotab_len = 0;	/* (ditto) */
 	int offset = 0;			/* (ditto) */
 	int line = 0;			/* (ditto) */
@@ -114,7 +114,8 @@
 
 	/* Find the bytecode offset for the start of the given line, or the
 	 * first code-owning line after it. */
-	PyString_AsStringAndSize(f->f_code->co_lnotab, &lnotab, &lnotab_len);
+	PyString_AsStringAndSize((char*)f->f_code->co_lnotab,
+	 &lnotab, &lnotab_len);
 	addr = 0;
 	line = f->f_code->co_firstlineno;
 	new_lasti = -1;


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /