2013-01-06 130 views
1

我試圖按照關於如何使用Eclipse的debug node.js applications的說明。但是如下面的屏幕截圖所示,斷點不會被啓用。任何人都可以指出我的解決方案。使用Eclipse調試node.js應用程序

enter image description here

+0

這是您自己的屏幕截圖或指令網站的屏幕截圖嗎? –

+0

我的截圖。正如你所看到的那樣,在圓圈中有一條線表示斷點未被啓用。這是我的問題。 –

+0

通過斷點的對角線:所有斷點已被禁用(按鈕跳過斷點視圖中的所有斷點) –

回答

1

它看起來你的斷點被禁用。通過在斷點視圖中取消選中跳過所有斷點來啓用它。

0

呵呵,你正在使用他們在我閱讀的教程中使用的相同的滴答功能。可能是相同的教程。

當我像這樣設置Eclipse時發現的另一個有趣的事情是,爲了能夠調試一個真實的應用程序,您必須延遲它的運行,像股票代碼那樣,但當然更智能一點。以下是我如何做到目前爲止..(希望這也會有所幫助):

function __myapp_start() { 
    console.log('Running app ...'); 
    // run your app here ... 
}; 

if (process.argv[2] === '-dbg') { // `node --debug myapp.js -dbg` wait for the debugger to connect. 
    function __myapp_pause() { 
     var paused = new Date().getTime(); 
     debugger; // will return immediately if the debugger is not connected yet 
     var started = new Date().getTime(); 
     if (started - paused < 500) { // if we returned relatively quickly, assume we're not connected and loop 
      setTimeout(__myapp_pause, 500); 
     } else { // the debugger actually paused and took time to return; we're connected. run. 
      __myapp_start(); 
     } 
    } 

    __myapp_pause(); // attempt to pause the debugger until it actually does pause, then continue 
} else { // normal production path 
    __myapp_start(); 
} 
相關問題