Community
Participate
Working Groups
This bug is similar to Bug 474179. How to reproduce: 1. Create a project with function foo() 2. Build the project. 3. Debug the project. 4. Open breakpoint views. 5. Select “View Menu” button via triangle icon in breakpoint views. 6. Select Add Function Breakpoint (C/C++)… 7. Enter “foo" to Function name field in common tab. Observed behavior: No BP mark displays in source editor ruler. Expected behavior: The BP mark is displayed in source editor ruler.
Some experiments shows that Eclipse adds BP by executing "-break-insert" GDB/mi command: |756,665 223-break-insert --thread-group i1 -f foo |756,671 223^done, |bkpt={number="8",type="breakpoint",disp="keep",enabled="y", |addr="0x015030bc",func="foo", |file="../src/MPC57xx__Interrupt_Init.c", |fullname="E:\\Win_S32DS_E200_1.0.0_MasterDebugEnvTB\\runtime-S32DS\\aaa_Z4_3\\src\\MPC57xx__Interrupt_Init.c",line="160",thread-groups=["i1"],times="0",original-location="foo"} after that BP appears in Breakpoint View, but no mark at ruler, while being added by using "break" GDB command everything just fine: |851,886 232-interpreter-exec console "break foo" |851,891 ~"Breakpoint 12 at 0x15030bc: file ../src/MPC57xx__Interrupt_Init.c, |line 160.\n" |851,892 =breakpoint-created, |bkpt={number="12",type="breakpoint",disp="keep",enabled="y", |addr="0x015030bc",func="foo",file="../src/MPC57xx__Interrupt_Init.c", |fullname="E:\\Win_S32DS_E200_1.0.0_MasterDebugEnvTB\\runtime-S32DS\\aaa_Z4_3\\src\\MPC57xx__Interrupt_Init.c",line="160", |thread-groups=["i1"],times="0",original-location="foo"} |851,892 232^done Probably, notification "=breakpoint-created" is a reason.
It is also noticed, GDB/mi command "-break-insert" typed in console adds BP only to GDB. This BP appears nether in Breakpoint view nor in vertical ruler.
(In reply to Stanislav Perepelitsa from comment #0) > This bug is similar to Bug 474179. > > Observed behavior: No BP mark displays in source editor ruler. > Expected behavior: The BP mark is displayed in source editor ruler. I can see this too. I'll have to look deeper at when the editor marker gets created and why it is not in this case. As a workaround, you can put your cursor inside the method and then use the Run menu and choose "Toogle Method Breakpoint" (In reply to Stanislav Perepelitsa from comment #2) > It is also noticed, GDB/mi command "-break-insert" typed in console adds BP > only to GDB. This BP appears nether in Breakpoint view nor in vertical ruler. Right, when using the console, it is the =breakpoint-created event that tells eclipse to add it to the bp view and editor. GDB does not issue that event when a bp is created using the MI command -break-insert; the idea is that if the bp is created using an MI command eclipse is the one that sent the command and already knows about the bp.
I don't think this ever worked, although I'm not 100% sure. When using "Add Function Breakpoint (C/C++)" from the bp view, the dialog pops-up before creating the marker, and once the user fills in the info, the marker is created in CBreakpointPreferenceStore.save() however, there is no attempt to extract the IResource from the dialog info, and the resource used is the worskpace itself. This is why the marker is not shown. We can see the IResource being specified in AbstractToggleBreakpointAdapter.createFunctionBreakpointInteractive() which calls AbstractToggleBreakpointAdapter.createFunctionBreakpoint() with parameter "ResourcesPlugin.getWorkspace().getRoot()" To fix this, I believe we need to enhance CBreakpointPreferenceStore.getResource() to be able to figure out the resource based on the info available in the dialog. This method does this for a line bp but not for other types of breakpoints.