在谷歌搜索後調試,我發現下面的方法做對應用的NodeJS GDB, 構建節點在./configure時--debug選項,然後執行的NodeJS,怎麼辦使用GDB
gdb --args ~/node_g start.js
使用這個我想調試一個小程序,但設置了斷點後,我沒能看到它是在功能突破,
我簡單的程序gdb_node.js看起來是這樣的:
function abc() {
console.log("In abc");
}
function bcd() {
abc();
console.log("Done abc");
}
bcd();
現在我發放gdb:
(gdb) b bcd
Function "bcd" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (bcd) pending.
(gdb) run
Starting program: /Users/mayukh/node_g gdb_node.js
Reading symbols for shared libraries
++++ ............................... .................................................. .................................................. ......完成
In abc
Done abc
Program exited normally.
(gdb)
有人可以讓我知道我在這裏失蹤了嗎?
問候, -M-
節點V8建議使用'節點inspect'代替'節點debug' – morhook 2017-11-01 13:26:34