Skip to content

Methods appearing as "<unknown field type>" on Node.js v8.x+ #198

Description

@mmarchini
  • Version: llnode master
  • Platform: OS X (10.13.4)
  • Subsystem: findjsinstances -d, inspect

llnode can't inspect methods on Node.js v8.x or later. v6.x works fine.

node v6.14.2

(lldb) v8 findjsinstances -d Lero
0x00001897d2db3639:<Object: Lero properties {
    .constructor=0x00001897d2db35d1:<function: Lero at /Users/mmarchini/tmp/llnode-example/index.js:4:14>,
    .foo=0x00001897d2db3841:<function: foo at /Users/mmarchini/tmp/llnode-example/index.js:8:6>}>
0x00001897d2db3fb9:<Object: Lero properties {
    .lala=0x00001897d2db4051:<Object: Object>}>
0x00001897d2db40d1:<Object: Lero properties {
    .lala=0x00001897d2db4131:<Object: Object>}>

node v8.0.0 (or later)

(lldb) v8 findjsinstances -d Lero
0x000008c85fc57999:<Object: Lero properties {
    .constructor=<unknown field type>,
    .foo=<unknown field type>}>
0x000008c85fc58161:<Object: Lero properties {
    .lala=0x000008c85fc581c1:<Object: Object>}>
0x000008c85fc58241:<Object: Lero properties {
    .lala=0x000008c85fc582a1:<Object: Object>}>

index.js

class Lero {
  constructor() {
    this.lala = {};
  }

  foo(a) {
    return a;
  }
}

class Lira {
  constructor() {
    this.lele = {};
  }
}

function Lura() {
  this.lele = 1;
  this.constructor = function() {};
}

const lura = new Lura();
lura.lorem = "ipsum";

const lero = new Lero();

function foo() {
  const lero2 = new Lero();
  boom();
}


foo();

Activity

  1. thlorenz commented on May 16, 2018

    @thlorenz

    This happened to me as well. Make sure to load the plugin manually in lldb or relink it if you updated your llnode global install (i.e. if it ended up in a different location).
    The below worked for me on OSX.

    mkdir -p ~/Library/Application\ Support/LLDB/PlugIns
    ln -sf <path-to-npm-global-installs>/lib/node_modules/llnode/llnode.dylib \
        ~/Library/Application\ Support/LLDB/PlugIns/
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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