-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: Treat embeded builtins as V8 functions #301
Conversation
On Node.js v12 most builtins are compiled during build time and embeded in the binary. Because of that, LLDB will think it knows how to handle these frames (especially JavaScript frames). To correctly handle those frames, we check the function name, if it starts with `Builtins_` we'll handle it as a JIT function. This method should be safe since any C++ function coming from V8 or Node.js will be mangled, thus beginning with `_Z...`. There might be a better way to handle this, but for now this check should be enough.
Codecov Report
@@ Coverage Diff @@
## master #301 +/- ##
==========================================
+ Coverage 78.6% 78.89% +0.29%
==========================================
Files 33 33
Lines 4225 4227 +2
==========================================
+ Hits 3321 3335 +14
+ Misses 904 892 -12
Continue to review full report at Codecov.
|
cc @nodejs/llnode |
@@ -69,7 +69,12 @@ bool BacktraceCmd::DoExecute(SBDebugger d, char** cmd, | |||
const char star = (frame == selected_frame ? '*' : ' '); | |||
const uint64_t pc = frame.GetPC(); | |||
|
|||
if (!frame.GetSymbol().IsValid()) { | |||
// TODO(mmarchini): There might be a better way to check for V8 builtins | |||
// embeded in the binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// embeded in the binary. | |
// embedded in the binary. |
On Node.js v12 most builtins are compiled during build time and embeded in the binary. Because of that, LLDB will think it knows how to handle these frames (especially JavaScript frames). To correctly handle those frames, we check the function name, if it starts with `Builtins_` we'll handle it as a JIT function. This method should be safe since any C++ function coming from V8 or Node.js will be mangled, thus beginning with `_Z...`. There might be a better way to handle this, but for now this check should be enough. PR-URL: #301 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in 2964af5 |
On Node.js v12 most builtins are compiled during build time and embeded
in the binary. Because of that, LLDB will think it knows how to handle
these frames (especially JavaScript frames). To correctly handle those
frames, we check the function name, if it starts with
Builtins_
we'llhandle it as a JIT function. This method should be safe since any C++
function coming from V8 or Node.js will be mangled, thus beginning with
_Z...
. There might be a better way to handle this, but for now thischeck should be enough.