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)
+ 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
* `[--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.
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
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
// 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:
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.
*/
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;
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
// 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
{ "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' }
};
" 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"
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)
case 'D':
debug = true;
break;
+ case 'S':
+ script_debug = true;
+ break;
default:
print_short_help (argv[0]);
std::exit(1);
#ifdef USESCRIPTS
Interp::Startup();
- if (debug)
+ if (debug || script_debug)
{
SCM_DEVAL_P = 1;
SCM_RECORD_POSITIONS_P = 1;