Esempio n. 1
0
 def frame_args(self):
     this_frame = self.info["this_frame"]
     if this_frame is None:
         return FrameDecorator.frame_args(self)
     if not gdb.types.has_field(this_frame.type.target(), "numActualArgs_"):
         return FrameDecorator.frame_args(self)
     # See if this is a function call.
     if self._decode_jitframe(this_frame)["function"] is None:
         return FrameDecorator.frame_args(self)
     # Construct and return an iterable of all the arguments.
     result = []
     num_args = long(this_frame["numActualArgs_"])
     # Sometimes we see very large values here, so truncate it to
     # bypass the damage.
     if num_args > 10:
         num_args = 10
     args_ptr = (this_frame + 1).cast(self.cache.Value.pointer())
     for i in range(num_args + 1):
         # Synthesize names, since there doesn't seem to be
         # anything better to do.
         if i == 0:
             name = 'this'
         else:
             name = 'arg%d' % i
         result.append(FrameSymbol(name, args_ptr[i]))
     return result
Esempio n. 2
0
 def frame_args(self):
     this_frame = self.info["this_frame"]
     if this_frame is None:
         return FrameDecorator.frame_args(self)
     if not gdb.types.has_field(this_frame.type.target(), "numActualArgs_"):
         return FrameDecorator.frame_args(self)
     # See if this is a function call.
     if self._decode_jitframe(this_frame)["function"] is None:
         return FrameDecorator.frame_args(self)
     # Construct and return an iterable of all the arguments.
     result = []
     num_args = long(this_frame["numActualArgs_"])
     # Sometimes we see very large values here, so truncate it to
     # bypass the damage.
     if num_args > 10:
         num_args = 10
     args_ptr = (this_frame + 1).cast(self.cache.Value.pointer())
     for i in range(num_args + 1):
         # Synthesize names, since there doesn't seem to be
         # anything better to do.
         if i == 0:
             name = 'this'
         else:
             name = 'arg%d' % i
         result.append(FrameSymbol(name, args_ptr[i]))
     return result
Esempio n. 3
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)
Esempio n. 4
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)
Esempio n. 5
0
 def function(self):
     if self.info["name"] is None:
         return FrameDecorator.function(self)
     name = self.info["name"]
     result = "<<" + name
     # If we have a frame, we can extract the callee information
     # from it for display here.
     this_frame = self.info["this_frame"]
     if this_frame is not None:
         if gdb.types.has_field(this_frame.type.target(), "calleeToken_"):
             function = self._decode_jitframe(this_frame)["function"]
             if function is not None:
                 result = result + " " + function
     return result + ">>"
Esempio n. 6
0
 def function(self):
     if self.info["name"] is None:
         return FrameDecorator.function(self)
     name = self.info["name"]
     result = "<<" + name
     # If we have a frame, we can extract the callee information
     # from it for display here.
     this_frame = self.info["this_frame"]
     if this_frame is not None:
         if gdb.types.has_field(this_frame.type.target(), "calleeToken_"):
             function = self._decode_jitframe(this_frame)["function"]
             if function is not None:
                 result = result + " " + function
     return result + ">>"
Esempio n. 7
0
 def function(self):
     if "name" in self.info:
         return "<<" + self.info["name"] + ">>"
     return FrameDecorator.function(self)
Esempio n. 8
0
 def function(self):
     if "name" in self.info:
         return "<<" + self.info["name"] + ">>"
     return FrameDecorator.function(self)
Esempio n. 9
0
 def __init__(self, frame):
     FrameDecorator.__init__(self, frame)
Esempio n. 10
0
 def __init__(self, frame):
     FrameDecorator.__init__(self, frame)