summaryrefslogtreecommitdiff
path: root/src/user/lib/include
diff options
context:
space:
mode:
authordzwdz2023-06-17 17:53:23 +0200
committerdzwdz2023-06-17 17:53:23 +0200
commit657585026a375d2cb2d06ab400f9deb487d89a17 (patch)
treef777a03d136405128d1ea5b947101d863f3e81de /src/user/lib/include
parent84fa0102c6906252999967925f32098ab6d5a259 (diff)
libc: expand psdata into a proper struct, include executable base
this is very useful for debugging userland programs using the qemu gdb stub
Diffstat (limited to 'src/user/lib/include')
-rw-r--r--src/user/lib/include/_proc.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/user/lib/include/_proc.h b/src/user/lib/include/_proc.h
index c8fd70b..5f9c321 100644
--- a/src/user/lib/include/_proc.h
+++ b/src/user/lib/include/_proc.h
@@ -1,7 +1,14 @@
#pragma once
-/* That page contains a null-terminated string that describes the process
- * for tools such as ps. It's first allocated in the bootstrap process, and
- * then it's freed on every exec() - just to be immediately reallocated by
- * _start2(). */
-static char *const _libc_psdata = (void*)0x10000;
+struct _psdata {
+ /* Description of the process, see setprogname.
+ * Assumed to be null terminated. */
+ char desc[1024];
+
+ /* Base offset where the executable was loaded. */
+ void *base;
+};
+
+/* First allocated in bootstrap.
+ * Freed on every exec(), just to be immediately reallocated by _start2(). */
+static struct _psdata *const _psdata_loc = (void*)0x10000;