summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-02-27 23:03:15 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-02-27 23:03:15 +0100
commitc64f60e1c99cb06cf31314662e243a733ac0bad9 (patch)
tree5c6a0c74e010fd4085fadd42cd9672b00f70c6e8
parent4761cc729d0c2fe08ac4c4c2a72020fa73ae53a9 (diff)
chore: codebase improvements and tweaks.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--doc/cpp_style.md4
-rw-r--r--include/DebuggerKit/MachContract.h (renamed from include/DebuggerKit/POSIXMachContract.h)0
-rw-r--r--src/CommandLine/cppdrv.json1
-rw-r--r--src/CompilerKit/src/Linkers/DynamicLinker64+MachO.cpp79
-rw-r--r--src/CompilerKit/src/Preprocessors/Preprocessor+Generic.cpp24
-rw-r--r--src/DebuggerKit/dk-nk-osx.json (renamed from src/DebuggerKit/dk-nekernel.json)3
-rw-r--r--src/DebuggerKit/dk-nk-posix.json19
-rw-r--r--src/DebuggerKit/dk-osx.json4
l---------src/DebuggerKit/dk-posix.json1
-rw-r--r--src/DebuggerKit/src/MachContractCLI.cpp95
-rw-r--r--src/DebuggerKit/src/NeKernelContract.cpp5
-rw-r--r--src/DebuggerKit/src/NeKernelContractCLI.cpp3
-rw-r--r--src/DebuggerKit/src/POSIXMachContractCLI.cpp7
13 files changed, 145 insertions, 100 deletions
diff --git a/doc/cpp_style.md b/doc/cpp_style.md
index 67f9800..65f8f85 100644
--- a/doc/cpp_style.md
+++ b/doc/cpp_style.md
@@ -8,3 +8,7 @@ Nectar uses the Google C++ Style. But applied to low-level systems. We use C++20
Nectar doesn't limit itself to a C++ paradigm, as we may find fitting solutions by exploring other patterns.
+### References:
+
+- Google C++ Style.
+- Zero Overhead Abstraction.
diff --git a/include/DebuggerKit/POSIXMachContract.h b/include/DebuggerKit/MachContract.h
index 5ea201f..5ea201f 100644
--- a/include/DebuggerKit/POSIXMachContract.h
+++ b/include/DebuggerKit/MachContract.h
diff --git a/src/CommandLine/cppdrv.json b/src/CommandLine/cppdrv.json
index 7c8cbe2..ad9761b 100644
--- a/src/CommandLine/cppdrv.json
+++ b/src/CommandLine/cppdrv.json
@@ -7,6 +7,7 @@
"compiler_flags": ["-L/usr/local/lib", "-lCompilerKit"],
"cpp_macros": [
"__CPPDRV__=202504",
+ "__NECTAR__",
"kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)"
]
}
diff --git a/src/CompilerKit/src/Linkers/DynamicLinker64+MachO.cpp b/src/CompilerKit/src/Linkers/DynamicLinker64+MachO.cpp
index dcbd7e7..bb2ce3a 100644
--- a/src/CompilerKit/src/Linkers/DynamicLinker64+MachO.cpp
+++ b/src/CompilerKit/src/Linkers/DynamicLinker64+MachO.cpp
@@ -84,6 +84,7 @@ static CompilerKit::STLString macho_extract_symbol_name(const CompilerKit::STLSt
while (!name.empty() && (name.front() == ' ' || name.front() == '\t')) {
name.erase(0, 1);
}
+
while (!name.empty() && (name.back() == ' ' || name.back() == '\t')) {
name.pop_back();
}
@@ -101,9 +102,10 @@ static UInt32 macho_add_symbol(const CompilerKit::STLString& name, uint8_t type,
UInt32 strOffset = static_cast<UInt32>(kStringTable.size());
- for (Char c : name) {
+ for (const Char& c : name) {
kStringTable.push_back(c);
}
+
kStringTable.push_back('\0');
// Create nlist_64 entry
@@ -237,12 +239,9 @@ NECTAR_MODULE(DynamicLinker64MachO) {
hdr.fSize == sizeof(CompilerKit::AEHeader) && hdr.fMagic[2] == kAEMag2) {
std::size_t cnt = hdr.fCount;
- if (kVerbose) kConsoleOut << "header found, record count: " << cnt << "\n";
-
Char* raw_ae_records = new Char[cnt * sizeof(CompilerKit::AERecordHeader)];
if (!raw_ae_records) {
- if (kVerbose) kConsoleOut << "allocation failed for records of count: " << cnt << "\n";
return NECTAR_EXEC_ERROR;
}
@@ -274,11 +273,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
uint8_t symType = N_EXT | N_SECT;
macho_add_symbol(symbolName, symType, sectNum, ae_records[ae_record_index].fOffset);
-
- if (kVerbose) {
- kConsoleOut << "added symbol: " << symbolName
- << " at offset: " << ae_records[ae_record_index].fOffset << "\n";
- }
}
sections.push_back(section);
@@ -286,17 +280,14 @@ NECTAR_MODULE(DynamicLinker64MachO) {
// Look up entry point from symbol table
auto entryIt = kSymbolOffsets.find(kLinkerStart);
+
if (entryIt != kSymbolOffsets.end()) {
entryCommand.entryoff = entryIt->second;
kStartFound = true;
-
- if (kVerbose) {
- kConsoleOut << "found entry point " << kLinkerStart << " at offset: " << entryIt->second
- << "\n";
- }
}
delete[] raw_ae_records;
+ raw_ae_records = nullptr;
// Read the actual code bytes
std::vector<Char> bytes;
@@ -344,9 +335,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
std::ofstream output_fc(kOutput, std::ofstream::binary);
if (output_fc.bad()) {
- if (kVerbose) {
- kConsoleOut << "error: " << strerror(errno) << "\n";
- }
return NECTAR_FILE_NOT_FOUND;
}
@@ -416,10 +404,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&header), sizeof(header));
- if (kVerbose) {
- kConsoleOut << "Wrote Mach-O header, ncmds: " << numCommands << "\n";
- }
-
segment_command_64 pageZeroSegment{};
pageZeroSegment.cmd = LC_SEGMENT_64;
pageZeroSegment.cmdsize = sizeof(segment_command_64);
@@ -444,10 +428,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&build), sizeof(build));
- if (kVerbose) {
- kConsoleOut << "Wrote LC_BUILD_VERSION, platform: macOS, minos: 11.0, sdk: 11.0\n";
- }
-
// Write __TEXT segment command
segment_command_64 textSegment{};
textSegment.cmd = LC_SEGMENT_64;
@@ -482,11 +462,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&textSection), sizeof(textSection));
- if (kVerbose) {
- kConsoleOut << "Wrote __TEXT segment, vmaddr: 0x" << std::hex << textVMAddr << std::dec << "\n";
- kConsoleOut << " __text section, size: " << textSize << " bytes\n";
- }
-
// Write __DATA segment command
segment_command_64 dataSegment{};
dataSegment.cmd = LC_SEGMENT_64;
@@ -522,11 +497,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
if (dataSegCmdSize > 0)
output_fc.write(reinterpret_cast<const Char*>(&dataSection), sizeof(dataSection));
- if (kVerbose) {
- kConsoleOut << "Wrote __DATA segment, vmaddr: 0x" << std::hex << dataVMAddr << std::dec << "\n";
- kConsoleOut << " __data section, size: " << dataSize << " bytes\n";
- }
-
// Write __LINKEDIT segment command (contains symbol/string tables)
segment_command_64 linkeditSegment{};
linkeditSegment.cmd = LC_SEGMENT_64;
@@ -543,12 +513,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&linkeditSegment), sizeof(linkeditSegment));
- if (kVerbose) {
- kConsoleOut << "Wrote __LINKEDIT segment, vmaddr: 0x" << std::hex << linkeditVMAddr << std::dec
- << ", fileoff: " << linkeditFileOffset << ", filesize: " << linkeditFileSize
- << "\n";
- }
-
// Write LC_LOAD_DYLINKER command
constexpr Char* dyldPath = "/usr/lib/dyld";
std::vector<Char> dylinkerCmd(dylinkerCmdSize, 0);
@@ -560,10 +524,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(dylinkerCmd.data(), dylinkerCmd.size());
- if (kVerbose) {
- kConsoleOut << "Wrote LC_LOAD_DYLINKER: " << dyldPath << "\n";
- }
-
// Write LC_MAIN entry point command (executables only)
if (!kIsDylib) {
entryCommand.cmd = LC_MAIN;
@@ -572,11 +532,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
entryCommand.entryoff = textFileOffset + entryCommand.entryoff;
output_fc.write(reinterpret_cast<const Char*>(&entryCommand), sizeof(entryCommand));
-
- if (kVerbose) {
- kConsoleOut << "Wrote LC_MAIN, entryoff: 0x" << std::hex << entryCommand.entryoff << std::dec
- << ", stacksize: " << entryCommand.stacksize << "\n";
- }
}
// Write LC_UUID command
@@ -594,10 +549,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&uuidCmd), sizeof(uuidCmd));
- if (kVerbose) {
- kConsoleOut << "Wrote LC_UUID\n";
- }
-
// Write LC_SYMTAB command
symtab_command symtabCmd{};
symtabCmd.cmd = LC_SYMTAB;
@@ -609,11 +560,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&symtabCmd), sizeof(symtabCmd));
- if (kVerbose) {
- kConsoleOut << "Wrote LC_SYMTAB, nsyms: " << symtabCmd.nsyms
- << ", strsize: " << symtabCmd.strsize << "\n";
- }
-
// Write LC_DYSYMTAB command
dysymtab_command dysymtabCmd{};
std::memset(&dysymtabCmd, 0, sizeof(dysymtabCmd));
@@ -634,10 +580,6 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&dysymtabCmd), sizeof(dysymtabCmd));
- if (kVerbose) {
- kConsoleOut << "Wrote LC_DYSYMTAB\n";
- }
-
// Pad to text section offset
UInt64 currentPos = output_fc.tellp();
UInt64 padding = textFileOffset - currentPos;
@@ -680,23 +622,12 @@ NECTAR_MODULE(DynamicLinker64MachO) {
output_fc.write(reinterpret_cast<const Char*>(&sym), sizeof(nlist_64));
}
- if (kVerbose) {
- kConsoleOut << "Wrote symbol table, " << kSymbolTable.size() << " entries\n";
- }
// Write string table
output_fc.write(kStringTable.data(), kStringTable.size());
- if (kVerbose) {
- kConsoleOut << "Wrote string table, " << kStringTable.size() << " bytes\n";
- }
-
output_fc.flush();
- if (kVerbose) {
- kConsoleOut << "Wrote Mach-O binary: " << kOutput << "\n";
- }
-
return NECTAR_SUCCESS;
}
diff --git a/src/CompilerKit/src/Preprocessors/Preprocessor+Generic.cpp b/src/CompilerKit/src/Preprocessors/Preprocessor+Generic.cpp
index 1ac94e8..fd7cd74 100644
--- a/src/CompilerKit/src/Preprocessors/Preprocessor+Generic.cpp
+++ b/src/CompilerKit/src/Preprocessors/Preprocessor+Generic.cpp
@@ -258,7 +258,7 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
if (inactive_code) {
if (hdr_line.find("#endif") == CompilerKit::STLString::npos) {
continue;
- } else if (hdr_line[0] == kMacroPrefix &&
+ } else if (hdr_line[0] == '#' &&
hdr_line.find("#endif") != CompilerKit::STLString::npos) {
inactive_code = false;
}
@@ -275,7 +275,7 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
hdr_line.erase(hdr_line.find("/*"));
}
- if (hdr_line[0] == kMacroPrefix && hdr_line.find("endif") != CompilerKit::STLString::npos) {
+ if (hdr_line[0] == '#' && hdr_line.find("endif") != CompilerKit::STLString::npos) {
if (!defined && inactive_code) {
inactive_code = false;
defined = false;
@@ -361,11 +361,11 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
}
}
- if (hdr_line[0] == kMacroPrefix && hdr_line.find("define ") != CompilerKit::STLString::npos) {
- auto define_pos = hdr_line.find("define ");
+ if (hdr_line[0] == '#' && hdr_line.find("define") != CompilerKit::STLString::npos) {
+ auto define_pos = hdr_line.find("define");
if (define_pos == CompilerKit::STLString::npos) continue;
- auto line_after_define = hdr_line.substr(define_pos + strlen("define "));
+ auto line_after_define = hdr_line.substr(define_pos + strlen("define"));
CompilerKit::STLString macro_value;
CompilerKit::STLString macro_key;
@@ -490,7 +490,7 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
continue;
}
- } else if (hdr_line[0] == kMacroPrefix &&
+ } else if (hdr_line[0] == '#' &&
hdr_line.find("else") != CompilerKit::STLString::npos) {
if (!defined && inactive_code) {
inactive_code = false;
@@ -503,7 +503,7 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
continue;
}
- } else if (hdr_line[0] == kMacroPrefix &&
+ } else if (hdr_line[0] == '#' &&
hdr_line.find("ifdef") != CompilerKit::STLString::npos) {
auto ifdef_pos = hdr_line.find("ifdef");
if (ifdef_pos == CompilerKit::STLString::npos) continue;
@@ -544,7 +544,7 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
break;
}
}
- } else if (hdr_line[0] == kMacroPrefix &&
+ } else if (hdr_line[0] == '#' &&
hdr_line.find("if") != CompilerKit::STLString::npos) {
inactive_code = true;
@@ -629,7 +629,7 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
break;
}
}
- } else if (hdr_line[0] == kMacroPrefix &&
+ } else if (hdr_line[0] == '#' &&
hdr_line.find("warning") != CompilerKit::STLString::npos) {
auto warning_pos = hdr_line.find("warning");
if (warning_pos == CompilerKit::STLString::npos) continue;
@@ -645,8 +645,8 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
message += ch;
}
- std::cout << "warn: " << message << std::endl;
- } else if (hdr_line[0] == kMacroPrefix &&
+ std::cerr << "warn: " << message << std::endl;
+ } else if (hdr_line[0] == '#' &&
hdr_line.find("error") != CompilerKit::STLString::npos) {
auto error_pos = hdr_line.find("error");
if (error_pos == CompilerKit::STLString::npos) continue;
@@ -663,7 +663,7 @@ void pp_parse_file(std::ifstream& hdr_file, std::ofstream& pp_out) {
}
throw std::runtime_error("error: " + message);
- } else if (hdr_line[0] == kMacroPrefix &&
+ } else if (hdr_line[0] == '#' &&
hdr_line.find("include ") != CompilerKit::STLString::npos) {
auto include_pos = hdr_line.find("include ");
if (include_pos == CompilerKit::STLString::npos) continue;
diff --git a/src/DebuggerKit/dk-nekernel.json b/src/DebuggerKit/dk-nk-osx.json
index 4ada191..a5ff85e 100644
--- a/src/DebuggerKit/dk-nekernel.json
+++ b/src/DebuggerKit/dk-nk-osx.json
@@ -11,7 +11,8 @@
"cpp_macros": [
"__NECTAR__=202505",
"DK_USE_STRUCTS=1",
- "DK_NEKERNEL_DEBUGGER",
+ "DK_NEKERNEL_DEBUGGER=1",
+ "DEBUGGERKIT_LIBSYSTEM=1",
"kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)"
]
}
diff --git a/src/DebuggerKit/dk-nk-posix.json b/src/DebuggerKit/dk-nk-posix.json
new file mode 100644
index 0000000..8c87769
--- /dev/null
+++ b/src/DebuggerKit/dk-nk-posix.json
@@ -0,0 +1,19 @@
+{
+ "compiler_path": "clang++",
+ "compiler_std": "c++20",
+ "headers_path": [
+ "../../include/DebuggerKit",
+ "../../include"
+ ],
+ "sources_path": ["src/*.cpp"],
+ "output_name": "/usr/lib/libDebuggerKit.so",
+ "compiler_flags": ["-fPIC", "-shared"],
+ "cpp_macros": [
+ "__NECTAR__=202505",
+ "DK_USE_STRUCTS=1",
+ "DK_NEKERNEL_DEBUGGER=1",
+ "DEBUGGERKIT_LIBSYSTEM=1",
+ "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)"
+ ]
+}
+
diff --git a/src/DebuggerKit/dk-osx.json b/src/DebuggerKit/dk-osx.json
index f97f758..c605efc 100644
--- a/src/DebuggerKit/dk-osx.json
+++ b/src/DebuggerKit/dk-osx.json
@@ -11,8 +11,8 @@
"cpp_macros": [
"__NECTAR__=202505",
"CK_USE_STRUCTS=1",
- "DEBUGGERKIT_POSIX",
- "DK_MACH_DEBUGGER",
+ "DEBUGGERKIT_POSIX=1",
+ "DK_MACH_DEBUGGER=1",
"kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)"
]
}
diff --git a/src/DebuggerKit/dk-posix.json b/src/DebuggerKit/dk-posix.json
deleted file mode 120000
index 2a8c729..0000000
--- a/src/DebuggerKit/dk-posix.json
+++ /dev/null
@@ -1 +0,0 @@
-dk-osx.json \ No newline at end of file
diff --git a/src/DebuggerKit/src/MachContractCLI.cpp b/src/DebuggerKit/src/MachContractCLI.cpp
new file mode 100644
index 0000000..4d0c4e8
--- /dev/null
+++ b/src/DebuggerKit/src/MachContractCLI.cpp
@@ -0,0 +1,95 @@
+// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
+// Licensed under the Apache License, Version 2.0 (See accompanying
+// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/nekernel-org/nectar
+
+#ifdef DK_MACH_DEBUGGER
+
+#include <DebuggerKit/POSIXMachContract.h>
+#include <ThirdParty/Dialogs/Dialogs.h>
+
+#ifdef DK_MACH_DEBUGGER
+#include <DebuggerKit/Common.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;
+}
+
+NECTAR_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
+
+#endif
diff --git a/src/DebuggerKit/src/NeKernelContract.cpp b/src/DebuggerKit/src/NeKernelContract.cpp
index f39ba0d..f662401 100644
--- a/src/DebuggerKit/src/NeKernelContract.cpp
+++ b/src/DebuggerKit/src/NeKernelContract.cpp
@@ -1,4 +1,4 @@
-// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (See accompanying
// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0)
// Official repository: https://github.com/nekernel-org/nectar
@@ -8,8 +8,6 @@
/// @author Amlal El Mahrouss
/// @brief Kernel Debugger Protocol
-#include <CompilerKit/Detail/Config.h>
-#include <DebuggerKit/Detail/Config.h>
#include <DebuggerKit/NeKernelContract.h>
#include <ThirdParty/Dialogs/Dialogs.h>
@@ -17,7 +15,6 @@ using namespace DebuggerKit::Detail;
using namespace DebuggerKit::NeKernel;
NeKernelContract::NeKernelContract() = default;
-
NeKernelContract::~NeKernelContract() = default;
bool NeKernelContract::Attach(CompilerKit::STLString path, CompilerKit::STLString argv,
diff --git a/src/DebuggerKit/src/NeKernelContractCLI.cpp b/src/DebuggerKit/src/NeKernelContractCLI.cpp
index e1b6a27..b5e07a2 100644
--- a/src/DebuggerKit/src/NeKernelContractCLI.cpp
+++ b/src/DebuggerKit/src/NeKernelContractCLI.cpp
@@ -1,11 +1,10 @@
-// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (See accompanying
// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0)
// Official repository: https://github.com/nekernel-org/nectar
#ifdef DK_NEKERNEL_DEBUGGER
-#include <CompilerKit/Detail/Config.h>
#include <DebuggerKit/NeKernelContract.h>
#include <ThirdParty/Dialogs/Dialogs.h>
#include <string>
diff --git a/src/DebuggerKit/src/POSIXMachContractCLI.cpp b/src/DebuggerKit/src/POSIXMachContractCLI.cpp
index dd1411c..da90a1f 100644
--- a/src/DebuggerKit/src/POSIXMachContractCLI.cpp
+++ b/src/DebuggerKit/src/POSIXMachContractCLI.cpp
@@ -1,12 +1,11 @@
-// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (See accompanying
// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0)
// Official repository: https://github.com/nekernel-org/nectar
#ifdef DK_MACH_DEBUGGER
-#include <CompilerKit/Detail/Config.h>
-#include <DebuggerKit/POSIXMachContract.h>
+#include <DebuggerKit/MachContract.h>
#include <ThirdParty/Dialogs/Dialogs.h>
#ifdef DK_MACH_DEBUGGER
@@ -14,7 +13,7 @@
/// @internal
/// @brief Handles CTRL-C signal on debugger.
-static void dbgi_ctrlc_handler(std::int32_t _) {
+static Void dbgi_ctrlc_handler(std::int32_t _) {
if (!kPID) {
return;
}