`
DavidL
  • 浏览: 8011 次
  • 性别: Icon_minigender_1
  • 来自: 广州
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

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 !
分享到:
评论
2 楼 stealdream 2007-09-14  

实在太好了,没有强大的IDE实在是太痛苦了。

我装好了插件,可是没有代码提示功能,用起来也痛苦啊
1 楼 oldrev 2007-08-18  
支持一下,虽然对我来说VIM就是整个世界

相关推荐

    Garmin佳明Descent Mk2i用户手册.pdf

    Garmin 佳明 Descent Mk2i 用户手册 本用户手册介绍了 Garmin 佳明 Descent Mk2i 智能腕表的使用指南和操作说明。该手册涵盖了产品的基本信息、使用方法、设置、配对智能手机、设备更新等方面的详细内容。 产品...

    gradient-descent-wikipedia_gradientdescent_descent_

    在给定的标题"gradient-descent-wikipedia_gradientdescent_descent_"中,我们可以推测这个压缩包可能包含了与梯度下降法相关的资料,尤其是从Wikipedia获取的信息。描述提到是“matlab code for gradient descent”...

    Descent_II_SourceCode_descent2_descent_

    《Descent II 源代码解析》 《Descent II》是一款经典的3D飞行射击游戏,以其独特的六轴自由移动和激烈的空间战斗深受玩家喜爱。标题中的"Descent_II_SourceCode"暗示了我们将深入探讨《Descent II》的游戏源代码,...

    Garmin佳明Descent Mk2S用户手册.pdf

    Garmin Descent Mk2S是一款高级潜水智能腕表,专为水下探险爱好者和专业潜水员设计。该手册详细介绍了如何使用这款设备,包括其功能、设置和操作方式。 在产品介绍部分,Garmin Descent Mk2S提供了全面的潜水功能,...

    Steepest-descent-algorithm.zip_descent_steepest descent

    Steepest descent algorithm

    CG_DESCENT_EQ_CG_DESCENT_matlab_非线性方程组_非线性约束_求约束方程_

    共轭梯度法(CG_DESCENT)是一种优化算法,常用于求解大型线性系统,但在非线性方程组的求解中也有应用。在本案例中,我们讨论的是如何利用CG_DESCENT方法来解决带有非线性约束条件的非线性方程组问题。在MATLAB环境...

    matlab开发-GradientDescent

    在MATLAB中,梯度下降法(Gradient Descent)是一种常用的优化算法,尤其适用于解决大规模机器学习中的参数求解问题。这个压缩包包含了几个与梯度下降法相关的MATLAB脚本,下面将详细讲解这些文件及其所涉及的知识点。...

    机器学习 -- Gradient Descent

    Gradient Descent Review: Gradient Descent Tip 1: Tuning your learning rates Adaptive Learning Rates Adagrad Contradiction Intuitive Reason Larger gradient, larger steps

    Supervised Descent Method and its Applications to Face Alignment

    order descent methods are the most robust, fast and reliable approaches for nonlinear optimization of a general smooth function. However, in the context of computer vision, 2 nd order descent methods ...

    Learning to rank using gradient descent.

    Learning to rank using gradient descent

    Block-Coordinate Gradient Descent method

    ### Block-Coordinate Gradient Descent Method #### 概述 本文主要介绍了一种称为块坐标梯度下降(Block-Coordinate Gradient Descent, BCGD)的方法,该方法用于解决带有线性等式约束条件的非光滑可分离优化问题。...

    Semi-Stochastic Gradient Descent Methods

    为了应对大数据集,引入了随机梯度下降(Stochastic Gradient Descent, SGD)和半随机梯度下降(Semi-Stochastic Gradient Descent)方法。 半随机梯度下降方法是介于全梯度下降和随机梯度下降之间的一种优化方法。...

    Descent_SourceCode_FirstDescent_descent_

    《Descent》是一款经典的3D射击游戏,由Parallax Software开发并在1995年首次发布,被誉为地下迷宫飞行射击游戏的先驱。源代码的发布为游戏开发者和计算机科学爱好者提供了深入研究其设计和技术的宝贵机会。...

    multivariategraddesc.zip_descent_gradient descent_gradient desc

    multivariate gradient descent example program

    gradient_descent_ebook_descent_machinelearning_

    "gradient_descent_ebook_descent_machinelearning_"这个标题暗示了我们讨论的主题是关于梯度下降的电子书,该书可能深入探讨了这一算法在机器学习中的应用。 梯度下降的基本思想是通过迭代寻找函数的局部最小值。...

    An overview of gradient descent optimization algorithms

    An overview of gradient descent optimization algorithms

    Learning to Rank using Gradient Descent.pdf

    Learning to Rank using Gradient Descent.pdf

    Federated Accelerated Stochastic Gradient Descent

    ### 联邦加速随机梯度下降(Federated Accelerated Stochastic Gradient Descent, FedAc) #### 概述 本文提出了一种名为联邦加速随机梯度下降(FedAc)的新算法,它是对联邦平均(Federated Averaging, FedAvg)...

    steepest_descent_algorithm.zip

    在求解机器学习算法的模型参数,即无约束优化问题时,梯度下降(Gradient Descent)是最常采用的方法之一,另一种常用的方法是最小二乘法。在求解损失函数的最小值时,可以通过梯度下降法来一步步的迭代求解,得到...

    gradient_descent_机器学习_toodj1_python_descent_梯度下降法_

    梯度下降法是一种广泛应用于机器学习中的优化算法,主要用于寻找函数最小值。在这个实例中,我们将探讨如何使用Python实现梯度下降法,并结合数据文件"data.csv"进行实践。以下是关于梯度下降法及其Python实现的详细...

Global site tag (gtag.js) - Google Analytics