tcp: Fix 64 bit build with debugging features enabled.
[haiku.git] / src / bin / debug / kernel_debugger.cpp
blobad3b8012325c3951fb6b9f105538ea098b462bb4
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <stdio.h>
8 #include <string.h>
11 #include <syscalls.h>
14 extern const char* __progname;
16 static const char* const kUsage =
17 "Usage: %s [ <message> ]\n"
18 "Enters the kernel debugger with the optional message.\n";
21 int
22 main(int argc, const char* const* argv)
24 const char* message = "User command requested kernel debugger.";
26 if (argc > 1) {
27 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
28 printf(kUsage, __progname);
29 return 0;
32 message = argv[1];
35 status_t error = _kern_kernel_debugger(message);
36 if (error != B_OK) {
37 fprintf(stderr, "Error: Entering the kernel debugger failed: %s\n",
38 strerror(error));
39 return 1;
42 return 0;