Beispiel #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
Beispiel #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