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

Bug 314514

Summary: Cannot set breakpoints in shared libraries
Product: [Tools] CDT Reporter: James Blackburn <jamesblackburn+eclipse>
Component: cdt-debug-dsf-gdbAssignee: Project Inbox <cdt-debug-dsf-gdb-inbox>
Status: CLOSED DUPLICATE QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: pawel.1.piech
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
CDI MI log - breakpoints are set
none
DSF MI log - breakpoints not set none

Description James Blackburn CLA 2010-05-26 12:49:44 EDT
This may be a dupe, but seems a major out-of-the box regression from CDI.

I've got a bunch of breakpoints in some source files that exist in a .so. CDI correctly sets these when it detects the .so is loaded, while DSF doesn't. The result is I haven't figure out (out the box anyway) how to use DSF to debug my app.

GNU gdb (GDB) 7.0.1
CDT: 2010-05-01 19:09:26
Comment 1 James Blackburn CLA 2010-05-26 12:56:55 EDT
Created attachment 170047 [details]
CDI MI log - breakpoints are set
Comment 2 James Blackburn CLA 2010-05-26 12:57:35 EDT
Created attachment 170048 [details]
DSF MI log - breakpoints not set
Comment 3 Marc Khouzam CLA 2010-05-26 13:01:06 EDT
Sorry James, this is one of the parity bugs we didn't have time to get too.  The fix (GDB >= 6.8) is not very big, but the handling of the breakpoint marker was not trivial and I ran out of time.

*** This bug has been marked as a duplicate of bug 248595 ***
Comment 4 James Blackburn CLA 2010-05-26 13:05:03 EDT
Ok, thanks Marc
Comment 5 Marc Khouzam CLA 2010-05-26 14:10:20 EDT
If you want to try a hack to make your life easier, you can make the below two character change in     
org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakInsert
I think this will make your breakpoints on shared libs work.

   public MIBreakInsert(IBreakpointsTargetDMContext ctx, boolean isTemporary,
                        boolean isHardware, String condition, int ignoreCount, 
                        String location, int tid, boolean disabled, 
                        boolean isTracepoint) {

-               super(ctx, "-break-insert"); //$NON-NLS-1$
+               super(ctx, "-break-insert -f"); //$NON-NLS-1$