From c2b4f189433b8a7309b58a4e7a3e5d9265df4915 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 28 Oct 2016 15:57:22 -0400 Subject: [PATCH] Don't force the GDB console to be shown when created. When a new launch is triggered and a new GDB console created, it was shown automatically. However, if there was a current debug session where the selection was a stack frame, our sticky policy (DefaultDsfSelectionPolicy) prevents the new session from being selected, so the new GDB console shown didn't match the selection in the DV. With this patch, when a new GDB console is created, we don't show it automatically, but let other logic figure out if it should be shown or not. Change-Id: If826677a6fb0f925f6b397a13f61fc75fc892748 --- .../ui/views/debuggerconsole/DebuggerConsoleView.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/debuggerconsole/DebuggerConsoleView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/debuggerconsole/DebuggerConsoleView.java index d5f316a7705..56184fb956c 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/debuggerconsole/DebuggerConsoleView.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/debuggerconsole/DebuggerConsoleView.java @@ -211,9 +211,14 @@ implements IConsoleView, IDebuggerConsoleView, IConsoleListener, IPropertyChange DebuggerConsoleWorkbenchPart part = new DebuggerConsoleWorkbenchPart(registered, getSite()); fConsoleToPart.put(registered, part); fPartToConsole.put(part, registered); + // Must call partActivated() to create the page + // However, this will also show the page, which is not + // what we want. Therefore, let's force the previous + // page to be shown again right after. + IDebuggerConsole previouslyShown = getCurrentConsole(); partActivated(part); - if (console instanceof IDebuggerConsole) { - display((IDebuggerConsole)console); + if (previouslyShown != null) { + display(previouslyShown); } break; }