split avian::system::crash into its own file

This commit is contained in:
Joshua Warner 2014-07-12 19:05:58 -06:00 committed by Joshua Warner
parent 944300a5e2
commit 41cb6fabf5
5 changed files with 52 additions and 20 deletions

View File

@ -1134,8 +1134,7 @@ vm-depends := $(generated-code) \
vm-sources = \
$(src)/system/$(system).cpp \
$(src)/system/$(system)/signal.cpp \
$(src)/system/$(system)/memory.cpp \
$(wildcard $(src)/system/$(system)/*.cpp) \
$(src)/finder.cpp \
$(src)/machine.cpp \
$(src)/util.cpp \
@ -1270,8 +1269,7 @@ generator-depends := $(wildcard $(src)/*.h)
generator-sources = \
$(src)/tools/type-generator/main.cpp \
$(src)/system/$(build-system).cpp \
$(src)/system/$(build-system)/signal.cpp \
$(src)/system/$(build-system)/memory.cpp \
$(wildcard $(src)/system/$(build-system)/*.cpp) \
$(src)/finder.cpp \
$(src)/util/arg-parser.cpp

View File

@ -0,0 +1,22 @@
/* Copyright (c) 2008-2014, Avian Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
There is NO WARRANTY for this software. See license.txt for
details. */
#include <avian/common.h>
namespace avian {
namespace system {
NO_RETURN void crash()
{
abort();
}
} // namespace system
} // namespace avian

View File

@ -149,11 +149,6 @@ void handleSignal(int signal, siginfo_t*, void* context)
} // namespace posix
NO_RETURN void crash()
{
abort();
}
SignalRegistrar::SignalRegistrar()
{
data = new (malloc(sizeof(Data))) Data();

View File

@ -0,0 +1,28 @@
/* Copyright (c) 2008-2014, Avian Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
There is NO WARRANTY for this software. See license.txt for
details. */
#include <avian/common.h>
namespace avian {
namespace system {
NO_RETURN void crash()
{
// trigger an EXCEPTION_ACCESS_VIOLATION, which we will catch and
// generate a debug dump for
*static_cast<volatile int*>(0) = 0;
// Some (all?) compilers don't realize that we can't possibly continue past
// the above statement.
abort();
}
} // namespace system
} // namespace avian

View File

@ -324,17 +324,6 @@ bool SignalRegistrar::Data::registerHandler(Handler* handler, int index)
}
}
NO_RETURN void crash()
{
// trigger an EXCEPTION_ACCESS_VIOLATION, which we will catch and
// generate a debug dump for
*static_cast<volatile int*>(0) = 0;
// Some (all?) compilers don't realize that we can't possibly continue past
// the above statement.
abort();
}
bool SignalRegistrar::registerHandler(Signal signal, Handler* handler)
{
return data->registerHandler(handler, signal);