[컴] Node.js 를 Ubuntu 에서 Debug mode 로 compile 하기

Node.js 를 Ubuntu 에서 eclipse 로 compile 하기

How to Make node_g

eclipse 에서 debug 모드로 node.js 를 실행시키고 싶다면 ./configure 를 debug 모드로 해서 debug 용 makefile 을 만들어야 한다.

if you want to open Node.js sources with eclipse c/c++ debugger. You should make Makefile for debug mode with the following command[ref. 1]
sudo ./configure --debug
그리고 나서, 아래 처럼 Makefile 을 불러오자.
Then, load makefile from eclipse
File >> New >> Makefile Project With Existing Code
그다음에 Debug As 로 compile 을 하면(그냥 Run As 로 해도 될 듯 하지만, 잘 모르겠다.)
Next, try build to get the Debug-version execution file. Do the following procedures
Debug As >> Local c/c++ Application
image

compile 이 끝나면 node_g 가 생성된다.(보통 compile 이 끝나고 debugger 를 호출하게 되는데, 여기서 그냥 cancel 을 하자.)
As you see the below, you could get node_g file which is debuggable version of node file. ( You may be able to proceed the debugging after compilation but, here, I stopped not to proceed)

image

다시 실행해서 node_g 를 실행하자.
Do the following procedures again to run node_g
Debug As >> Local c/c++ Application
image

이제 아래처럼 main() 에서 breakpoint 가 걸려 있는 모습을 볼 수 있다.
Now, you could see the debugger is paused on the main() function.

image

Reference

  1. http://stackoverflow.com/questions/10391358/node-js-build-configure-options-explanation

댓글 없음:

댓글 쓰기