diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:05:29 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:05:29 +0100 |
| commit | bbe2c77243c541ca7e0075149f5be3262eb89523 (patch) | |
| tree | ae5d59d299344fd19584a2c3642bacd788e841d4 /dev/DebuggerKit/src/POSIXMachContractCLI.cc | |
| parent | b5adf16a96b9cbb80c74cf30404ed5bcff03ac34 (diff) | |
feat! breaking changes on necti sources.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/DebuggerKit/src/POSIXMachContractCLI.cc')
| -rw-r--r-- | dev/DebuggerKit/src/POSIXMachContractCLI.cc | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/dev/DebuggerKit/src/POSIXMachContractCLI.cc b/dev/DebuggerKit/src/POSIXMachContractCLI.cc deleted file mode 100644 index 77fe844..0000000 --- a/dev/DebuggerKit/src/POSIXMachContractCLI.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* ======================================== - - Copyright (C) 2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license. - -======================================== */ - -#ifdef DK_MACH_DEBUGGER - -#include <CompilerKit/Defines.h> -#include <DebuggerKit/POSIXMachContract.h> -#include <ThirdParty/Dialogs.h> -#include <DebuggerKit/CommonCLI.inl> - -/// @internal -/// @brief Handles CTRL-C signal on debugger. -static void dbgi_ctrlc_handler(std::int32_t _) { - if (!kPID) { - return; - } - - kUserDebugger.Break(); - - pfd::notify("Debugger Event", "Breakpoint hit!"); - - kKeepRunning = false; -} - -NECTI_MODULE(DebuggerMachPOSIX) { - pfd::notify( - "Debugger Event", - "Userland Debugger\n(C) 2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license."); - - if (argc >= 3 && std::string(argv[1]) == "-p" && argv[2] != nullptr) { - kPath = argv[2]; - kUserDebugger.SetPath(kPath); - - kStdOut << "[+] Image set to: " << kPath << "\n"; - } else { - kStdOut << "usage: " << argv[0] << " -p <path>\n"; - kStdOut << "example: " << argv[0] << " -p /path/to/program\n"; - - return EXIT_FAILURE; - } - - CompilerKit::install_signal(SIGINT, dbgi_ctrlc_handler); - - while (YES) { - if (kKeepRunning) { - continue; - } - - std::string cmd; - if (!std::getline(std::cin, cmd)) break; - - if (cmd == "c" || cmd == "cont" || cmd == "continue") { - if (kUserDebugger.Continue()) { - kKeepRunning = true; - - kStdOut << "[+] Continuing...\n"; - - pfd::notify("Debugger Event", "Continuing..."); - } - } - - if (cmd == "d" || cmd == "detach") kUserDebugger.Detach(); - - if (cmd == "start") { - kStdOut << "[?] Enter a argument to use: "; - std::getline(std::cin, cmd); - - kUserDebugger.Attach(kPath, cmd, kPID); - } - - if (cmd == "exit") { - if (kPID > 0) kUserDebugger.Detach(); - - break; - } - - if (cmd == "break" || cmd == "b") { - kStdOut << "[?] Enter a symbol to break on: "; - - std::getline(std::cin, cmd); - - if (kUserDebugger.BreakAt(cmd)) { - pfd::notify("Debugger Event", "Add BreakAt at: " + cmd); - } - } - } - - return EXIT_SUCCESS; -} - -#endif
\ No newline at end of file |
