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

Bug 294874

Summary: Pending breakpoints in shared objects do not work in CDT
Product: [Tools] CDT Reporter: Alexandre Rusev <cyberflex>
Component: cdt-debug-cdi-gdbAssignee: Project Inbox <cdt-debug-cdi-gdb-inbox>
Status: RESOLVED WONTFIX QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: minor    
Priority: P3 CC: daniel, pawel.1.piech
Version: 0 DD 1.1   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch from bug 248595 none

Description Alexandre Rusev CLA 2009-11-11 10:00:49 EST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061023 SUSE/2.0-30 Firefox/2.0
Build Identifier: 

CDT does not work properly with pending breakpoints (the ones set in shared objects which are yet not loaded), even if GDB version supports them.
Instead of that CDT tries to remember breakpoints the user tries at the not yet loaded module and tries to set these breakpoints in GDB after the module actually loaded during the program execution. But this feature also works strangely.


When pending breakpoints are set in CDT GDB console (for GDB verions which are supporting the "pending breakpoint" feature) then such breakpoints are not shown properly at shared obkject loading or even become doubled in UD

Primary incident is: https://bugs.eclipse.org/bugs/show_bug.cgi?id=248595

Reproducible: Always

Steps to Reproduce:
1. Run CDT GDB debug session on the program which uses shared object
   (userland program or Linux kernel with a module)
2. Try to set breakpoint in not yet loaded shared object,
   using CDT source editor or CDTG&#3916;B&#3851;&#3909;&#3964;&#3923;&#3942;&#3964;&#3939;&#3962;
3.
Comment 1 Alexandre Rusev CLA 2009-11-11 10:05:04 EST
3. see that pending breakpoints are malfunctioning in UI and may even not hit at execution
Comment 2 Alexandre Rusev CLA 2009-11-11 10:09:49 EST
In the bug #248595 the patch was suggested
https://bugs.eclipse.org/bugs/attachment.cgi?id=150853

This patch:

[1] verifies if GDB supports "pending breakpoints" feature  and uses it if it does
[2] enables propagation of MIBreakpointChangedEvent-s to UI
[3] fixes the issue that for pending breakpoints after the shared object loading
    the FunctionBreakpoint may be created (and shown in UI as if it was placed in 
    ELF file but not in C-source) instead of LineNumberBreakpoint
    even thought the GDB already reported all needed information
Comment 3 Alexandre Rusev CLA 2009-11-11 10:13:23 EST
Created attachment 151945 [details]
Patch from bug 248595
Comment 4 Jonah Graham CLA 2017-10-23 13:43:31 EDT
(this is part of a batch change)

The CDI debug implementation has been removed in CDT 9.0. Please see bug 484900 and the entry on the New and Noteworthy page https://wiki.eclipse.org/CDT/User/NewIn90#API_modifications