Skip to content

I do not know how to debug args array in a FunctionCallbackInfo with gdb #3566

Closed as not planned
@juanarbol

Description

@juanarbol
  • Node.js Version: Current
  • OS: Linux
  • Scope (install, code, runtime, meta, other?): Debug internals
  • Module (and version) (if relevant):

For some reason, gdb is grabbing the wrong object in debug

Thread 1 "node_g" hit Breakpoint 1, node::StreamBase::WriteString<(node::encoding)1> (this=0x5c9da78, args=...) at ../src/stream_base.cc:218
218       Environment* env = Environment::GetCurrent(args);
(gdb) framwe
Undefined command: "framwe".  Try "help".
(gdb) frame
#0  node::StreamBase::WriteString<(node::encoding)1> (this=0x5c9da78, args=...) at ../src/stream_base.cc:218
218       Environment* env = Environment::GetCurrent(args);
(gdb) n
219       CHECK(args[0]->IsObject());
(gdb) ptype args
type = const struct node::AssertionInfo {
    const char *file_line;
    const char *message;
    const char *function;
}
(gdb) p args->function
$14 = 0x32607c8 "int node::StreamBase::WriteString(const FunctionCallbackInfo<v8::Value> &) [enc = node::UTF8]"
(gdb) p args[0]->IsObject()
No symbol "operator[]" in current context.
(gdb) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions