summaryrefslogtreecommitdiffstats
path: root/debugger.h
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2024-05-04 07:32:18 -0400
committerMalfurious <m@lfurio.us>2024-05-08 05:57:59 -0400
commit47cf13e8429e813aa2fd2b1f41f87722bc616d19 (patch)
tree9c994ceef54c8141fa40d6924be88160c7c8e19d /debugger.h
parentd187dfc3c81d987ef851b3806fc0ba372c8a3348 (diff)
downloadmisplays-47cf13e8429e813aa2fd2b1f41f87722bc616d19.tar.gz
misplays-47cf13e8429e813aa2fd2b1f41f87722bc616d19.zip
Parameterize architecture-specific details
Abstract architecture details into architecture.h and add x86 constants. This is slightly complicated by the fact that 64-bit hosts can run 32-bit code, so we do still need to resolve some values dynamically. The architecture_info() function is intented to address this, and performs parameter lookups based on the current state of the guest process. Resolving values on a per-process-state basis is important due to the process model under Linux. If we fork to debug a 32-bit program, the forked process will be native 64-bit until the execve system call. And of course, the process is then free to exec anything it likes later on as well. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'debugger.h')
-rw-r--r--debugger.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/debugger.h b/debugger.h
index f14459f..b26adf8 100644
--- a/debugger.h
+++ b/debugger.h
@@ -1,8 +1,8 @@
#pragma once
-#include <sys/user.h>
#include <unistd.h>
+#include "architecture.h"
#include "list.h"
struct breakpoint {
@@ -29,7 +29,8 @@ struct map {
struct state {
LINKEDLIST;
- struct user_regs_struct regs;
+ size_t regsize;
+ user_regs_t regs;
struct list maps;
};