From e9c4d47ad719d6fd67cd9b75b41ebbec563e7a79 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 23 Sep 2008 19:54:12 +0000 Subject: [PATCH] Added command line option "-d" to disable the debugger before crashing. Shows that disable_debugger() isn't working ATM. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27712 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/servers/debug/crashing_app.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/servers/debug/crashing_app.cpp b/src/tests/servers/debug/crashing_app.cpp index 6238dea630..55f3338d60 100644 --- a/src/tests/servers/debug/crashing_app.cpp +++ b/src/tests/servers/debug/crashing_app.cpp @@ -16,6 +16,7 @@ static const char *kUsage = "Crashes in more or less inovative ways.\n" "\n" "Options:\n" + " -d - call disable_debugger() first\n" " -h, --help - print this info text\n" " --thread - crash in a separate thread\n" "\n" @@ -143,6 +144,7 @@ crashing_thread(void* data) crash_function_t* doCrash = (crash_function_t*)data; snooze(100000); doCrash(); + return 0; } @@ -150,6 +152,7 @@ int main(int argc, const char* const* argv) { bool inThread = false; + bool disableDebugger = false; const char* mode = "segv"; // parse args @@ -160,6 +163,8 @@ main(int argc, const char* const* argv) if (arg[0] == '-') { if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) { print_usage_and_exit(false); + } else if (strcmp(arg, "-d") == 0) { + disableDebugger = true; } else if (strcmp(arg, "--thread") == 0) { inThread = true; } else { @@ -177,6 +182,9 @@ main(int argc, const char* const* argv) print_usage_and_exit(true); } + if (disableDebugger) + disable_debugger(true); + if (inThread) { thread_id thread = spawn_thread(crashing_thread, "crashing thread", B_NORMAL_PRIORITY, (void*)doCrash);