$NetBSD: patch-am,v 1.1 2004/06/04 11:19:32 shannonjr Exp $

--- ddd/GDBAgent.h.orig	2003-10-11 05:03:34.000000000 -0600
+++ ddd/GDBAgent.h
@@ -57,7 +57,7 @@
 // Debugger types
 //-----------------------------------------------------------------------------
 
-enum DebuggerType { GDB, DBX, XDB, JDB, PYDB, PERL, BASH };
+enum DebuggerType { BASH, DBX, GDB, JDB, PERL, PYDB, XDB };
 //-----------------------------------------------------------------------------
 // Program language
 //-----------------------------------------------------------------------------
@@ -67,15 +67,16 @@ enum DebuggerType { GDB, DBX, XDB, JDB, 
 #endif
 
 enum ProgramLanguage { 
-    LANGUAGE_C,			// C-like: C, C++
-    LANGUAGE_JAVA,		// Java, as supported by GDB.
-    LANGUAGE_PASCAL,		// Pascal-like: Pascal, Modula...
     LANGUAGE_ADA,		// Ada (GNAT), as supported by GDB
+    LANGUAGE_BASH,		// Bash, as supported by bashdb.
+    LANGUAGE_C,			// C-like: C, C++
     LANGUAGE_CHILL,		// Chill, as supported by GDB.
     LANGUAGE_FORTRAN,		// FORTRAN, as supported by GDB.
-    LANGUAGE_PYTHON,		// Python, as supported by PYDB.
+    LANGUAGE_JAVA,		// Java, as supported by GDB.
+    LANGUAGE_PASCAL,		// Pascal-like: Pascal, Modula...
     LANGUAGE_PERL,		// Perl, as supported by Perl.
-    LANGUAGE_BASH,		// Bash, as supported by bashdb.
+    LANGUAGE_PHP,		// PHP, as supported by DBG.
+    LANGUAGE_PYTHON,		// Python, as supported by PYDB.
     LANGUAGE_OTHER		// Others
 };
 
@@ -104,7 +105,7 @@ typedef void (* OAProc) (const string& a
 typedef void (* OACProc) (void* user_data);
 
 // Called from send_qu_array with the complete answers
-typedef void (* OQACProc) (const StringArray& complete_answers,
+typedef void (* OQACProc) (StringArray& complete_answers,
 			   const VoidArray& user_datas,
 			   void *user_data);
 
@@ -162,6 +163,7 @@ private:
 
     bool _has_frame_command;	// Debugger properties
     bool _has_func_command;	
+    bool _has_file_command;
     bool _has_run_io_command;
     bool _has_print_r_option;
     bool _has_output_command;
@@ -210,9 +212,11 @@ private:
 protected:
     // Return PREFIX + EXPR, parenthesizing EXPR if needed
     static string prepend_prefix(const string& prefix, const string& expr);
+    static string prepend_prefix(const char *prefix, const string& expr);
 
     // Return EXPR + SUFFIX, parenthesizing EXPR if needed
     static string append_suffix(const string& expr, const string& suffix);
+    static string append_suffix(const string& expr, const char *suffix);
 
     // General trace function
     void trace(const char *prefix, void *call_data) const;
@@ -294,6 +298,10 @@ public:
     bool has_frame_command() const    { return _has_frame_command; }	
     bool has_frame_command(bool val)  { return _has_frame_command = val; }
 
+    // True if debugger has `file' command
+    bool has_file_command() const    { return _has_file_command; }
+    bool has_file_command(bool val)  { return _has_file_command = val; }
+
     // True if debugger has `func' command
     bool has_func_command() const    { return _has_func_command; }	
     bool has_func_command(bool val)  { return _has_func_command = val; }
@@ -433,8 +441,8 @@ public:
     // True if debugger can enable breakpoints
     bool has_enable_command() const
     { 
-      return type() == GDB  || type() == XDB || type() == PYDB || 
-	type() == BASH || has_handler_command();
+      return type() == BASH || type() == GDB  
+	|| type() == PYDB || type() == XDB || has_handler_command();
     }
     bool has_disable_command() const
     {
@@ -444,21 +452,22 @@ public:
     // True if debugger can set ignore counts on breakpoints
     bool has_ignore_command() const
     {
-	return type() == GDB || type() == XDB || type() == PYDB || 
-	       has_handler_command();
+	return type() == GDB || type() == PYDB 
+	    || type() == XDB || has_handler_command();
     }
 
     // True if debugger can set conditions on breakpoints
     bool has_condition_command() const
     {
-      return type() == GDB || type() == PYDB || type() == BASH;
+      return type() == BASH || type() == GDB 
+  	  || type() == PYDB ;
     }
 
     // True if debugger can delete breakpoints by number
     bool has_delete_command() const
     {
-      return type() == GDB || type() == XDB || type() == BASH ||
-	     type() == DBX || type() == PYDB;
+      return type() == BASH || type() == DBX || type() == GDB 
+	  || type() == PYDB || type() == XDB ;
     }
 
     // True if debugger has volatile breakpoints (i.e. breakpoints may
@@ -529,24 +538,26 @@ public:
     }
 
     // True if debugger has numbered breakpoints
-    bool has_numbered_breakpoints()
+    bool has_numbered_breakpoints() const
     {
-      return type() == GDB || type() == DBX || type() == XDB || type() == BASH
-	|| type() == PYDB;
+      return type() == BASH || type() == DBX || type() == GDB
+	  || type() == PYDB || type() == XDB;
     }
 
     // True if debugger supports temporary breakpoints
     bool has_temporary_breakpoints() const
     {
-      return type() == GDB || type() == XDB || type() == PYDB || type() == BASH
-	|| has_when_command() || type() == PERL;
+      return type() == BASH || type() == GDB 
+	  || type() == PERL || type() == PYDB || type() == XDB 
+	  || has_when_command() ;
     }
 
     // True if debugger supports breakpoint conditions
     bool has_breakpoint_conditions() const
     {
-        return type() == GDB || type() == XDB || type() == BASH ||
-	       type() == DBX || type() == PYDB || type() == PERL;
+      return type() == BASH || type() == DBX 
+	  || type() == GDB  || type() == PERL || type() == PYDB 
+ 	  || type() == XDB;
     }
 
     // True if debugger supports breakpoint commands
@@ -597,7 +608,7 @@ public:
     }
 
     // True if debugger has numbered displays
-    bool has_numbered_displays()
+    bool has_numbered_displays() const
     {
 	return type() == GDB || type() == PYDB;
     }
@@ -678,11 +689,18 @@ public:
     // Several commands
 				                    // GDB command
 						    // -----------------------
-    string print_command(const string& expr = "",   // print|output EXP
+    string print_command(const char *expr = "",     // print|output EXP
 			 bool internal = true) const;
+    string print_command(const string& expr,
+			 bool internal = true) const {
+      return print_command(expr.chars(), internal);
+    }
     string assign_command(const string& var,        // set variable VAR = EXPR
 			  const string& expr) const;
-    string display_command(const string& expr = "") const; // display EXPR
+    string display_command(const char *expr = "") const; // display EXPR
+    string display_command(const string& expr) const {
+      return display_command(expr.chars());
+    }
     string where_command(int count = 0) const;	    // where COUNT
     string pwd_command() const;	                    // pwd
     string frame_command(int number) const;         // frame NUMBER
@@ -700,8 +718,11 @@ public:
     string info_locals_command() const;	            // info locals
     string info_args_command() const;	            // info args
     string info_display_command() const;	    // info display
-    string disassemble_command(string start, const string& end = "") const;
+    string disassemble_command(string start, const char *end = "") const;
                                                     // disassemble START END
+    string disassemble_command(const string &start, const string& end ) const {
+      return disassemble_command(start, end.chars() );
+    }
     string make_command(const string& target) const;       // make TARGET
     string jump_command(const string& pc) const;    // jump PC
     string regs_command(bool all = true) const;	    // info registers
@@ -713,13 +734,22 @@ public:
     string delete_command(string bp = "") const;    // delete BP
     string ignore_command(const string& bp, int count) const; 
                                                     // ignore BP COUNT
-    string condition_command(const string& bp, const string& expr) const; 
+    string condition_command(const string& bp, const string& expr) const {
+      return condition_command(bp, expr.chars() );
+    }
+    string condition_command(const string& bp, const char *expr) const;
 				                    // cond BP EXPR
     string shell_command(const string& cmd) const;	    // shell CMD
-    string debug_command(const string& file = "",          // file FILE
+    string debug_command(const char *file = "",          // file FILE
 			 string args = "") const;
+    string debug_command(const string& file, string args = "") const {
+      return debug_command( file.chars(), args );
+    }
     string signal_command(int sig) const;           // signal SIG
-    string nop_command(const string& comment = "") const;  // # comment
+    string nop_command(const char *comment = "") const;  // # comment
+    string nop_command(const string& comment) const {
+      return nop_command(comment.chars());
+    }
 
     // Bring VALUE of VAR into a form understood by DDD
     void munch_value(string& value, const string& var) const;
@@ -755,11 +785,11 @@ public:
 
     // True if ANSWER ends in a prompt
     bool ends_with_prompt(const string& answer);
-    bool ends_with_secondary_prompt(const string& answer);
-    bool ends_with_yn(const string& answer);
+    bool ends_with_secondary_prompt(const string& answer) const;
+    bool ends_with_yn(const string& answer) const;
 
     // True if exception error message
-    bool is_exception_answer(const string& answer);
+    bool is_exception_answer(const string& answer) const;
     void set_exception_state(bool state);
 
     // Helpers
