Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Using disassembly editor instead of the Source Editor Not Found editor

Hi there,
When attaching to a process without having any source code, it shows the "No source available" editor. This can lead to a situation where only the "View Disassembly" button is visible:

In that case, it seems it would make more sense to use the Disassembly Editor instead of the Disassembly View. Also, if there is only one option for the user "View Disassembly", why not show directly the disassembly editor without clicking on a button first?
That way, if the user clicks on a method in the debug view, the disassembly editor is shown directly.

I have implemented this in DsfSourceDisplayAdapter like
private SourceLookupResult performLookup() {
....
            if (sourceElement == null) {
            if (fFrameData.fFile == null || fFrameData.fFile.isEmpty()) {
editorInput = DisassemblyEditorInput.PENDING_EDITOR_INPUT;
editorId = IDsfDebugUIConstants.DISASSEMBLY_EDITOR_ID;
            } else {
editorInput = new CSourceNotFoundEditorInput(new CSourceNotFoundElement(dmc, fSourceLookup.getLaunchConfiguration(), fFrameData.fFile));
editorId = ICDebugUIConstants.CSOURCENOTFOUND_EDITOR_ID;
            }



The editor is only shown in case no file is in the frame data, so the user couldn't attach source anyway.
I am planning to prepare a pull request.
Do you want to have a option to get the previous behaviour back? If yes, which should be the default?

Best regards,
Marc

Back to the top