| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c667e6e commit 62e047e
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 5 | |
| 12 | 12 | #define V8_MINOR_VERSION 1 | |
| 13 | 13 | #define V8_BUILD_NUMBER 281 | |
| 14 | - #define V8_PATCH_LEVEL 99 | ||
| 14 | + #define V8_PATCH_LEVEL 100 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,72 @@ | |||
| 1 | + # Copyright 2017 the V8 project authors. All rights reserved. | ||
| 2 | + # Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + # found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + import lldb | ||
| 6 | + import re | ||
| 7 | + | ||
| 8 | + def jst(debugger, *args): | ||
| 9 | + """Print the current JavaScript stack trace""" | ||
| 10 | + target = debugger.GetSelectedTarget() | ||
| 11 | + process = target.GetProcess() | ||
| 12 | + thread = process.GetSelectedThread() | ||
| 13 | + frame = thread.GetSelectedFrame() | ||
| 14 | + frame.EvaluateExpression("_v8_internal_Print_StackTrace();") | ||
| 15 | + print("") | ||
| 16 | + | ||
| 17 | + def jss(debugger, *args): | ||
| 18 | + """Skip the jitted stack on x64 to where we entered JS last""" | ||
| 19 | + target = debugger.GetSelectedTarget() | ||
| 20 | + process = target.GetProcess() | ||
| 21 | + thread = process.GetSelectedThread() | ||
| 22 | + frame = thread.GetSelectedFrame() | ||
| 23 | + js_entry_sp = frame.EvaluateExpression( | ||
| 24 | + "v8::internal::Isolate::Current()->thread_local_top()->js_entry_sp_;") \ | ||
| 25 | + .GetValue() | ||
| 26 | + sizeof_void = frame.EvaluateExpression("sizeof(void*)").GetValue() | ||
| 27 | + rbp = frame.FindRegister("rbp") | ||
| 28 | + rsp = frame.FindRegister("rsp") | ||
| 29 | + pc = frame.FindRegister("pc") | ||
| 30 | + rbp = js_entry_sp | ||
| 31 | + rsp = js_entry_sp + 2 *sizeof_void | ||
| 32 | + pc.value = js_entry_sp + sizeof_void | ||
| 33 | + | ||
| 34 | + def bta(debugger, *args): | ||
| 35 | + """Print stack trace with assertion scopes""" | ||
| 36 | + func_name_re = re.compile("([^(<]+)(?:\(.+\))?") | ||
| 37 | + assert_re = re.compile( | ||
| 38 | + "^v8::internal::Per\w+AssertType::(\w+)_ASSERT, (false|true)>") | ||
| 39 | + target = debugger.GetSelectedTarget() | ||
| 40 | + process = target.GetProcess() | ||
| 41 | + thread = process.GetSelectedThread() | ||
| 42 | + frame = thread.GetSelectedFrame() | ||
| 43 | + for frame in thread: | ||
| 44 | + functionSignature = frame.GetDisplayFunctionName() | ||
| 45 | + if functionSignature is None: | ||
| 46 | + continue | ||
| 47 | + functionName = func_name_re.match(functionSignature) | ||
| 48 | + line = frame.GetLineEntry().GetLine() | ||
| 49 | + sourceFile = frame.GetLineEntry().GetFileSpec().GetFilename() | ||
| 50 | + if line: | ||
| 51 | + sourceFile = sourceFile + ":" + str(line) | ||
| 52 | + | ||
| 53 | + if sourceFile is None: | ||
| 54 | + sourceFile = "" | ||
| 55 | + print("[%-2s] %-60s %-40s" % (frame.GetFrameID(), | ||
| 56 | + functionName.group(1), | ||
| 57 | + sourceFile)) | ||
| 58 | + match = assert_re.match(str(functionSignature)) | ||
| 59 | + if match: | ||
| 60 | + if match.group(3) == "false": | ||
| 61 | + prefix = "Disallow" | ||
| 62 | + color = "\033[91m" | ||
| 63 | + else: | ||
| 64 | + prefix = "Allow" | ||
| 65 | + color = "\033[92m" | ||
| 66 | + print("%s -> %s %s (%s)\033[0m" % ( | ||
| 67 | + color, prefix, match.group(2), match.group(1))) | ||
| 68 | + | ||
| 69 | + def __lldb_init_module (debugger, dict): | ||
| 70 | + debugger.HandleCommand('command script add -f lldb_commands.jst jst') | ||
| 71 | + debugger.HandleCommand('command script add -f lldb_commands.jss jss') | ||
| 72 | + debugger.HandleCommand('command script add -f lldb_commands.bta bta') | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + # Copyright 2017 the V8 project authors. All rights reserved. | ||
| 2 | + # Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + # found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + # Print HeapObjects. | ||
| 6 | + command regex -h 'Print a v8 JavaScript object' job 's/(.+)/expr -- '_v8_internal_Print_Object((void*)(%1))/' | ||
| 7 | + | ||
| 8 | + # Print v8::Local handle value. | ||
| 9 | + command regex -h 'Print content of a v8::Local handle' jlh 's/(.+)/expr -- '_v8_internal_Print_Object(*(v8::internal::Object**)(*%1))/' | ||
| 10 | + | ||
| 11 | + # Print Code objects containing given PC. | ||
| 12 | + command regex -h 'Print a v8 Code object from an internal code address' jco 's/(.+)/expr -- '_v8_internal_Print_Code((void*)(*%1))/' | ||
| 13 | + | ||
| 14 | + # Print FeedbackVector | ||
| 15 | + command regex -h 'Print a v8 FeedbackVector object' jfv 's/(.+)/expr -- '_v8_internal_Print_FeedbackVector((void*)(%1))/' | ||
| 16 | + | ||
| 17 | + # Print DescriptorArray. | ||
| 18 | + command regex -h 'Print a v8 DescriptorArray object' jda 's/(.+)/expr -- '_v8_internal_Print_DescriptorArray((void*)(%1))/' | ||
| 19 | + | ||
| 20 | + # Print LayoutDescriptor. | ||
| 21 | + command regex -h 'Print a v8 LayoutDescriptor object' jld 's/(.+)/expr -- '_v8_internal_Print_LayoutDescriptor((void*)(%1))/' | ||
| 22 | + | ||
| 23 | + # Print TransitionArray. | ||
| 24 | + command regex -h 'Print a v8 TransitionArray object' jta 's/(.+)/expr -- '_v8_internal_Print_TransitionArray((void*)(%1))/' | ||
| 25 | + | ||
| 26 | + command script import ~/lldb_commands.py | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,6 +133,8 @@ def files(action): | |||
| 133 | 133 | action(['src/node.stp'], 'share/systemtap/tapset/') | |
| 134 | 134 | ||
| 135 | 135 | action(['deps/v8/tools/gdbinit'], 'share/doc/node/') | |
| 136 | + action(['deps/v8/tools/lldbinit'], 'share/doc/node/') | ||
| 137 | + action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/') | ||
| 136 | 138 | ||
| 137 | 139 | if 'freebsd' in sys.platform or 'openbsd' in sys.platform: | |
| 138 | 140 | action(['doc/node.1'], 'man/man1/') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments