int main(int argc, char* argv[]){ parse_args(argc, argv); init_ui(); init_structs(); init_plotter(); start_debug(); int x; while (!options.quit) { clear(); set_terminal_size(); draw_axis(); replot_functions(); x = input(); if(x == -1) break; refresh(); } clean_plotter(); clean_ui(); return 0; }
void debug_binary(\ void) { if (!IS(O_FILEDEBUG, OPT) && !IS(O_DEBUG, OPT)) return ; start_debug("Binary"); ft_dicdoinf(BINARY, putbinary); end_debug("Binary"); }
void debug_env(\ void) { int i; if (!IS(O_FILEDEBUG, OPT) && !IS(O_DEBUG, OPT)) return ; start_debug("Environ"); i = 0; while (ENV[i]) ft_fprintf(FDDEBUG, "\t%s\n", ENV[i++]); end_debug("Environ"); }
void debug_builtin(\ void) { int i; if (!IS(O_FILEDEBUG, OPT) && !IS(O_DEBUG, OPT)) return ; start_debug("Builtin"); i = -1; while (++i < FT_SH_BUILTIN_SIZE) ft_fprintf(FDDEBUG, FMT_BUILTIN_DEBUG, BUILTIN[i].id, BUILTIN[i].built); end_debug("Builtin"); }
void debug_cmd(\ t_cmd cmd) { int i; if (!IS(O_FILEDEBUG, OPT) && !IS(O_DEBUG, OPT)) return ; start_debug("Command"); i = -1; ft_fprintf(FDDEBUG, "Binary: [%s] -> [%s]\n", cmd.arg_v[0], cmd.pathbin); while (cmd.arg_v[++i]) ft_fprintf(FDDEBUG, FMT_ARGV, i, cmd.arg_v[i]); end_debug("Command"); }
/* * * __panic - __panic is called on unresolvable fatal errors. it prints * "panic: 'message'", and then enters the kernel monitor. * */ void __panic(const char *file, int line, const char *fmt, ...) { if (is_panic) { goto panic_dead; } is_panic = 1; start_debug(); // print the 'message' va_list ap; va_start(ap, fmt); kprintf("kernel panic at %s:%d:\n ", file, line); vkprintf(fmt, ap); kprintf("\n"); va_end(ap); panic_dead: intr_disable(); while (1) { monitor(NULL); } }