From 21e303d976c8c2c260d906784e19e3456cacabe7 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 26 Feb 2016 16:24:23 -0500 Subject: [PATCH] Bug 487128: Errors when starting a new process is not propagated to user This is a follow-up to the work done to show errors when attaching to processes. We were also not showing errors when trying to start a new process using the "Debug new executable..." context menu option of the debug view. Change-Id: I9f68410b6d41a28df6f76f63b091a049a38b14e9 --- .../ui/commands/GdbDebugNewExecutableCommand.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java index 73aa6e8164c..76fcbd54cd6 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbDebugNewExecutableCommand.java @@ -180,6 +180,14 @@ public class GdbDebugNewExecutableCommand extends RefreshableDebugCommand implem catch( InterruptedException e ) { } catch( ExecutionException e ) { + // There was an error. Propagate it to the user + String errorMessage; + if (e.getCause() != null) { + errorMessage = e.getCause().getMessage(); + } else { + errorMessage = e.getMessage(); + } + request.setStatus( new Status( IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, errorMessage ) ); } catch( CancellationException e ) { // Nothing to do, just ignore the command since the user