Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349991

Summary: [breakpoints] Error marker not shown in editor if file is not in the workspace
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, cdtdoug, pawel.1.piech
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Marc Khouzam CLA 2011-06-21 16:29:17 EDT
When a breakpoint cannot be installed we show an error marker in the editor.

I have noticed that if the editor is for a file that is not in the workspace, the error marker is being set but is not shown in the editor.

Maybe this is a platform bug?

The easiest way to try this is with CDI because DSf-GDB uses pending breakpoints so it is not as obvious to make a breakpoint fail.
1- start a CDI debug session
2- set a breakpoint in a project that is not being debugged and see the error marker in the margin of the editor
3- in Eclipse, open a file on the file system, but not one that is in a project
4- set a breakpoint on that file.  GDB will retturn an error, but the error marker is not shown.

I noticed this problem why setting a fast tracepoint on a location that was too small.  I also had FAST_ONLY setting, so we didn't try to set a slow tracepoint upon the failure.  GDB returned an ^error but I didn't see the error marker which would tell the user that the installation failed.
Comment 1 Anton Leherbauer CLA 2011-06-27 07:48:43 EDT
A marker on an external resource must have the attribute org.eclipse.cdt.core.model.ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION set to the path of the file, otherwise it will not be displayed by the C/C++ Editor.  I did not take a closer look, but this might be the reason why the marker is not visible.
Comment 2 Marc Khouzam CLA 2011-06-27 23:09:56 EDT
(In reply to comment #1)
> A marker on an external resource must have the attribute
> org.eclipse.cdt.core.model.ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION set
> to the path of the file, otherwise it will not be displayed by the C/C++
> Editor.  I did not take a closer look, but this might be the reason why the
> marker is not visible.

Thanks a lot Toni!  I'll give it a try.