| OLD | NEW |
| 1 # Copyright 2014 the V8 project authors. All rights reserved. | 1 # Copyright 2014 the V8 project authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Print HeapObjects. | 5 # Print HeapObjects. |
| 6 define job | 6 define job |
| 7 call _v8_internal_Print_Object((void*)($arg0)) | 7 call _v8_internal_Print_Object((void*)($arg0)) |
| 8 end | 8 end |
| 9 document job | 9 document job |
| 10 Print a v8 JavaScript object | 10 Print a v8 JavaScript object |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 end | 65 end |
| 66 document jss | 66 document jss |
| 67 Skip the jitted stack on x64 to where we entered JS last. | 67 Skip the jitted stack on x64 to where we entered JS last. |
| 68 Usage: jss | 68 Usage: jss |
| 69 end | 69 end |
| 70 | 70 |
| 71 # Print stack trace with assertion scopes. | 71 # Print stack trace with assertion scopes. |
| 72 define bta | 72 define bta |
| 73 python | 73 python |
| 74 import re | 74 import re |
| 75 frame_re = re.compile("^#(\d+).* in (\S+) .+ at (.+)") | 75 frame_re = re.compile("^#(\d+)\s*(?:0x[a-f\d]+ in )?(.+) \(.+ at (.+)") |
| 76 assert_re = re.compile("^\s*(\S+) = .+<v8::internal::Per\w+AssertType::(\w+)_ASS
ERT, (false|true)>") | 76 assert_re = re.compile("^\s*(\S+) = .+<v8::internal::Per\w+AssertType::(\w+)_ASS
ERT, (false|true)>") |
| 77 btl = gdb.execute("backtrace full", to_string = True).splitlines() | 77 btl = gdb.execute("backtrace full", to_string = True).splitlines() |
| 78 for l in btl: | 78 for l in btl: |
| 79 match = frame_re.match(l) | 79 match = frame_re.match(l) |
| 80 if match: | 80 if match: |
| 81 print("[%-2s] %-60s %-40s" % (match.group(1), match.group(2), match.group(3)
)) | 81 print("[%-2s] %-60s %-40s" % (match.group(1), match.group(2), match.group(3)
)) |
| 82 match = assert_re.match(l) | 82 match = assert_re.match(l) |
| 83 if match: | 83 if match: |
| 84 if match.group(3) == "false": | 84 if match.group(3) == "false": |
| 85 prefix = "Disallow" | 85 prefix = "Disallow" |
| 86 color = "\033[91m" | 86 color = "\033[91m" |
| 87 else: | 87 else: |
| 88 prefix = "Allow" | 88 prefix = "Allow" |
| 89 color = "\033[92m" | 89 color = "\033[92m" |
| 90 print("%s -> %s %s (%s)\033[0m" % (color, prefix, match.group(2), match.grou
p(1))) | 90 print("%s -> %s %s (%s)\033[0m" % (color, prefix, match.group(2), match.grou
p(1))) |
| 91 end | 91 end |
| 92 end |
| 92 document bta | 93 document bta |
| 93 Print stack trace with assertion scopes | 94 Print stack trace with assertion scopes |
| 94 Usage: bta | 95 Usage: bta |
| 95 end | 96 end |
| 96 | 97 |
| 97 set disassembly-flavor intel | 98 set disassembly-flavor intel |
| 98 set disable-randomization off | 99 set disable-randomization off |
| OLD | NEW |