DebugClients/Python/PyProfile.py

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

eric ide

mercurial