Git Product home page Git Product logo

Comments (14)

indutny avatar indutny commented on July 26, 2024 1

Thank you for reporting this!

Does this patch fix the compilation error?

diff --git a/src/llscan.cc b/src/llscan.cc
index 2f9fb5a..5418d80 100644
--- a/src/llscan.cc
+++ b/src/llscan.cc
@@ -1,9 +1,9 @@
 #include <errno.h>
-#include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>

 #include <algorithm>
+#include <cinttypes>
 #include <fstream>
 #include <vector>

diff --git a/src/llv8.cc b/src/llv8.cc
index 5f878be..b6f60a2 100644
--- a/src/llv8.cc
+++ b/src/llv8.cc
@@ -1,5 +1,6 @@
 #include <assert.h>
-#include <inttypes.h>
+
+#include <cinttypes>

 #include "llv8-inl.h"
 #include "llv8.h"

Regarding lldb, what lldb source did you use when building llnode?

from llnode.

axot avatar axot commented on July 26, 2024

I has rebuild llnode with this patch, it works great!
Im using lldb 3.4.2 when building llnode ./gyp_llnode -Dlldb_dir=/usr/lib64/llvm/.
Is this version was too old?

$ ls /usr/lib64/llvm/
BugpointPasses.so  liblldb.so         libLLVM-3.4.2.so   libLLVM-3.4.so     libLTO.so          LLVMgold.so

$ rpm -qa | grep lldb
lldb-devel-3.4.2-7.el7.x86_64
lldb-3.4.2-7.el7.x86_64

from llnode.

indutny avatar indutny commented on July 26, 2024

It may be that something in headers doesn't match the lldb binary. I'll try to setup a CentOS environment this week to see if I can reproduce this.

from llnode.

indutny avatar indutny commented on July 26, 2024

Sorry, I had no time week. @hhellyer or @yjhjstz , does it sound interesting to any of you?

from llnode.

hhellyer avatar hhellyer commented on July 26, 2024

@indutny - Sorry I was out on vacation last week.
@axot - lldb-3.4 does seem a little old but from the comments above this looks resolved so if it's working now that's fine. Are there any outstanding issues?

from llnode.

axot avatar axot commented on July 26, 2024

@hhellyer yes, it's fine to compile now, but seems not working

(lldb) v8
The following subcommands are supported:

The following subcommands are supported:

from llnode.

hhellyer avatar hhellyer commented on July 26, 2024

Do any of the commands work? For example does running:
(lldb) v8 bt
produce any useful output?
I've seen corrupted help text before. I think it's usually because the lldb headers don't quite match the version of lldb you are using but I think it can also be C++ linking issues if your plugin and lldb were built with different C++ compilers.

from llnode.

rnchamberlain avatar rnchamberlain commented on July 26, 2024

re the scrambled console output see https://github.com/indutny/llnode/issues/10

from llnode.

axot avatar axot commented on July 26, 2024
$ lldb -c core.25117
Core file '/tmp/core.25117' (x86_64) was loaded.
(lldb) v8 bt
 * SBThread: tid = 0x0000(lldb) v8
The following subcommands are supported:

    bt              -- Show a backtrace with node.js JavaScript functions and their args. An optional
                       argument is accepted; if that argument is a number, it specifies the number of
                       frames to display. Otherwise all frames will be dumped.

Syntax: v8 bt [number]

    findjsinstances -- List all objects which share the specified map.
Accepts the same options as `v8
                       inspect`
    findjsobjects   -- List all object types and instance counts grouped by map and sorted by instance
                       count.
Requires `LLNODE_RANGESFILE` environment variable to be set to a file
                       containing memory ranges for the core file being debugged.
There are scripts for
                       generating this file on Linux and Mac in the scripts directory of the llnode
                       repository.
    inspect         -- Print detailed description and contents of the JavaScript value.

Possible flags
                       (all optional):

 * -F, --full-string    - print whole string without adding
                       ellipsis
 * -m, --print-map      - print object's map address
 * --string-length
                       num  - print maximum of `num` characters in string

Syntax: v8 inspect [flags]
                       expr

    nodeinfo        -- Print information about Node.js

    print           -- Print short description of the JavaScript value.

Syntax: v8 print expr

    source          -- Source code information

For more help on any particular subcommand, type 'help <command> <subcommand>'.
(lldb) v8 bt
 * SBThread: tid = 0x0000(lldb) v8
The following subcommands are supported:

The following subcommands are supported:

The following subcommands are supported:

The following sub
                       ommands are supported:

The follow�(lldb) v8 findjsinstances
Segmentation fault

Did this work properly?

from llnode.

hhellyer avatar hhellyer commented on July 26, 2024

It ends with a segfault so I don't think it worked properly. :-)
Ubuntu has multiple lldb packages available (named lldb-3.5, lldb-3.6, lldb-3.7, lldb-3.8) and
I'm using lldb-3.8 - is there a similar setup on CentOS that will let you download one of those? (You should probably rebuild the plugin after changing versions of lldb.)

from llnode.

indutny avatar indutny commented on July 26, 2024

@axot yeah, unfortunately this looks like a mismatch between source files and the lldb binary.

May I ask you if you used -Dlldb_lib=... when compiling llnode? This leads to crashes on some systems, and it may help to build without this define.

from llnode.

axot avatar axot commented on July 26, 2024

@indutny I tried compile llnode without lldb_lib, it seems not fixed.

$ ./gyp_llnode
['/llnode/llnode.gyp', '-I', '/llnode/common.gypi', '--depth=.', '-f', 'make', '-Goutput_dir=/llnode/out', '--generator-output', '/llnode/out', '-Dgcc_version=48', '-Dclang=0', '-Dhost_arch=x64', '-Dtarget_arch=x64']

$ make -C out/ -j4
make: Entering directory `/llnode/out'
  CXX(target) /llnode/out/Release/obj.target/llnode/src/llnode.o
  CXX(target) /llnode/out/Release/obj.target/llnode/src/llv8.o
  CXX(target) /llnode/out/Release/obj.target/llnode/src/llv8-constants.o
  CXX(target) /llnode/out/Release/obj.target/llnode/src/llscan.o
  SOLINK(target) /llnode/out/Release/obj.target/llnode.so
  COPY /llnode/out/Release/lib.target/llnode.so
make: Leaving directory `/llnode/out'

$ sudo make install-linux
mkdir -p /usr/lib/lldb
cp -rf ./out/Release/lib.target/llnode.so /usr/lib/lldb/

$ lldb -c core.1209
Core file '/tmp/core.1209' (x86_64) was loaded.
(lldb) v8
The following subcommands are supported:

The following subcommands are supported:

(lldb)

from llnode.

indutny avatar indutny commented on July 26, 2024

@axot I just reproduced it on a CentOS box. Unfortunately, I don't have any other advice at the moment, but to try building lldb from source and using that source to build llnode.

The symptoms seems to be binary vs headers compatibility-based, and I don't know how to resolve them at this point.

Sorry!

from llnode.

axot avatar axot commented on July 26, 2024

That's okay, I will try to build lldb from source later. Thank you.

from llnode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.