Bug 218342 - [patch] unable to clear breakpoints in ExternalTranslationUnit's from the editor
Summary: [patch] unable to clear breakpoints in ExternalTranslationUnit's from the editor
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 4.0.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.0.3   Edit
Assignee: Anton Leherbauer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-02-08 12:05 EST by Warren Paul CLA
Modified: 2008-06-22 02:43 EDT (History)
0 users

See Also:


Attachments
proposed patch (1.50 KB, patch)
2008-02-08 12:07 EST, Warren Paul CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Warren Paul CLA 2008-02-08 12:05:34 EST
Build ID: M20071023-1652

Steps To Reproduce:
1. Import an executable
2. Set a breakpoint on one of it's source files
3. Double click on the breakpoint in the editor
4. It should be cleared, but right now it remains

The problem is in ToggleBreakpointAdapter#getResource.  It's unable to get a resource to tie the editor to, so it defaults to the workspace.  But when the breakpoint was set, it was able to get the owning project of the TU as the resource.  So in lineBreakpointExists when it's comparing the resources, it fails to locate the breakpoint.

They key is to be able to get the correct resource for the breakpoint from the editor input.  In this case, it's an ExternalEditorInput.

The attached patch fixes the issue.  I didn't see any other way of doing it without using an internal class.  But ExternalEditorInput is used many other places in debug.ui anyway.



More information:
Comment 1 Warren Paul CLA 2008-02-08 12:07:11 EST
Created attachment 89274 [details]
proposed patch
Comment 2 Anton Leherbauer CLA 2008-02-11 04:02:53 EST
Thanks. I think that's straightforward.
Comment 3 Anton Leherbauer CLA 2008-02-11 06:47:55 EST
Patch applied to cdt_4_0 and HEAD.