Lines Matching defs:script

28  * Simple DDB scripting mechanism.  Each script consists of a named list of
37 * Scripts may be managed from within DDB using the script, scripts, and
52 * run db_command_loop() after the script. There should be a way to avoid
77 * struct ddb_script describes an individual script.
90 * While executing a script, we parse it using strsep(), so require a
93 * each concurrently executing script.
101 * We use a separate static buffer for script validation so that it is safe
102 * to validate scripts from within a script. This is used only in
112 * global script data structures.
118 * Some script names have special meaning, such as those executed
125 * Find the existing script slot for a named script, if any.
141 * Find a new slot for a script, if available. Does not mark as allocated in
157 * Perform very rudimentary validation of a proposed script. It would be
158 * easy to imagine something more comprehensive. The script string is
162 db_script_valid(const char *scriptname, const char *script)
170 if (strlen(script) >= DB_MAXSCRIPTLEN)
173 strcpy(buffer, script);
182 * Modify an existing script or add a new script with the specified script
183 * name and contents. If there are no script slots available, an error will
187 db_script_set(const char *scriptname, const char *script)
192 error = db_script_valid(scriptname, script);
203 strlcpy(dsp->ds_script, script, sizeof(dsp->ds_script));
208 * Delete an existing script by name, if found.
258 * Execute a script, breaking it up into individual commands and passing them
260 * restore control to the main script loop if things get too wonky when
265 * injected into the input at a lower layer. We should validate the script
280 db_printf("script '%s' not found\n", scriptname);
292 * Parse script in temporary buffer, since strsep() is destructive.
314 * enter to a script name, and don't whine if the script doesn't exist. If
315 * there is no matching script, try the catch-all script.
332 * run <scriptname> - run a script
333 * script <scriptname> - prints script
334 * script <scriptname> <script> - set a script
335 * unscript <scriptname> - remove a script
357 * Execute a script.
366 * might want to accept flags and arguments to the script itself.
379 * Print or set a named script, with the set portion broken out into its own
393 db_printf("usage: script scriptname=script\n");
409 db_printf("script '%s' not found\n", scriptname);
427 * Remove a named script.
444 db_printf("script '%s' not found\n", db_tok_string);
454 * debug.ddb.scripting.script - Define a new script
456 * debug.ddb.scripting.unscript - Remove an existing script
459 * name space from the debugger, the script/unscript sysctls are a bit more
464 "DDB script settings");
475 * maximum-length script, and carriage return for every script that
503 char *buffer, *script, *scriptname;
517 * Argument will be in form scriptname=script, so split into the
518 * scriptname and script.
520 script = buffer;
521 scriptname = strsep(&script, "=");
522 if (script == NULL) {
527 error = db_script_set(scriptname, script);
533 SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, script, CTLTYPE_STRING |
535 "Set a script");
539 * the name of the script that you want to delete.
562 "Unset a script");