Bug 383891 - When adding a watchpoint, the breakpoint is planted, unplanted and replanted
Summary: When adding a watchpoint, the breakpoint is planted, unplanted and replanted
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.1   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-29 08:31 EDT by Didier Brachet CLA
Modified: 2013-06-05 04:52 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (814 bytes, patch)
2012-06-29 08:32 EDT, Didier Brachet CLA
eugene: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Brachet CLA 2012-06-29 08:31:37 EDT
Build Identifier: 

With Linux TCF agent (but this is true also with other TCF agents which support watchpoints) when a client sets a watchpoint, the TCF agent always plants the watchpoint, unplants it and plants it again. The two last steps are unnecessary.

Note that the watchpoint is first planted by the call to context_plant_breakpoint() in plant_breakpoint() routine (breakpoints.c) and is then unplanted and replanted from flush_instructions() routine (breaopints.c) because the bp->attrs_changed flag has been set (incorrectly IMO) by add_breakpoint() when the breakpoint was created.

Note that this is not causing any real issue but when using TCF agent to connect to an OCD, then this can be quite costly in time when you have a system with many cores.

Reproducible: Always

Steps to Reproduce:
1. Instrument code in linux context_plant_breakpoint() and context_unplant_breakpoint() to monitor activity.
2. Start a debug session connected to your Linux TCF agent
3. Add a watchpointfrom the Eclipse UI (note that if you enable/disable an existing watchpointit will not exhibit the problem; you need to create a new watchpoint).
Comment 1 Didier Brachet CLA 2012-06-29 08:32:59 EDT
Created attachment 218076 [details]
Proposed patch
Comment 2 Eugene Tarassov CLA 2012-06-30 20:48:29 EDT
Good catch.
I have committed the patch.
Thanks!