This is a NPL/Lua debug engine based on interprocess communication (IPC).
The visusal studio code is based on the offical SampleEngineWorker from microsoft.
*Now open sourced*
Please note, there are extra install steps to complete the installation(either clean or upgrade should apply).
- Please also install latest visual studio 2015 redist dll here, if you are installing to early versions of vs.
- install normally to visual studio
- run visual studio as Administrators, Select menu: Tools->Launch NPL debugger
- Click register button to complete installation
- restart visual studio (no administrators required), Tools->Launch NPL debugger, click Attach to debug any running process
- optional: disable the plugin, restart vs and then enable it again.
Note1: if you can not attach
- make sure to click register button as administrators, and restarted vs.
- make sure you have installed the latest visual studio redist dlls.
- you are actually attaching to an ParaEngine/NPL process with commandline: debug="main".
- Disable the plugin, restart vs and then enable and restart vs again after registered the dll.(this will force visual studio to reload cached debug engine configurations)
- In visual studio, we can launch or attach to a ParaEngine process to debug it.
- Adding/Removing Breakpoints anytime, anywhere.
- step into/out of functions, step over lines
- Mouse over a local or global variable to see its value dumped.
- Shift+F9 to bring up the expression window, we can type nested NPL table name like "A.B.C", "main_state" or we can exec a string in the current context like
"i=1", "log('hello world')", 'i=i+1; return i'. if the expression has a return value, it will be shown in the window.
- Adding watches is also supported.
---+++ Known Issues
- Run as administrators in order to register C++ dll successfully.
- Attach process with mixed Native C++/NPL debugging will fail to detach, because the NPL handler thread are paused when the debug engine send the detach message causing the IDE to hang.
Avoid using mixed mode debugging, use only NPL debug engine to debug. Select menu Tools->Launch NPL debugger.
Another solution is to use the Project launcher to attach to process. Note: need to press attach twice.
- Process2.Attach2("NPLDebugEngineV2") will cause the main thread to hang at delayhlp.cpp, which is pretty strange, press the attach button twice will solve the problem. This has something to do with DELAYLOAD of dlls
- IMPORTANT: One needs to wait a while until cursor is turned to normal cursor before clicking the attach button, otherwise attach will not work. In case of error, try disable and reenable the plugin
2016.3.29: call stack is implemented.
2014.2.5: supporting vs 2010/2012/2013/2015 and open sourced