How to implement a simple debugger for programming lang

for instance:

# ex.my_ext

a = 1
b = 1
c = 1
"" # set breakpoint on it


I hope implement a debugger to implement following features:

- debugger stop on breakpoint on last line
- watches can see the values of a, b, c

I think other plugin like nodejs plugin or ruby-debug-ide is too complex to understand, my question is: is there more simple example to implement debugger

i aim to implement a debugger for https://github.com/opal/opal when using http://phantomjs.org/.

2 comments
Comment actions Permalink

All debuggers are inherently complicated; I don't think it's possible to build a realistic example which would be very simple. We plan to provide a guide for using the XDebugger API; for now, please see the javadocs of the XDebugProcess class, which is the key class you'll need to implement:

https://upsource.jetbrains.com/ideac/file/HEAD/platform%2Fxdebugger-api%2Fsrc%2Fcom%2Fintellij%2Fxdebugger%2FXDebugProcess.java

The simplest existing debugger that we have is probably the XSLT debugger:

https://upsource.jetbrains.com/ideac/file/HEAD/plugins%2Fxslt-debugger%2Fsrc%2Forg%2Fintellij%2Fplugins%2FxsltDebugger%2Fimpl%2FXsltDebugProcess.java

0
Comment actions Permalink

I looked into this recently, and found two examples of the XDebugger API which were relatively simple - the AntDebugger plugin and there's one in Jon Akhtar's Lua plugin: https://bitbucket.org/sylvanaar2/lua-for-idea/src/1f71594ddeeaf787da3f0e9345c8e022a60df346/src/debugger/?at=idea13

0

Please sign in to leave a comment.