Bug 460760 - [source lookup] Editor Id is ignored by DsfSourceDisplayAdapter.openEditor
Summary: [source lookup] Editor Id is ignored by DsfSourceDisplayAdapter.openEditor
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 8.6.0   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: 2015-02-25 02:59 EST by Dmitry Kozlov CLA
Modified: 2020-09-04 15:17 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 Dmitry Kozlov CLA 2015-02-25 02:59:42 EST
DsfSourceDisplayAdapter.openEditor(SourceLookupResult result, IWorkbenchPage page) sets editor id from source lookup result and delegates execution to 
openEditor(final IWorkbenchPage page, final IEditorInput input, final String id),
where last parameter is editor id, but this id is ignored and editor is selected based on input because editor[0] = page.openEditor(input, id, false) is used 
which matches editor by input. In order to fix this openEditor(input, id, false, IWorkbenchPage.MATCH_ID) should be used.

Again (as https://bugs.eclipse.org/bugs/show_bug.cgi?id=460757) this bug is raised by trying to show debug steps in custom editor other than source file editor.

Proposed patch in Gerrit:
https://git.eclipse.org/r/42594
Comment 1 Jonah Graham CLA 2015-07-15 07:47:08 EDT
This change (2af7d6d5926acc33f6faa6ccdf72863920eb54d0) has broken the behaviour of the DsfSourceDisplayAdapter. If any other C Editor is open, (i.e. with other input) the file contents are not updated, but the IP is painted on the editor.

To reproduce:
1- Start a C debug session, stopping at main
2- Open another C file that does not have the correct main in it
3- Click on the frame in the stack trace
4- Observe how the IP is drawn on the wrong file

Tested with Eclipse Mars and CDT master.
Comment 2 Eclipse Genie CLA 2015-07-16 14:15:45 EDT
New Gerrit change created: https://git.eclipse.org/r/52106
Comment 3 Jonah Graham CLA 2015-07-16 14:17:07 EDT
(In reply to Eclipse Genie from comment #2)
> New Gerrit change created: https://git.eclipse.org/r/52106

Not sure of correct process here, so based on my Comment 1 issue I created a revert commit gerrit for review.
Comment 4 Dmitry Kozlov CLA 2015-07-17 05:08:27 EDT
I experienced this at our branch and will port fix after I return from vacation in mid Aug.
Comment 5 Marc-André Laperle CLA 2015-08-04 13:45:24 EDT
A revert of the patch was proposed here in the meantime:
https://git.eclipse.org/r/#/c/52106/