I am writing a Node.Js C++ addon,When I try to debug my c++ add by the way i searched on internet,it just cannt work at all.
what i get from internet is gdb node set args app.js run
i get this /usr/local/bin/node": not in executable format: File format not recognized
after type file /usr/local/bin/node
i get this /usr/local/bin/node: Mach-O universal binary with 2 architectures /usr/local/bin/node (for architecture i386): Mach-O executable i386 /usr/local/bin/node (for architecture x86_64): Mach-O 64-bit executable x86_64
i dont konw why my gdb told me the node is not a executeable fomat
Did you build node.js with debugging enabled? It looks like you are on a mac, if you used homebrew to install mode, try the following:
brew install nodejs --with-debug
Then try:
gdb --args /usr/local/bin/node app.js
Also gdb on the mac has been deprecated in favor of lldb so you might try lldb as well:
lldb -- /usr/local/bin/node app.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With