2021-11-26 06:41:56 +03:00
|
|
|
/**
|
|
|
|
* @brief Test tool for producing segmentation faults.
|
|
|
|
*
|
|
|
|
* Useful for testing the debugger.
|
|
|
|
*
|
|
|
|
* @copyright
|
|
|
|
* This file is part of ToaruOS and is released under the terms
|
|
|
|
* of the NCSA / University of Illinois License - see LICENSE.md
|
|
|
|
* Copyright (C) 2021 K. Lange
|
|
|
|
*/
|
2021-09-23 18:12:29 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2021-09-22 14:26:16 +03:00
|
|
|
int main(int argc, char * argv[]) {
|
2021-09-23 18:12:29 +03:00
|
|
|
if (argc > 1) {
|
|
|
|
fprintf(stderr, "%s\n", (char*)(uintptr_t)strtoul(argv[1],NULL,0));
|
|
|
|
} else {
|
|
|
|
*(volatile int*)0x12345 = 42;
|
|
|
|
}
|
2021-09-22 14:26:16 +03:00
|
|
|
return 0;
|
|
|
|
}
|