错误捕捉相关的代码在simulate.c

void throw_error()
{
if (((current_error_context->save_csp + )->framekind & FRAME_MASK) == FRAME_CATCH) {
LONGJMP(current_error_context->context, );
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 = ;
char msg_buf[];
va_list args;
V_DCL(char *fmt); if (in_fatal) {
debug_message("Fatal error while shutting down. Aborting.\n");
} else {
in_fatal = ;
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(); #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, );
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();
#endif
abort();
#endif
in_fatal = ;
}

mudos源码分析的更多相关文章

  1. ABP源码分析一:整体项目结构及目录

    ABP是一套非常优秀的web应用程序架构,适合用来搭建集中式架构的web应用程序. 整个Abp的Infrastructure是以Abp这个package为核心模块(core)+15个模块(module ...

  2. HashMap与TreeMap源码分析

    1. 引言     在红黑树--算法导论(15)中学习了红黑树的原理.本来打算自己来试着实现一下,然而在看了JDK(1.8.0)TreeMap的源码后恍然发现原来它就是利用红黑树实现的(很惭愧学了Ja ...

  3. nginx源码分析之网络初始化

    nginx作为一个高性能的HTTP服务器,网络的处理是其核心,了解网络的初始化有助于加深对nginx网络处理的了解,本文主要通过nginx的源代码来分析其网络初始化. 从配置文件中读取初始化信息 与网 ...

  4. zookeeper源码分析之五服务端(集群leader)处理请求流程

    leader的实现类为LeaderZooKeeperServer,它间接继承自标准ZookeeperServer.它规定了请求到达leader时需要经历的路径: PrepRequestProcesso ...

  5. zookeeper源码分析之四服务端(单机)处理请求流程

    上文: zookeeper源码分析之一服务端启动过程 中,我们介绍了zookeeper服务器的启动过程,其中单机是ZookeeperServer启动,集群使用QuorumPeer启动,那么这次我们分析 ...

  6. zookeeper源码分析之三客户端发送请求流程

    znode 可以被监控,包括这个目录节点中存储的数据的修改,子节点目录的变化等,一旦变化可以通知设置监控的客户端,这个功能是zookeeper对于应用最重要的特性,通过这个特性可以实现的功能包括配置的 ...

  7. java使用websocket,并且获取HttpSession,源码分析

    转载请在页首注明作者与出处 http://www.cnblogs.com/zhuxiaojie/p/6238826.html 一:本文使用范围 此文不仅仅局限于spring boot,普通的sprin ...

  8. ABP源码分析二:ABP中配置的注册和初始化

    一般来说,ASP.NET Web应用程序的第一个执行的方法是Global.asax下定义的Start方法.执行这个方法前HttpApplication 实例必须存在,也就是说其构造函数的执行必然是完成 ...

  9. ABP源码分析三:ABP Module

    Abp是一种基于模块化设计的思想构建的.开发人员可以将自定义的功能以模块(module)的形式集成到ABP中.具体的功能都可以设计成一个单独的Module.Abp底层框架提供便捷的方法集成每个Modu ...

随机推荐

  1. bcb ole拖拽功能的实现

    最近项目中用到了OLE 拖拽功能 和BCB 一个Form的Drag 不同的是,只有实现了OLE 拖拽才能,从其他程序拖拽数据到Form 下面的代码实现了,同HTML网页拖拽到Form时,Form获得H ...

  2. Nginx中ngx_http_headers_module

    *向由代理理服务器器响应给客户端的响应报⽂文添加⾃自定义⾸首部,或修改指定⾸首部的值**指令:14.1 add_header添加⾃自定义⾸首部Syntax: add_header name value ...

  3. linux基础知识和常用命令

    1.修改主机名 切换到root,然后执行 vim /etc/sysconfig/network,进入其中,更改hostname即可.insert进入修改,esc+:,wq保存退出. 2.用户切换 普通 ...

  4. Oracle12c-ADG搭建

    实验环境: 角色 IP hostname CDB name db_unique_name pdb name 版本 主 192.168.0.115 Node11 cdb1 cdb_p pdb1 12.2 ...

  5. investigate issues of real time interrupted

    Issues: customer report that real time will interrupted frequently as below: Root Cause: some storm ...

  6. 中文乱码 encodeURI来解决URL传递时的中文问题

    解决中文乱麻问题,页面端发出的数据作两次encodeURI var name="张三"; encodeURI(encodeURI(name)); 后台解码: URLDecoder. ...

  7. idea 设置 maven 默认位置

    在 idea 中创建 maven 项目 每次都要修改掉 默认的maven位置,觉得很烦.... 所以这边篇博客就是专门解决掉这个麻烦精的......(233333) 首先   File --> ...

  8. 菜鸟 Python 100例

    以下参考:菜鸟教程 python100例 == 推荐博客 有四个数字: 1.2.3.4,能组成多少个互不相同且无重复数字的三位数?各是多少? import itertools a = ('1','2' ...

  9. BZOJ 4241: 历史研究 ( 回 滚 )

    题目:  链接:https://www.lydsy.com/JudgeOnline/problem.php?id=4241 题意:给你一个长度为n序列,m次查询,每次询问 一段区间 最大的  a[ i ...

  10. 牛客小白月赛11 Rinne Loves Edges

    题库链接:https://ac.nowcoder.com/acm/contest/370/F code: #include<bits/stdc++.h> using namespace s ...