[project @ 2005-06-28 11:23:50 by unknown_lamer]
authorunknown_lamer <unknown>
Tue, 28 Jun 2005 11:23:52 +0000 (11:23 +0000)
committerunknown_lamer <unknown>
Tue, 28 Jun 2005 11:23:52 +0000 (11:23 +0000)
Added --debug-scripts command line option

ChangeLog
NEWS
bobot++.info
bobot++.texinfo
source/BotConfig.H
source/Main.C

index 441b35f..0715d83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-06-28  Clinton Ebadi  <clinton@unknownlamer.org>
 
+       * source/Main.C (namespace): Added debug-scripts option
+
        * source/Parser.C (parseCTCP): Hook::ACTION is now passed
        from->getNick () instead of from->getAddress () (consistency fix)
 
diff --git a/NEWS b/NEWS
index 9b15378..dd5257f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,8 @@ Version 2.1.8:
   + Debugging
     * The debugging evaluator is now enabled when --debug is passed to
       the bot
+    * New command line option: --debug-scripts enabled the debugging
+      evaluator while running everything else normally
     * Merged error handling patch from Dale Smith. This adds detailed
       errors and backtraces when --debug is passed to Bobot++.
 - Documentation
index 80866fb..735a438 100644 (file)
@@ -302,6 +302,10 @@ the following command line arguments:
    * `[--debug][-D]' Makes Bobot++ print debugging info and run in the
      foreground
 
+   * `[--debug-scripts][-S]' Enabled the Guile debugging evaluator for
+     verbose script errors and backtraces while still running the bot
+     in the background.
+
    The default configuration is read from
 `$HOME/.bobotpp/config/default/' and then `/etc/bobotpp/default/' if
 the user config is not found.
@@ -1182,22 +1186,22 @@ Node: bot.users\7f5655
 Node: Configuration File Placement\7f6558
 Node: Using the Bot\7f7260
 Node: Starting the Bot\7f7510
-Node: User Levels\7f8853
-Node: Protection\7f10309
-Node: Automatic Op\7f10917
-Node: Built-In Commands\7f11206
-Node: Scripting\7f18185
-Node: Adding New Commands\7f19150
-Node: Hooks\7f20473
-Node: Creating a Hook\7f21313
-Node: Hook Types\7f22496
-Node: Scheme User Levels\7f25525
-Node: Sending Messages\7f26659
-Node: High Level Message Functions\7f27275
-Node: Low Level Message Functions\7f28055
-Node: Misc Scripting Stuff\7f29130
-Node: Concept Index\7f35706
-Node: Function Index\7f35925
-Node: Variable Index\7f46056
+Node: User Levels\7f9019
+Node: Protection\7f10475
+Node: Automatic Op\7f11083
+Node: Built-In Commands\7f11372
+Node: Scripting\7f18351
+Node: Adding New Commands\7f19316
+Node: Hooks\7f20639
+Node: Creating a Hook\7f21479
+Node: Hook Types\7f22662
+Node: Scheme User Levels\7f25691
+Node: Sending Messages\7f26825
+Node: High Level Message Functions\7f27441
+Node: Low Level Message Functions\7f28221
+Node: Misc Scripting Stuff\7f29296
+Node: Concept Index\7f35872
+Node: Function Index\7f36091
+Node: Variable Index\7f46222
 \1f
 End Tag Table
index 1349ce1..75a2611 100644 (file)
@@ -299,6 +299,9 @@ first
 still searched after this if dir is not found.
 @item @code{[--debug][-D]} Makes Bobot++ print debugging info and run
 in the foreground
+@item @code{[--debug-scripts][-S]} Enabled the Guile debugging
+evaluator for verbose script errors and backtraces while still running
+the bot in the background.
 @end itemize
 
 The default configuration is read from
index 95eb47a..d657f71 100644 (file)
@@ -13,7 +13,8 @@
 
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA.
 
 /*
   Config Database:
@@ -21,7 +22,7 @@
   void watcher (key, options, appended?)
 
   NOTE: The key is always UPPERCASE internally. Keys are converted
-  automagically to uppercase by the anything that 
+  automagically to uppercase.
 
 */
 
@@ -35,7 +36,8 @@ public:
   typedef std::string t_value;
   typedef std::list<t_value> t_value_list;
 
-  typedef void (*t_watcher) (std::string key, t_value_list vals, bool appended);
+  typedef void (*t_watcher) 
+    (std::string key, t_value_list vals, bool appended);
 
   typedef std::list<t_watcher> t_watcher_list;
   typedef std::pair<t_value_list, t_watcher_list> t_option_values;
@@ -48,9 +50,11 @@ private:
   std::string config_filename;
 
 public:
-  BotConfig (std::string); // sets config_filename but DOES NOT read config!
+  BotConfig (std::string); // sets config_filename but DOES NOT read
+                          // config!
 
-  bool read_config (); // true if read successfully. This also clears the option_db.
+  bool read_config (); // true if read successfully. This also clears
+                      // the option_db.
   bool write_config (); // true if written succesfully
 
   // Getters
@@ -69,9 +73,9 @@ public:
                                                          // filename
 
   bool add_watcher (std::string key, t_watcher new_watcher); // t if key
-                                                          // exists,
-                                                          // f
-                                                          // otherwise
+                                                            // exists,
+                                                            // f
+                                                            // otherwise
   bool clear_watchers (std::string key); // t if key exists, f
                                         // otherwise
 
index 6bc48df..8b46061 100644 (file)
@@ -53,6 +53,9 @@ namespace
       { "config", required_argument, 0, 'c'},
       { "sys-config", required_argument, 0, 's'},
       { "user-config", required_argument, 0, 'u'},
+#ifdef USESCRIPTS
+      { "debug-scripts", no_argument, 0, 'S' },
+#endif
       { "debug", no_argument, 0, 'D' }
     };
 
@@ -117,6 +120,9 @@ namespace
       "                            dir is not found.\n"
       "[--debug][-D]               Makes Bobot++ print debugging info and run in\n"
       "                            the foreground"
+#ifdef USESCRIPTS
+      "\n[--debug-scripts][-S]       Turns on Guile debugging evaluator"
+#endif
                << std::endl
                << std::endl
                << "The default configuration is read from\n"
@@ -138,13 +144,14 @@ namespace
       std::string (getenv ("HOME")) + "/.bobotpp/config/";
     String user_subdir = "default";
     bool debug = false;
+    bool script_debug = false;
 
     std::signal(SIGPIPE, SIG_IGN);
     std::signal(SIGALRM, SIG_IGN);
     std::signal(SIGHUP,  sig_hup);
 
     // We parse the command line options
-    while ((opt = getopt_long (argc,argv,"vhbf:d:c:D", bot_options, 0)) 
+    while ((opt = getopt_long (argc,argv,"vhbf:d:c:DS", bot_options, 0)) 
           != -1)
       {
        switch (opt)
@@ -179,6 +186,9 @@ namespace
          case 'D':
            debug = true;
            break;
+         case 'S':
+           script_debug = true;
+           break;
          default:
            print_short_help (argv[0]); 
            std::exit(1);
@@ -242,7 +252,7 @@ namespace
 
 #ifdef USESCRIPTS
     Interp::Startup();
-    if (debug)
+    if (debug || script_debug)
       {
        SCM_DEVAL_P = 1;
        SCM_RECORD_POSITIONS_P = 1;