mirror of
https://github.com/corda/corda.git
synced 2025-01-04 04:04:27 +00:00
split avian::system::crash into its own file
This commit is contained in:
parent
944300a5e2
commit
41cb6fabf5
6
makefile
6
makefile
@ -1134,8 +1134,7 @@ vm-depends := $(generated-code) \
|
|||||||
|
|
||||||
vm-sources = \
|
vm-sources = \
|
||||||
$(src)/system/$(system).cpp \
|
$(src)/system/$(system).cpp \
|
||||||
$(src)/system/$(system)/signal.cpp \
|
$(wildcard $(src)/system/$(system)/*.cpp) \
|
||||||
$(src)/system/$(system)/memory.cpp \
|
|
||||||
$(src)/finder.cpp \
|
$(src)/finder.cpp \
|
||||||
$(src)/machine.cpp \
|
$(src)/machine.cpp \
|
||||||
$(src)/util.cpp \
|
$(src)/util.cpp \
|
||||||
@ -1270,8 +1269,7 @@ generator-depends := $(wildcard $(src)/*.h)
|
|||||||
generator-sources = \
|
generator-sources = \
|
||||||
$(src)/tools/type-generator/main.cpp \
|
$(src)/tools/type-generator/main.cpp \
|
||||||
$(src)/system/$(build-system).cpp \
|
$(src)/system/$(build-system).cpp \
|
||||||
$(src)/system/$(build-system)/signal.cpp \
|
$(wildcard $(src)/system/$(build-system)/*.cpp) \
|
||||||
$(src)/system/$(build-system)/memory.cpp \
|
|
||||||
$(src)/finder.cpp \
|
$(src)/finder.cpp \
|
||||||
$(src)/util/arg-parser.cpp
|
$(src)/util/arg-parser.cpp
|
||||||
|
|
||||||
|
22
src/system/posix/crash.cpp
Normal file
22
src/system/posix/crash.cpp
Normal 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
|
@ -149,11 +149,6 @@ void handleSignal(int signal, siginfo_t*, void* context)
|
|||||||
|
|
||||||
} // namespace posix
|
} // namespace posix
|
||||||
|
|
||||||
NO_RETURN void crash()
|
|
||||||
{
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalRegistrar::SignalRegistrar()
|
SignalRegistrar::SignalRegistrar()
|
||||||
{
|
{
|
||||||
data = new (malloc(sizeof(Data))) Data();
|
data = new (malloc(sizeof(Data))) Data();
|
||||||
|
28
src/system/windows/crash.cpp
Normal file
28
src/system/windows/crash.cpp
Normal 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
|
@ -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)
|
bool SignalRegistrar::registerHandler(Signal signal, Handler* handler)
|
||||||
{
|
{
|
||||||
return data->registerHandler(handler, signal);
|
return data->registerHandler(handler, signal);
|
||||||
|
Loading…
Reference in New Issue
Block a user