From 106adcb98390d41ced28ecbbd0b661d3056023d2 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 9 Feb 2025 09:15:30 +0100 Subject: ADD: Add LibDebugger as a separate dylib, fix depreciation warning for ptrace. Signed-off-by: Amlal El Mahrouss --- dev/LibCompiler/src/DebuggerPOSIX.cc | 66 ------------------------------------ 1 file changed, 66 deletions(-) delete mode 100644 dev/LibCompiler/src/DebuggerPOSIX.cc (limited to 'dev/LibCompiler/src') diff --git a/dev/LibCompiler/src/DebuggerPOSIX.cc b/dev/LibCompiler/src/DebuggerPOSIX.cc deleted file mode 100644 index a5e663e..0000000 --- a/dev/LibCompiler/src/DebuggerPOSIX.cc +++ /dev/null @@ -1,66 +0,0 @@ -/*** - (C) 2025 Amlal El Mahrouss - */ - -#include -#include - -LIBCOMPILER_MODULE(DebuggerPOSIX) -{ - LibDebugger::IDebugger debugger; - pid_t pid = 0L; - - if (argc >= 3 && std::string(argv[1]) == "-p" && - argv[2] != nullptr) - { - pid = std::stoi(argv[2]); - debugger.Attach(pid); - } - - while (YES) - { - std::string cmd; - std::getline(std::cin, cmd); - - if (cmd == "c" || - cmd == "cont") - debugger.ContinueExecution(); - - if (cmd == "d" || - cmd == "detach") - debugger.Detach(); - - if (cmd == "attach") - { - std::cout << "[?] Enter a PID to attach on: "; - - std::getline(std::cin, cmd); - pid = std::stoi(cmd.c_str()); - - debugger.Attach(pid); - } - - if (cmd == "exit") - { - if (pid > 0) - debugger.Detach(); - - break; - } - - if (cmd == "break" || - cmd == "bp") - { - std::cout << "[?] Enter an address to add a breakpoint on: "; - - std::getline(std::cin, cmd); - - LibDebugger::VmAddress breakpoint_addr = reinterpret_cast(std::stoul(cmd.c_str(), nullptr, 16)); - - if (breakpoint_addr) - debugger.SetBreakpoint(breakpoint_addr); - } - } - - return 0; -} -- cgit v1.2.3