Hello,
This sounds like a nice feature to add to CDT's disassembly view!
There are two things that will need to be implemented. I think you have already identified this, I am just restating so that we are on the same page and I can provide my direction:
1. In org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager.addBreakpointProblemMarker(ICBreakpoint, String, int) the case of address breakpoints need to be handled so that the problemMarker created contains the address information.*
2. In the Disassembly view you need to process markers based on their type and address to display them. You could start by showing the markers for line breakpoints, and then extend to address breakpoints?
For 1, I suspect all you need is something like this:
diff --git a/debug/org.eclipse.cdt.debug.core/plugin.xml b/debug/org.eclipse.cdt.debug.core/plugin.xml
index 16958692c9..0adc31464c 100644
--- a/debug/org.eclipse.cdt.debug.core/plugin.xml
+++ b/debug/org.eclipse.cdt.debug.core/plugin.xml
@@ -252,6 +252,9 @@
value="false">
</persistent>
<attribute name="externalLocation"/>
+ <attribute
+ name="address">
+ </attribute>
</extension>
<extension
point="org.eclipse.debug.core.breakpoints">
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
index 3483711262..d870a8fbc0 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
@@ -776,6 +776,10 @@ public class MIBreakpointsManager extends AbstractDsfService
if (sourceHandle != null) {
problemMarker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, sourceHandle);
}
+ String address = lineBreakpoint.getAddress();
+ if (address != null) {
+ problemMarker.setAttribute("address", address); // TODO place this string constant in the "correct" place
+ }
// And save the baby
fBreakpointMarkerProblems.put(breakpoint, problemMarker);
For 2, You need to create an annotation model that processes breakpoint problem markers. See org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart.attachBreakpointsAnnotationModel() and org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart.attachExtendedPCAnnotationModel()
for the existing annotation models on the disassembly viewer for a starting point.
I would appreciate this being contributed back to CDT. Please create a bugzilla and let me know if you need help with any of the process. See https://wiki.eclipse.org/CDT/contributing
for some getting started info.
* At the moment, AFAICT in your case the problem marker will be created for the address breakpoint, but because there is no resource/line information, it won't be visible anywhere. You can see such markers in the "Markers" view in the "C/C++
Breakpoint Problem" category.
PS. The forums are for end user help, the cdt-dev mailing list is for developing and extending CDT, so this is the best place to ask this type of question.