Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending Eclipse Debug Functionality

I need to create an Eclipse Debugger Plugin that is able to debug embedded code, running at a Cortex-M0 core. My plugin depends on an existing plugin for debugging arm applications: GNU ARM Eclipse JLink plugin (http://gnuarmeclipse.livius.net/blog/) My debugger plugin should be able to send information (like src code line, file etc) to a java application when a breakpoint is hit and when the user presses resume and suspend button.

According to https://www.eclipse.org/articles/Article-Debugger/how-to.html , I have to implement my own Eclipse Debug Model

I have managed to create a Launch Delegate that extends GNU ARM JLink plugin LaunchConfigurationDelegate class, so that I do not have to rewrite the code that initializes the debug environment.

From the GNU ARM Eclipse JLink plugin src code, I understand that it does not extend the default functionality of Eclipse when a breakpoint is hit or the user presses resume,step into etc. So I do not have an existing jlink plugin class to extend. In my debug model I created classes that implement IDebugTarget, IStackFrame, IThread and extend DebugElement among others. I thought that by implementing classes from org.eclipse.debug.core.model.ISuspendResume & org.eclipse.debug.core.model.IStep I would be able to catch breakpoint hit events and stepping events. But still, I can not catch any debug events in my plugin code.

Do you have any hints on how to catch debug events in my plugin (suspend,resume,step into,step over etc) from the Eclipse UI? Could you inform me which classes should I extend or which interfaces should I implement in order to catch code stepping events?

like image 241
artpap Avatar asked Nov 10 '22 01:11

artpap


1 Answers

DsfServiceEventHandler helped me. I am now able to catch MIBreakpointHitEvent events and retrieve file name, function name and src code line of the breakpoint.

like image 89
artpap Avatar answered Nov 15 '22 09:11

artpap