diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-30 08:50:15 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-30 08:50:15 +0100 |
| commit | 1c8c5cff67b20d86c442b0917d6c1fc6407140df (patch) | |
| tree | 53ebea660bef14cdc2ff5b7ebefb4049f705f997 /dev/LibDebugger/src | |
| parent | 073811d89c98d6e1c078a032ca2eedefebf80384 (diff) | |
feat! Breaking API changes of NeCTI's LibCompiler and LibDebugger.
what:
- They've now become CompilerKit and DebuggerKit.
- Expanding XCoff for NeBoot PowerPC backend.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibDebugger/src')
| -rw-r--r-- | dev/LibDebugger/src/NeKernelContract.cc | 48 | ||||
| -rw-r--r-- | dev/LibDebugger/src/NeKernelContractCLI.cc | 101 | ||||
| -rw-r--r-- | dev/LibDebugger/src/POSIXMachContractCLI.cc | 93 |
3 files changed, 0 insertions, 242 deletions
diff --git a/dev/LibDebugger/src/NeKernelContract.cc b/dev/LibDebugger/src/NeKernelContract.cc deleted file mode 100644 index 2c2543e..0000000 --- a/dev/LibDebugger/src/NeKernelContract.cc +++ /dev/null @@ -1,48 +0,0 @@ -/*** - LibDebugger - (C) 2025 Amlal El Mahrouss - File: NeKernelContract.cc - Purpose: NeKernel Debugger -*/ - -#ifdef LD_NEKERNEL_DEBUGGER - -#include <LibCompiler/Defines.h> -#include <LibDebugger/NeKernelContract.h> -#include <Vendor/Dialogs.h> - -#include <sys/socket.h> -#include <sys/types.h> -#include <sys/un.h> -#include <unistd.h> - -constexpr static UInt16 kDebugPort = 51820; - -using namespace LibDebugger::NeKernel; - -NeKernelContract::NeKernelContract() = default; - -NeKernelContract::~NeKernelContract() = default; - -BOOL NeKernelContract::Attach(LibCompiler::STLString path, LibCompiler::STLString argv, - ProcessID& pid) noexcept { - return NO; -} - -BOOL NeKernelContract::BreakAt(LibCompiler::STLString symbol) noexcept { - return NO; -} - -BOOL NeKernelContract::Break() noexcept { - return NO; -} - -BOOL NeKernelContract::Continue() noexcept { - return NO; -} - -BOOL NeKernelContract::Detach() noexcept { - return NO; -} - -#endif // LD_NEKERNEL_DEBUGGER
\ No newline at end of file diff --git a/dev/LibDebugger/src/NeKernelContractCLI.cc b/dev/LibDebugger/src/NeKernelContractCLI.cc deleted file mode 100644 index 25e9c13..0000000 --- a/dev/LibDebugger/src/NeKernelContractCLI.cc +++ /dev/null @@ -1,101 +0,0 @@ -/*** - LibDebugger - (C) 2025 Amlal El Mahrouss - File: NeKernelContract.cc - Purpose: NeKernel Debugger CLI. -*/ - -#ifdef LD_NEKERNEL_DEBUGGER - -#include <LibCompiler/Defines.h> -#include <LibDebugger/NeKernelContract.h> -#include <Vendor/Dialogs.h> -#include <string> - -#include <LibDebugger/CommonCLI.inl> - -using namespace LibDebugger::NeKernel; - -static void dbgi_ctrlc_handler(std::int32_t _) { - if (!kPID || kPath.empty()) { - return; - } - - kKernelDebugger.Break(); - - pfd::notify("Debugger Event", "BreakAt hit!"); - - kKeepRunning = false; -} - -LIBCOMPILER_MODULE(DebuggerNeKernel) { - pfd::notify("Debugger Event", - "Kernel Debugger\n(C) 2025 Amlal El Mahrouss, all rights reserved."); - - if (argc >= 5 && std::string(argv[1]) == "-k" && argv[2] != nullptr && - std::string(argv[3]) == "-ip" && argv[4] != nullptr) { - kPath = argv[2]; - kPath += ":"; - kPath += argv[4]; - - kStdOut << "[+] KIP (Kernel:IP) set to: " << kPath << "\n"; - - LibCompiler::install_signal(SIGINT, dbgi_ctrlc_handler); - - kKernelDebugger.Attach(kPath, "", kPID); - kKernelDebugger.BreakAt("$HANDOVER_START"); - - while (YES) { - if (kKeepRunning) { - continue; - } - - std::string cmd; - if (!std::getline(std::cin, cmd)) break; - - if (cmd == "c" || cmd == "cont" || cmd == "continue") { - if (kKernelDebugger.Continue()) { - kKeepRunning = true; - - kStdOut << "[+] Continuing...\n"; - - pfd::notify("Debugger Event", "Continuing..."); - } - } - - if (cmd == "d" || cmd == "detach") kKernelDebugger.Detach(); - - if (cmd == "start") { - kStdOut << "[?] Enter a argument to use: "; - std::getline(std::cin, cmd); - - kKernelDebugger.Attach(kPath, cmd, kPID); - } - - if (cmd == "exit") { - if (kPID > 0) kKernelDebugger.Detach(); - - break; - } - - if (cmd == "break" || cmd == "b") { - kStdOut << "[?] Enter a symbol to break on: "; - - std::getline(std::cin, cmd); - - if (kKernelDebugger.BreakAt(cmd)) { - pfd::notify("Debugger Event", "Add BreakAt at: " + cmd); - } - } - } - - return EXIT_SUCCESS; - } - - kStdOut << "Usage: " << argv[0] << " -k <kernel_path> -ip <ip4>\n"; - kStdOut << "Example: " << argv[0] << " -k /path/to/ne_kernel -ip 127.0.0.1\n"; - - return EXIT_FAILURE; -} - -#endif // LD_NEKERNEL_DEBUGGER
\ No newline at end of file diff --git a/dev/LibDebugger/src/POSIXMachContractCLI.cc b/dev/LibDebugger/src/POSIXMachContractCLI.cc deleted file mode 100644 index 0962ba6..0000000 --- a/dev/LibDebugger/src/POSIXMachContractCLI.cc +++ /dev/null @@ -1,93 +0,0 @@ -/*** - LibDebugger - (C) 2025 Amlal El Mahrouss - File: POSIXMachContract.cc - Purpose: OS X/Darwin Debugger -*/ - -#ifdef LD_MACH_DEBUGGER - -#include <LibCompiler/Defines.h> -#include <LibDebugger/POSIXMachContract.h> -#include <Vendor/Dialogs.h> -#include <cstdint> -#include <iostream> -#include <string> - -#include <LibDebugger/CommonCLI.inl> - -/// @internal -/// @brief Handles CTRL-C signal on debugger. -static void dbgi_ctrlc_handler(std::int32_t _) { - if (!kPID) { - return; - } - - kDebugger.Break(); - - pfd::notify("Debugger Event", "BreakAt hit!"); - - kKeepRunning = false; -} - -LIBCOMPILER_MODULE(DebuggerMachPOSIX) { - pfd::notify("Debugger Event", - "Userland Debugger\n(C) 2025 Amlal El Mahrouss, all rights reserved."); - - if (argc >= 3 && std::string(argv[1]) == "-p" && argv[2] != nullptr) { - kPath = argv[2]; - kDebugger.SetPath(kPath); - - kStdOut << "[+] Image set to: " << kPath << "\n"; - } - - LibCompiler::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 (kDebugger.Continue()) { - kKeepRunning = true; - - kStdOut << "[+] Continuing...\n"; - - pfd::notify("Debugger Event", "Continuing..."); - } - } - - if (cmd == "d" || cmd == "detach") kDebugger.Detach(); - - if (cmd == "start") { - kStdOut << "[?] Enter a argument to use: "; - std::getline(std::cin, cmd); - - kDebugger.Attach(kPath, cmd, kPID); - } - - if (cmd == "exit") { - if (kPID > 0) kDebugger.Detach(); - - break; - } - - if (cmd == "break" || cmd == "b") { - kStdOut << "[?] Enter a symbol to break on: "; - - std::getline(std::cin, cmd); - - if (kDebugger.BreakAt(cmd)) { - pfd::notify("Debugger Event", "Add BreakAt at: " + cmd); - } - } - } - - return EXIT_SUCCESS; -} - -#endif
\ No newline at end of file |
