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 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2078 print " code: %08X" % reader.exception.exception.code | 2078 print " code: %08X" % reader.exception.exception.code |
2079 print " context:" | 2079 print " context:" |
2080 for r in CONTEXT_FOR_ARCH[reader.arch]: | 2080 for r in CONTEXT_FOR_ARCH[reader.arch]: |
2081 print " %s: %s" % (r, reader.FormatIntPtr(reader.Register(r))) | 2081 print " %s: %s" % (r, reader.FormatIntPtr(reader.Register(r))) |
2082 # TODO(vitalyr): decode eflags. | 2082 # TODO(vitalyr): decode eflags. |
2083 if reader.arch == MD_CPU_ARCHITECTURE_ARM: | 2083 if reader.arch == MD_CPU_ARCHITECTURE_ARM: |
2084 print " cpsr: %s" % bin(reader.exception_context.cpsr)[2:] | 2084 print " cpsr: %s" % bin(reader.exception_context.cpsr)[2:] |
2085 else: | 2085 else: |
2086 print " eflags: %s" % bin(reader.exception_context.eflags)[2:] | 2086 print " eflags: %s" % bin(reader.exception_context.eflags)[2:] |
2087 | 2087 |
2088 print | 2088 # TODO(mstarzinger): Disabled because broken, needs investigation. |
2089 print " modules:" | 2089 #print |
2090 for module in reader.module_list.modules: | 2090 #print " modules:" |
2091 name = GetModuleName(reader, module) | 2091 #for module in reader.module_list.modules: |
2092 if name in KNOWN_MODULES: | 2092 # name = GetModuleName(reader, module) |
2093 print " %s at %08X" % (name, module.base_of_image) | 2093 # if name in KNOWN_MODULES: |
2094 reader.TryLoadSymbolsFor(name, module) | 2094 # print " %s at %08X" % (name, module.base_of_image) |
| 2095 # reader.TryLoadSymbolsFor(name, module) |
2095 print | 2096 print |
2096 | 2097 |
2097 stack_top = reader.ExceptionSP() | 2098 stack_top = reader.ExceptionSP() |
2098 stack_bottom = exception_thread.stack.start + \ | 2099 stack_bottom = exception_thread.stack.start + \ |
2099 exception_thread.stack.memory.data_size | 2100 exception_thread.stack.memory.data_size |
2100 stack_map = {reader.ExceptionIP(): -1} | 2101 stack_map = {reader.ExceptionIP(): -1} |
2101 for slot in xrange(stack_top, stack_bottom, reader.PointerSize()): | 2102 for slot in xrange(stack_top, stack_bottom, reader.PointerSize()): |
2102 maybe_address = reader.ReadUIntPtr(slot) | 2103 maybe_address = reader.ReadUIntPtr(slot) |
2103 if not maybe_address in stack_map: | 2104 if not maybe_address in stack_map: |
2104 stack_map[maybe_address] = slot | 2105 stack_map[maybe_address] = slot |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 options, args = parser.parse_args() | 2162 options, args = parser.parse_args() |
2162 if os.path.exists(options.objdump): | 2163 if os.path.exists(options.objdump): |
2163 disasm.OBJDUMP_BIN = options.objdump | 2164 disasm.OBJDUMP_BIN = options.objdump |
2164 OBJDUMP_BIN = options.objdump | 2165 OBJDUMP_BIN = options.objdump |
2165 else: | 2166 else: |
2166 print "Cannot find %s, falling back to default objdump" % options.objdump | 2167 print "Cannot find %s, falling back to default objdump" % options.objdump |
2167 if len(args) != 1: | 2168 if len(args) != 1: |
2168 parser.print_help() | 2169 parser.print_help() |
2169 sys.exit(1) | 2170 sys.exit(1) |
2170 AnalyzeMinidump(options, args[0]) | 2171 AnalyzeMinidump(options, args[0]) |
OLD | NEW |