In Short
I was trying to print out the v8::Local
object content, with either of v8/tools/gdbinit
and v8/tools/lldb_commands.py
helper scripts, I got Empty Line
OR Syntax Error
messages. Is there anything I've missed? So my question is how can we print the v8::Local
object content?
Most of configurations are from official embed tutorial (https://v8.dev/docs/embed), without any single line of modification. Here are some details:
- Source Branch: "main" (2022/01/18)
- GN Build Configuration: "x64.release.sample"
- Program: v8/samples/hello-world.cc
- Platform: "Ubuntu18.04 + GDB10" / "macOS 10.14 + LLDB11"
GDB ouput: (ubuntu18.04)
### Compile & Link
$ g++ -I. -Iinclude samples/hello-world.cc -o hello_world -lv8_monolith -ldl -Lout.gn/x64.release.sample/obj/ -pthread -std=c++14 -DV8_COMPRESS_POINTERS -g
### Debug
$ gdb -x tools/gdbinit ./hello_world
(gdb) p result
$1 = {val_ = 0x55d4f7a35408}
(gdb) jlh result
A syntax error in expression, near `)(result).val_))'.
LLDB ouput: (macos10.14)
### Compile & Link
$ g++ -I. -Iinclude samples/hello-world.cc -o hello_world -lv8_monolith -Lout.gn/x64.release.sample/obj/ -pthread -std=c++14 -DV8_COMPRESS_POINTERS -g
### Debug
$ lldb ./hello_world
(lldb) command script import tools/lldb_commands.py
(lldb) b hello-world.cc:56
(lldb) r
(lldb) p *utf8
(char *) $0 = 0x0000000102302590 "Hello, World!"
(lldb) p result
(v8::Local<v8::Value>) $1 = (val_ = 0x0000000102815668)
(lldb) jlh result
(lldb)