Bug 23909

Summary: KDevelop should display error if gdb can't run
Product: [Applications] kdevelop Reporter: djarvie
Component: CPP DebuggerAssignee: Matt Rogers <mattr>
Status: RESOLVED FIXED    
Severity: normal CC: franke.daniel, kdevelop-bugs-null, linus
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description djarvie 2001-04-08 18:19:29 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kdevelop
Version:           KDE 2.1.1 
Severity:          wishlist
Installed from:    SuSE RPMs
Compiler:          Not Specified
OS:                Linux
OS/Compiler notes: Not Specified

When the Debug -> Start menu option is selected KDevelop currently doesn't give any indication whatsoever if there is a problem running gdb. It just sits there and does and says nothing! It should output an error message saying that it failed to run gdb.

A simple message would save much time and trouble if this happens as it did to me - it would point the way directly to the cause of the non-event so that the user could investigate it.

(Submitted via bugs.kde.org)
Comment 1 John Firebaugh 2002-09-15 20:42:06 UTC
Handled better in Gideon 
Comment 2 Amilcar do Carmo Lucas 2004-01-13 14:06:41 UTC
By the look of 62832 and 72546 it is not solved yet.
Comment 3 Amilcar do Carmo Lucas 2004-01-13 14:07:00 UTC
*** Bug 62832 has been marked as a duplicate of this bug. ***
Comment 4 Amilcar do Carmo Lucas 2004-01-13 14:07:26 UTC
*** Bug 72546 has been marked as a duplicate of this bug. ***
Comment 5 Jens Dagerbo 2004-01-13 14:59:15 UTC
Bug.
Comment 6 Matt Rogers 2004-12-16 00:33:17 UTC
CVS commit by mattr: 

Display a message that GDB could not be found if GDB is not currently
installed on the system. Fixes bug 23909

BUG: 23909


  M +12 -0     debuggerpart.cpp   1.104
  M +3 -0      debuggerpart.h   1.30
  M +4 -1      gdbcontroller.cpp   1.66
  M +1 -0      gdbcontroller.h   1.27


--- kdevelop/languages/cpp/debugger/debuggerpart.cpp  #1.103:1.104
@@ -554,4 +554,6 @@ void DebuggerPart::setupController()
     connect( controller,            SIGNAL(showStepInSource(const QString&, int, const QString&)),
              this,                  SLOT(slotShowStep(const QString&, int)));
+    connect( controller,            SIGNAL(debuggerRunError(int)),
+             this,                  SLOT(errRunningDebugger(int)));
 
     // controller -> procLineMaker
@@ -687,4 +689,14 @@ void DebuggerPart::slotStopDebugger()
 }
 
+void DebuggerPart::errRunningDebugger(int errorCode)
+{
+  if (errorCode == 127)
+  {
+    KMessageBox::error(mainWindow()->main(), i18n("GDB could not be found. Please make sure it is installed"
+                                     " and in the path and try again"), i18n("Debugger not found"));
+  }
+  slotStopDebugger();
+}
+
 void DebuggerPart::projectClosed()
 {

--- kdevelop/languages/cpp/debugger/debuggerpart.h  #1.29:1.30
@@ -89,4 +89,7 @@ private slots:
     void slotCloseDrKonqi();
 
+    //! There was an error running the debugger
+    void errRunningDebugger( int errorCode );
+
 private:
     KDevAppFrontend *appFrontend();

--- kdevelop/languages/cpp/debugger/gdbcontroller.cpp  #1.65:1.66
@@ -2018,6 +2018,9 @@ void GDBController::slotDbgWroteStdin(KP
 // **************************************************************************
 
-void GDBController::slotDbgProcessExited(KProcess*)
+void GDBController::slotDbgProcessExited(KProcess* process)
 {
+    if ( process->exitStatus() == 127 )
+      emit debuggerRunError(127);
+
     destroyCmds();
     state_ = s_appNotStarted|s_programExited|(state_&(s_viewLocals|s_shuttingDown));

--- kdevelop/languages/cpp/debugger/gdbcontroller.h  #1.26:1.27
@@ -132,4 +132,5 @@ signals:
     void acceptPendingBPs     ();
     void unableToSetBPNow     (int BPNo);
+    void debuggerRunError(int errorCode);
 
 private: