Index: debugger/dlgDirectDbg.cpp
===================================================================
--- debugger/dlgDirectDbg.cpp	(revision 8353)
+++ debugger/dlgDirectDbg.cpp	(working copy)
@@ -718,7 +718,7 @@
         query.Append( wxT( ")" ));
     }
 
-    if (!declareStatement.IsEmpty())
+    if (!m_targetInfo->getIsFunction() || m_targetInfo->getLanguage() == wxT("edbspl"))
     {
         wxString tmpQuery = wxT("DECLARE\n")
                           + declareStatement
