mudos源码分析
错误捕捉相关的代码在simulate.c
void throw_error() { if (((current_error_context->save_csp + 1)->framekind & FRAME_MASK) == FRAME_CATCH) { LONGJMP(current_error_context->context, 1); fatal("Throw_error failed!"); } error("Throw with no catch.\n"); } static void debug_message_with_location P1(char *, err) { if (current_object && current_prog) { debug_message("%sprogram: /%s, object: /%s, file: %s\n", err, current_prog->name, current_object->name, get_line_number(pc, current_prog)); } else if (current_object) { debug_message("%sprogram: (none), object: /%s, file: (none)\n", err, current_object->name); } else { debug_message("%sprogram: (none), object: (none), file: (none)\n", err); } }
void fatal P1V(char *, fmt) { static int in_fatal = 0; char msg_buf[2049]; va_list args; V_DCL(char *fmt); if (in_fatal) { debug_message("Fatal error while shutting down. Aborting.\n"); } else { in_fatal = 1; V_START(args, fmt); V_VAR(char *, fmt, args); vsprintf(msg_buf, fmt, args); va_end(args); debug_message("******** FATAL ERROR: %s\nMudOS driver attempting to exit gracefully.\n", msg_buf); if (current_file) debug_message("(occured during compilation of %s at line %d)\n", current_file, current_line); if (current_object) debug_message("(current object was /%s)\n", current_object->name); dump_trace(1); #ifdef PACKAGE_MUDLIB_STATS save_stat_files(); #endif copy_and_push_string(msg_buf); if (command_giver) { push_object(command_giver); } else { push_undefined(); } if (current_object) { push_object(current_object); } else { push_undefined(); } apply_master_ob(APPLY_CRASH, 3); debug_message("crash() in master called successfully. Aborting.\n"); } /* Make sure we don't trap our abort() */ #ifdef SIGABRT signal(SIGABRT, SIG_DFL); #endif #ifdef SIGILL signal(SIGILL, SIG_DFL); #endif #ifdef SIGIOT signal(SIGIOT, SIG_DFL); #endif #if !defined(DEBUG_NON_FATAL) || !defined(MDEBUG) #ifdef WIN32 exit(0); #endif abort(); #endif in_fatal = 0; }
Rust编程语言群 1036955113
java新手自学群 626070845
java/springboot/hadoop/JVM 群 4915800
Hadoop/mongodb(搭建/开发/运维)Q群481975850
GOLang Q1群:6848027
GOLang Q2群:450509103
GOLang Q3群:436173132
GOLang Q4群:141984758
GOLang Q5群:215535604
C/C++/QT群 1414577
单片机嵌入式/电子电路入门群群 306312845
MUD/LIB/交流群 391486684
Electron/koa/Nodejs/express 214737701
大前端群vue/js/ts 165150391
操作系统研发群:15375777
汇编/辅助/破解新手群:755783453
大数据 elasticsearch 群 481975850
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
java新手自学群 626070845
java/springboot/hadoop/JVM 群 4915800
Hadoop/mongodb(搭建/开发/运维)Q群481975850
GOLang Q1群:6848027
GOLang Q2群:450509103
GOLang Q3群:436173132
GOLang Q4群:141984758
GOLang Q5群:215535604
C/C++/QT群 1414577
单片机嵌入式/电子电路入门群群 306312845
MUD/LIB/交流群 391486684
Electron/koa/Nodejs/express 214737701
大前端群vue/js/ts 165150391
操作系统研发群:15375777
汇编/辅助/破解新手群:755783453
大数据 elasticsearch 群 481975850
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
2012-11-27 自制CPU的黑暗历程一