Beispiel #1
0
 def filename(self):
     this_frame = self.info["this_frame"]
     if this_frame is not None:
         if gdb.types.has_field(this_frame.type.target(), "calleeToken_"):
             script = self._decode_jitframe(this_frame)["script"]
             if script is not None:
                 obj = script['sourceObject_']['value']
                 # Verify that this is a ScriptSource object.
                 # FIXME should also deal with wrappers here.
                 nativeobj = obj.cast(self.cache.NativeObject)
                 # See bug 987069 and despair.  At least this
                 # approach won't give exceptions.
                 class_name = nativeobj['group_']['value']['clasp_']['name'].string("ISO-8859-1")
                 if class_name != "ScriptSource":
                     return FrameDecorator.filename(self)
                 scriptsourceobj = (nativeobj + 1).cast(self.cache.HeapSlot)[self.cache.SOURCE_SLOT]
                 scriptsource = scriptsourceobj['value']['data']['asBits'] << 1
                 scriptsource = scriptsource.cast(self.cache.ScriptSource)
                 return scriptsource['filename_']['mTuple']['mFirstA'].string()
     return FrameDecorator.filename(self)
Beispiel #2
0
 def filename(self):
     this_frame = self.info["this_frame"]
     if this_frame is not None:
         if gdb.types.has_field(this_frame.type.target(), "calleeToken_"):
             script = self._decode_jitframe(this_frame)["script"]
             if script is not None:
                 obj = script['sourceObject_']['value']
                 # Verify that this is a ScriptSource object.
                 # FIXME should also deal with wrappers here.
                 nativeobj = obj.cast(self.cache.NativeObject)
                 # See bug 987069 and despair.  At least this
                 # approach won't give exceptions.
                 class_name = nativeobj['group_']['value']['clasp_']['name'].string("ISO-8859-1")
                 if class_name != "ScriptSource":
                     return FrameDecorator.filename(self)
                 scriptsourceobj = (nativeobj + 1).cast(self.cache.HeapSlot)[self.cache.SOURCE_SLOT]
                 scriptsource = scriptsourceobj['value']['data']['asBits'] << 1
                 scriptsource = scriptsource.cast(self.cache.ScriptSource)
                 return scriptsource['filename_']['mTuple']['mFirstA'].string()
     return FrameDecorator.filename(self)