Descent Hacking

Descent is a great IDE plugin for eclipse (D language) which takes advantage of ddbg debugging and the powerful eclipse texteditor.

And it comes to a stage nearly really usable. And I took a look at it.

The main problem of the descent is debugging.  It doesn't feed the module name to ddbg, i.e. a file in C:\dmd\project\abc.d would be directly fed to ddbg which would result the breakpoint not taking any effect. Workaround is simple. In the addBreakpoint it add a DescentLineBreakpoint. What I did was adding a parsing right before the breakpoint was added to the breakpoint manager.  Translating the "module abc.mymodule;" to abc/mymodule.d and at last send it to ddbg debugger backend.

This solution was the first patch I posted in the forum. In the fourm because the code was not quoted under code tag, so indentation info got lost, you can see the indentation in the HTML source anyway :) The newest patch is guarded by the code tag, so you can view it nicely :)

Yet I came to another problem of reloading eclipse D project, the breakpoints were not working any more. After tracing around the eclipse.org.breakpointmanager?( I can't launch the eclipse right at the moment, cause the machine's memory is so limited , 512M, so this two patches took me  1 week ) , the breakpoint manager loaded the breakpoints from the IMarker info. So all extention in DescentLineBreakpoint all got lost. This is actually a design flow of the breakpoint manager. A breakpoint manager shouldn't be launched in such an early stage, and also the breakpoint manager shouldn't add all breakpoints as its own interface class LineBreakpoint, it prevents others from enhancing the breakpoint or any fancy extention points like IWorkbench. After understanding the whole bug, I can now come to fix the problem. We need to refresh all the breakpoints after the breakpoint manager got them loaded. I stupidly wanted to fix it by simply copy code from the original fix. So it required IDocumentProvider and therefore ITextEditor. At last , I found out that was not required. The code in the DescentLineBreakpoint constructor was actually need the ITextEditor-> IDocumentProvider -> lineStart, lineEnd, and at last those two variables are set to IMarker for further reusing(possibly the highlighting). And actually those two values I can get from IMarker by getAttributes, at last I can reuse the constructor recreate the breakpoint, also I would remove the breakpoint firstly :)

I can't paste much code here :) Sorry for the poor blogging. You can get the newest patch in the following link:

http://www.dsource.org/forums/viewtopic.php?p=16025#16025

Setting breakpoints is correct now, though it gets issues of F8 (continue the execution of the source), you need to type something(arbitrarily) in the console to feed ddbg , and then the eclipse debugging system seems to take the control back again.

Have fun with descent !
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值