错误捕捉相关的代码在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. mongodb索引 过期索引

    过期索引,指的是一段时间后会过期的索引,在索引过期后,相应的数据会被删除,这适合存储一些在一段时间之后会失效的数据,比如用户的登录信息,想要用户登录信息2天后失效,需要用户重新登录,或者存储的日志,希 ...

  2. go deep copy map

    func deepCopyJSON(src map[string]interface{}, dest map[string]interface{}) error { if src == nil { r ...

  3. 大数据之路week04--day03(网络编程)

    哎,怎么感觉自己变得懒了起来,更新博客的频率变得慢了起来,可能是因为最近得知识开始变得杂变得难了起来,之前在上课的时候,也没有好好听这一方面的知识,所以,现在可以说是在学的新的知识,要先去把新的知识思 ...

  4. vue 有条件加载组件 执行某方法后再渲染组件

    <component :is="currentCom"></component>   import Grid from './component/grid' ...

  5. C# 任务、线程、同步(二)

    取消架构 1.Parallel.For()方法的取消 static void CancelParallelLoop() { var cts = new CancellationTokenSource( ...

  6. git commit 详解

    git commit 命令用来将本地暂存的修改提交到版本库. git commit -m '提交信息'. 我们用的比较多的应该就是-m 参数.添加提交信息. 经常手抖的同学可能会知道,git comm ...

  7. ckeditor粘贴word图片自动上传功能

    由于工作需要必须将word文档内容粘贴到编辑器中使用 但发现word中的图片粘贴后变成了file:///xxxx.jpg这种内容,如果上传到服务器后其他人也访问不了,网上找了很多编辑器发现没有一个能直 ...

  8. 18.4.1 考试解题报告 P71

    题目:https://files.cnblogs.com/files/lovewhy/problem.pdf 偷偷摘来dalao题面. P71竞赛时间:???? 年?? 月?? 日??:??-??:? ...

  9. 【线性代数】5-2:置换和余因子(Permutations and Cofactors)

    title: [线性代数]5-2:置换和余因子(Permutations and Cofactors) categories: Mathematic Linear Algebra keywords: ...

  10. Linux之文件通信

    /* * 后执行,尝试读取另外一个进程写入文件的内容 */ #include <stdio.h> #include <unistd.h> #include <stdlib ...