Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360289 - [breakpoints] Allow address breakpoint to be set on arbitrary expression
Summary: [breakpoints] Allow address breakpoint to be set on arbitrary expression
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
: 148827 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-07 17:58 EDT by Pawel Piech CLA
Modified: 2020-09-04 15:23 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Piech CLA 2011-10-07 17:58:53 EDT
User should be able to set a breakpoint using an any expression that evaluates to a valid address.

Workflow details:
1) Add an action to Run menu: "Add Expression Breakpoint...". 

2) In dialog user can enter an expression and other breakpoint options.  User should get instant feedback from currently active debugger whether the entered expression evaluates to an address.  

3) A link to browse debugger symbols allows user to select a function name from a filtered selection dialog.  

4) After user creates the breakpoint.  Debugger engine installs breakpoint in target.  If breakpoint expression evaluates to a valid source line, debugger engine returns the source location.

5) Debugger integration updates the breakpoint location with source file and line number.

6) After debugger terminates, breakpoint source/line location is reset.

Implementation details:

Currently breakpoint address is stored under a string attribute ICLineBreakpoint.ADDRESS, this attribute should be used to indicate the current address in code in the same way that IMarker.LINE_NUMBER is used to show current breakpoint position in bug 360280.  For address breakpoints entered with an arbitrary expression, this attribute should be initially blank.  Instead the requested breakpoint location should be entered under a new attribute: ICLineBreakpoint.EXPRESSION.  

If multiple debuggers plant the same expression breakpoint, we need a mechanism for resolving the "planted address", like with repositioning line breakpoints, we need a list of planted addresses attribute here too: ICLineBreakpoint.ATTR_PLANTED_ADDRESSES_LIST.

The tricky part will be moving the breakpoint resource after it's created.  The only way to do it is to remove the old breakpoint and replace it with a new one.  This could lead to some ugly race conditions in the rare cases where multiple debugger integrations act on the same breakpoint.
Comment 1 Pawel Piech CLA 2011-10-07 17:59:36 EDT
*** Bug 148827 has been marked as a duplicate of this bug. ***