mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	 a785c87d6e
			
		
	
	
		a785c87d6e
		
	
	
	
	
		
			
			Tested on macOS 10.11 dtrace, Ubuntu 16.04 SystemTap, and libbcc. Largely based by an initial patch by Jesús Cea Avión, with some influence from Dave Malcolm's SystemTap patch and Nikhil Benesch's unification patch. Things deliberately left out for simplicity: - ustack helpers, I have no way of testing them at this point since they are Solaris-specific - PyFrameObject * in function__entry/function__return, this is SystemTap-specific - SPARC support - dynamic tracing - sys module dtrace facility introspection All of those might be added later.
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			293 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			293 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| def test_line():
 | |
|     a = 1
 | |
|     print('# Preamble', a)
 | |
|     for i in range(2):
 | |
|         a = i
 | |
|         b = i+2
 | |
|         c = i+3
 | |
|         if c < 4:
 | |
|             a = c
 | |
|         d = a + b +c
 | |
|         print('#', a, b, c, d)
 | |
|     a = 1
 | |
|     print('# Epilogue', a)
 | |
| 
 | |
| 
 | |
| if __name__ == '__main__':
 | |
|     test_line()
 |