Skip to content

Expose _v8_internal_Print_Object symbol for debug addon and Node.js core easily #32402

Closed
@gengjiawen

Description

@gengjiawen

Is your feature request related to a problem? Please describe.
Currently we can't debug v8::Value due to some symbol not exposed
After we import https://github.com/nodejs/node/blob/master/deps/v8/tools/lldb_commands.py in lldb, if we want to print a v8 value, it's not working

image

With the result, making hard to debug

Failed to evaluate command _v8_internal_Print_Object(*((v8::internal::Object**)((void*)(s).val_))) :
error: <user expression 0>:1:44: no member named 'Object' in namespace 'v8::internal'
_v8_internal_Print_Object(*((v8::internal::Object**)((void*)(s).val_)))
                             ~~~~~~~~~~~~~~^
error: <user expression 0>:1:52: expected expression
_v8_internal_Print_Object(*((v8::internal::Object**)((void*)(s).val_)))

This could be fixed by running a debug Node.js, but it's not very friendly for developers.

Source should here: https://github.com/nodejs/node/blob/2883c855e0105b51e5c8020d21458af109ffe3d4/deps/v8/src/diagnostics/objects-printer.cc#L2678-L2677

Describe the solution you'd like

Maybe expose it via node.h or declare this api public ?

cc @addaleax @bnoordhuis @danbev @joyeecheung @nodejs/n-api

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions