summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-02 14:53:33 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-02 14:53:33 +0100
commit7d9fb7e4244d996f744233be046d9aa90afa8964 (patch)
treeeccd99f623291e4abe8bebb46936e035060eb6d8
parentfe6ba8bd1a59f48000e7cd04a5f7ae10592dc25b (diff)
chore: GL improvements of pstd, and DebuggerKit tweaks.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--include/DebuggerKit/Common.inl2
-rw-r--r--include/DebuggerKit/DebuggerContract.h4
-rw-r--r--include/DebuggerKit/NeKernelContract.h2
-rw-r--r--include/GenericsLibrary/pstd.nhh13
-rw-r--r--src/DebuggerKit/src/MachContract.cpp (renamed from src/DebuggerKit/src/POSIXMachContractCLI.cpp)8
-rw-r--r--src/DebuggerKit/src/MachContractCLI.cpp4
6 files changed, 24 insertions, 9 deletions
diff --git a/include/DebuggerKit/Common.inl b/include/DebuggerKit/Common.inl
index f09a9e2..de83015 100644
--- a/include/DebuggerKit/Common.inl
+++ b/include/DebuggerKit/Common.inl
@@ -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
diff --git a/include/DebuggerKit/DebuggerContract.h b/include/DebuggerKit/DebuggerContract.h
index ab808e8..971c80a 100644
--- a/include/DebuggerKit/DebuggerContract.h
+++ b/include/DebuggerKit/DebuggerContract.h
@@ -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
@@ -36,7 +36,7 @@ class IDebuggerContract {
using BreakpointMap = std::unordered_map<uintptr_t, uintptr_t>;
- virtual BreakpointMap& Get() { return mBreakpoints; }
+ virtual BreakpointMap& Leak() { return mBreakpoints; }
protected:
ProcessID mPid{(ProcessID) ~0};
diff --git a/include/DebuggerKit/NeKernelContract.h b/include/DebuggerKit/NeKernelContract.h
index 960e0c2..7b8df64 100644
--- a/include/DebuggerKit/NeKernelContract.h
+++ b/include/DebuggerKit/NeKernelContract.h
@@ -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
diff --git a/include/GenericsLibrary/pstd.nhh b/include/GenericsLibrary/pstd.nhh
index 5df5232..fd0b196 100644
--- a/include/GenericsLibrary/pstd.nhh
+++ b/include/GenericsLibrary/pstd.nhh
@@ -5,10 +5,21 @@
#pragma once
+#define PALLOC_INVALID 0
+
extern __nrt_palloc;
+extern __nrt_pfree;
-#define PALLOC_INVALID 0
+extern __nrt_pthread_new;
+extern __nrt_pthread_kill;
+
+//@ Parallel free
+let pfree(let ptr)
+{
+ return __nrt_pfree(ptr);
+}
+//@ Parallel alloc (bytes)
let palloc(let type, let sz, let align := 0)
{
return __nrt_palloc(type, sz, align);
diff --git a/src/DebuggerKit/src/POSIXMachContractCLI.cpp b/src/DebuggerKit/src/MachContract.cpp
index da90a1f..53553ac 100644
--- a/src/DebuggerKit/src/POSIXMachContractCLI.cpp
+++ b/src/DebuggerKit/src/MachContract.cpp
@@ -30,11 +30,15 @@ NECTAR_MODULE(DebuggerMachPOSIX) {
"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) {
+ constexpr auto kMaxArgs = 3;
+
+ if (argc >= kMaxArgs
+ && std::string(argv[1]) == "-p"
+ && argv[2] != nullptr) {
kPath = argv[2];
kUserDebugger.SetPath(kPath);
- kStdOut << "[+] Image set to: " << kPath << "\n";
+ kStdOut << "[+] Set image to: " << kPath << "\n";
} else {
kStdOut << "usage: " << argv[0] << " -p <path>\n";
kStdOut << "example: " << argv[0] << " -p </path/to/program>\n";
diff --git a/src/DebuggerKit/src/MachContractCLI.cpp b/src/DebuggerKit/src/MachContractCLI.cpp
index 4d0c4e8..63c5470 100644
--- a/src/DebuggerKit/src/MachContractCLI.cpp
+++ b/src/DebuggerKit/src/MachContractCLI.cpp
@@ -49,7 +49,8 @@ NECTAR_MODULE(DebuggerMachPOSIX) {
continue;
}
- std::string cmd;
+ CompilerKit::STLString cmd{};
+
if (!std::getline(std::cin, cmd)) break;
if (cmd == "c" || cmd == "cont" || cmd == "continue") {
@@ -57,7 +58,6 @@ NECTAR_MODULE(DebuggerMachPOSIX) {
kKeepRunning = true;
kStdOut << "[+] Continuing...\n";
-
pfd::notify("Debugger Event", "Continuing...");
}
}