| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 the V8 project authors. All rights reserved. |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 HeapObject.__init__(self, heap, map, address) | 1100 HeapObject.__init__(self, heap, map, address) |
| 1101 self.length = self.SmiField(self.LengthOffset()) | 1101 self.length = self.SmiField(self.LengthOffset()) |
| 1102 | 1102 |
| 1103 def Print(self, p): | 1103 def Print(self, p): |
| 1104 p.Print("FixedArray(%s) {" % self.heap.reader.FormatIntPtr(self.address)) | 1104 p.Print("FixedArray(%s) {" % self.heap.reader.FormatIntPtr(self.address)) |
| 1105 p.Indent() | 1105 p.Indent() |
| 1106 p.Print("length: %d" % self.length) | 1106 p.Print("length: %d" % self.length) |
| 1107 base_offset = self.ElementsOffset() | 1107 base_offset = self.ElementsOffset() |
| 1108 for i in xrange(self.length): | 1108 for i in xrange(self.length): |
| 1109 offset = base_offset + 4 * i | 1109 offset = base_offset + 4 * i |
| 1110 p.Print("[%08d] = %s" % (i, self.ObjectField(offset))) | 1110 try: |
| 1111 p.Print("[%08d] = %s" % (i, self.ObjectField(offset))) |
| 1112 except TypeError: |
| 1113 p.Dedent() |
| 1114 p.Print("...") |
| 1115 p.Print("}") |
| 1116 return |
| 1111 p.Dedent() | 1117 p.Dedent() |
| 1112 p.Print("}") | 1118 p.Print("}") |
| 1113 | 1119 |
| 1114 def __str__(self): | 1120 def __str__(self): |
| 1115 return "FixedArray(%08x, length=%d)" % (self.address, self.length) | 1121 return "FixedArray(%08x, length=%d)" % (self.address, self.length) |
| 1116 | 1122 |
| 1117 | 1123 |
| 1118 class JSFunction(HeapObject): | 1124 class JSFunction(HeapObject): |
| 1119 def CodeEntryOffset(self): | 1125 def CodeEntryOffset(self): |
| 1120 return 3 * self.heap.PointerSize() | 1126 return 3 * self.heap.PointerSize() |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 parser = optparse.OptionParser(USAGE) | 1679 parser = optparse.OptionParser(USAGE) |
| 1674 parser.add_option("-s", "--shell", dest="shell", action="store_true", | 1680 parser.add_option("-s", "--shell", dest="shell", action="store_true", |
| 1675 help="start an interactive inspector shell") | 1681 help="start an interactive inspector shell") |
| 1676 parser.add_option("-f", "--full", dest="full", action="store_true", | 1682 parser.add_option("-f", "--full", dest="full", action="store_true", |
| 1677 help="dump all information contained in the minidump") | 1683 help="dump all information contained in the minidump") |
| 1678 options, args = parser.parse_args() | 1684 options, args = parser.parse_args() |
| 1679 if len(args) != 1: | 1685 if len(args) != 1: |
| 1680 parser.print_help() | 1686 parser.print_help() |
| 1681 sys.exit(1) | 1687 sys.exit(1) |
| 1682 AnalyzeMinidump(options, args[0]) | 1688 AnalyzeMinidump(options, args[0]) |
| OLD | NEW |