DebugClients/Python3/PyProfile.py

changeset 2953
703452a2876f
parent 2302
f29e9405c851
child 2987
c99695c0f13a
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
111 this can break debugging as the .pyc will refer to the .py 111 this can break debugging as the .pyc will refer to the .py
112 on the original machine. Another case might be sharing 112 on the original machine. Another case might be sharing
113 code over a network... This logic deals with that. 113 code over a network... This logic deals with that.
114 114
115 @param frame the frame object 115 @param frame the frame object
116 @return fixed up file name (string)
116 """ 117 """
117 # get module name from __file__ 118 # get module name from __file__
118 if not isinstance(frame, profile.Profile.fake_frame) and \ 119 if not isinstance(frame, profile.Profile.fake_frame) and \
119 '__file__' in frame.f_globals: 120 '__file__' in frame.f_globals:
120 root, ext = os.path.splitext(frame.f_globals['__file__']) 121 root, ext = os.path.splitext(frame.f_globals['__file__'])
133 """ 134 """
134 Private method used to trace functions calls. 135 Private method used to trace functions calls.
135 136
136 This is a variant of the one found in the standard Python 137 This is a variant of the one found in the standard Python
137 profile.py calling fix_frame_filename above. 138 profile.py calling fix_frame_filename above.
139
140 @param frame reference to the call frame
141 @param t arguments
142 @return flag indicating a successful handling (boolean)
138 """ 143 """
139 if self.cur and frame.f_back is not self.cur[-2]: 144 if self.cur and frame.f_back is not self.cur[-2]:
140 rpt, rit, ret, rfn, rframe, rcur = self.cur 145 rpt, rit, ret, rfn, rframe, rcur = self.cur
141 if not isinstance(rframe, profile.Profile.fake_frame): 146 if not isinstance(rframe, profile.Profile.fake_frame):
142 assert rframe.f_back is frame.f_back, ("Bad call", rfn, 147 assert rframe.f_back is frame.f_back, ("Bad call", rfn,

eric ide

mercurial