Bug 406680 - DSF-GDB breakpoint thread filter ineffective (GDB 7.4.1, 7.5.1)
Summary: DSF-GDB breakpoint thread filter ineffective (GDB 7.4.1, 7.5.1)
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.1.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-26 11:58 EDT by John Dallaway CLA
Modified: 2020-09-04 15:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Dallaway CLA 2013-04-26 11:58:11 EDT
When applying a thread filter to a previously unfiltered DSF-GDB line breakpoint, the MIBreakpointsManager#modifyBreakpoint() method will attempt to create a new GDB line breakpoint for each thread on which the breakpoint should trigger. If this is successful, the old unfiltered GDB breakpoint (at the same source line) is then deleted.

The above behaviour works well for older GDB, but with more recent GDB (7.4.1, 7.5.1, and possibly other versions) the deletion of the old breakpoint appears to affect behaviour of the new breakpoint(s) at the same source line. I can reproduce this at the GDB command line:

> (gdb) break main.c:5
> Breakpoint 1 ...
> (gdb) break main.c:5 thread 1
> Note: breakpoint 1 (all threads) also set at ...
> Breakpoint 2 ...
> (gdb) delete 1
> (gdb)

Now the "info break" command reports that breakpoint 2 is enabled for thread 1 but it is never triggered with recent GDB. If breakpoint 1 is deleted before breakpoint 2 is created then breakpoint 2 will be triggered (the problem is not observed).

This issue was discovered using a GDB remote target (arm-eabi). It may or may not be reproducible using a local debug session.

This looks like a GDB bug, but a workaround in CDT would be useful.
Comment 1 John Dallaway CLA 2013-05-17 09:19:56 EDT
I can confirm that this issue also affects the debugging of local pthread applications using the standard "GDB (DSF) Create Process Launcher" with native GDB 7.4.1 on Linux. To ensure correct breakpoint behaviour, it is necessary to delete the old GDB breakpoint(s) *before* creating the new one(s) at the same location. 

The current CDT breakpoint manipulation code works correctly with native GDB 7.3.1.