tools: add a 'crash' tool that triggers a segfault

This commit is contained in:
Danny Robson 2019-10-10 17:33:12 +11:00
parent f5b702595f
commit d0d9c3a676
2 changed files with 8 additions and 1 deletions

View File

@ -622,7 +622,7 @@ endif ()
###############################################################################
foreach (tool backtrace cpuid log poisson macro scratch)
foreach (tool backtrace cpuid crash log poisson macro scratch)
add_executable (util_${tool} tools/${tool}.cpp)
set_target_properties (util_${tool} PROPERTIES OUTPUT_NAME ${tool})
target_link_libraries (util_${tool} cruft)

7
tools/crash.cpp Normal file
View File

@ -0,0 +1,7 @@
#include <cruft/util/debug/system.hpp>
int main ()
{
cruft::debug::init ();
return *reinterpret_cast<int*> (0x01);
}