Bug 321968 - [search] provide ability to add breakpoints from a (string) search view
Summary: [search] provide ability to add breakpoints from a (string) search view
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-06 07:01 EDT by Ankur Sharma CLA
Modified: 2010-08-08 12:16 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 Ankur Sharma CLA 2010-08-06 07:01:37 EDT
1. Use Search -> File... to do a search.
2. The results that are located in .java files, right click to see context menu

It will be very helpful to b able to set breakpoints from the search results.

Use Case:
I often have to do searches on strings like "setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,"

That is where all a particular attribute is set. AFAIK it can not be get from java search. If so, please enlighten me and close this request:)
Comment 1 Dani Megert CLA 2010-08-06 07:09:22 EDT
Darin, is there API in Debug Core or UI that would allow us to do this in JDT UI?
Comment 2 Darin Wright CLA 2010-08-06 08:32:50 EDT
There a factory methods to create breakpoints in JDIDebugModel, for example:

org.eclipse.jdt.debug.core.JDIDebugModel.createLineBreakpoint(IResource, String, int, int, int, int, boolean, Map)
Comment 3 Dani Megert CLA 2010-08-06 08:36:43 EDT
OK, so we would have to add a new dependency on JDT Debug Core but that's not an issue since we already indirectly require it via JDT Launching.
Comment 4 Markus Keller CLA 2010-08-08 12:16:01 EDT
I think JDT/UI is not the right place for this. o.e.search should make LineElement API (or an interface with enough information).

Then, o.e.jdt.debug.ui can add an object contribution for "Toggle Line Breakpoint" (like it already does e.g. for "Toggle Method Breakpoint" on IMethods). A problem is that the file search result page is language-agnostic, so Debug should either add this in a language-agnostic way too, or it should make sure that the action only appears in *.java files.

Moving to JDT/Debug. Please file a bug for Platform/Search if you intend to work on this and need the suggested API.