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

Bug 323748

Summary: [breakpoints][cdi] Breakpoints in dlls are ignored for GDB older than 6.8 and for MacOS
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debug-dsf-gdbAssignee: Project Inbox <cdt-debug-dsf-gdb-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: a.broekhuis, malaperle, pawel.1.piech
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Start of solution #2 marc.khouzam: iplog-

Description Marc Khouzam CLA 2010-08-26 15:16:44 EDT
Bug 248595 added support for pending breakpoints which allows to properly set breakpoints in dlls even before they are loaded.  However, this only works for GDB >= 6.8.

Older GDBs would need a different solution.  There are two solutions I can think of:

1- do as CDI and stop on library events and each time, try to set any breakpoint that hadn't installed properly.

2- use the CLI version of pending breakpoints, which is available starting with GDB 6.1.  For this we can use "set breakpoint pending on" and use the CLI to set breakpoints instead of MI.
Comment 1 Marc Khouzam CLA 2010-08-26 15:22:46 EDT
Created attachment 177557 [details]
Start of solution #2

I can't spend any more time on this issue since it only affects older GDBs, but I thought I'd post a small patch that could be the start of solution #2, if someone felt it was the right way to go and worth the time.

The patch makes DSF-GDB use the CLI to set breakpoints.  What it misses is to properly deal with the return output of the CLI 'break' command.
One must also use "set breakpoint pending on" but I think I'm gonna put that in DSF-GDB anyway, to help with breakpoints set in the console.
Comment 2 Marc Khouzam CLA 2010-08-26 15:24:30 EDT
Oh, and one other problem with the posted patch is that creating a bp with an ignore count is not supported by the CLI.  It would require the MIBreakpoints service to do it in two operations.  This is what GDBBreakpoints_7_0 does for tracepoints and pass count.
Comment 3 Marc Khouzam CLA 2011-05-24 09:14:48 EDT
Since MacOS is running GDB 6.3, this bug also affects it.
Comment 4 Marc Khouzam CLA 2011-05-24 09:15:02 EDT
*** Bug 346809 has been marked as a duplicate of this bug. ***
Comment 5 Alexander CLA 2011-05-24 13:34:21 EDT
I've commented on the GDB bug related to GDB 7 and the Mac, and received a comment that I shouldn't expect GDB 7.2 etc to be fixed for the Mac in this case. Since I am running into the problems described at that bug, so using a newer GDB on OSX seems like a dead end for now...

http://sourceware.org/bugzilla/show_bug.cgi?id=11488
Comment 6 Marc-André Laperle CLA 2011-05-25 11:17:34 EDT
(In reply to comment #3)
> Since MacOS is running GDB 6.3, this bug also affects it.

Apple's GDB has pending breakpoints. I will experiment with it to see if it's
acceptable to use them exactly like we do for GDBs >= 6.8.