From 178882b2a090105aad48252b80b89809e2ceac5a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 15 Aug 2017 23:07:25 +0800 Subject: [PATCH] src: support stub frames --- src/llv8-constants.cc | 1 + src/llv8-constants.h | 1 + src/llv8.cc | 2 ++ test/frame-test.js | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/llv8-constants.cc b/src/llv8-constants.cc index 4b75b180..ff68c812 100644 --- a/src/llv8-constants.cc +++ b/src/llv8-constants.cc @@ -522,6 +522,7 @@ void Frame::Load() { kConstructFrame = LoadConstant("frametype_ConstructFrame"); kJSFrame = LoadConstant("frametype_JavaScriptFrame"); kOptimizedFrame = LoadConstant("frametype_OptimizedFrame"); + kStubFrame = LoadConstant("frametype_StubFrame"); } diff --git a/src/llv8-constants.h b/src/llv8-constants.h index 699d0c93..3cc4e273 100644 --- a/src/llv8-constants.h +++ b/src/llv8-constants.h @@ -452,6 +452,7 @@ class Frame : public Module { int64_t kConstructFrame; int64_t kJSFrame; int64_t kOptimizedFrame; + int64_t kStubFrame; protected: void Load(); diff --git a/src/llv8.cc b/src/llv8.cc index 64606e49..ec18c305 100644 --- a/src/llv8.cc +++ b/src/llv8.cc @@ -267,6 +267,8 @@ std::string JSFrame::Inspect(bool with_args, Error& err) { return ""; } else if (value == v8()->frame()->kConstructFrame) { return ""; + } else if (value == v8()->frame()->kStubFrame) { + return ""; } else if (value != v8()->frame()->kJSFrame && value != v8()->frame()->kOptimizedFrame) { err = Error::Failure("Unknown frame marker"); diff --git a/test/frame-test.js b/test/frame-test.js index 69861344..f4f047fc 100644 --- a/test/frame-test.js +++ b/test/frame-test.js @@ -18,7 +18,7 @@ tape('v8 stack', (t) => { // FIXME(bnoordhuis) This can fail with versions of lldb that don't // support the GetMemoryRegions() API; llnode won't be able to identify // V8 builtins stack frames, it just prints them as anonymous frames. - lines = lines.filter((s) => !//.test(s)); + lines = lines.filter((s) => !/|/.test(s)); const eyecatcher = lines[0]; const adapter = lines[1]; const crasher = lines[2];