summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/UserspaceEmulator/Emulator.cpp1
-rw-r--r--DevTools/UserspaceEmulator/MmapRegion.h1
-rw-r--r--DevTools/UserspaceEmulator/SoftMMU.h6
3 files changed, 8 insertions, 0 deletions
diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp
index fac2bf92b6..f7006504f6 100644
--- a/DevTools/UserspaceEmulator/Emulator.cpp
+++ b/DevTools/UserspaceEmulator/Emulator.cpp
@@ -75,6 +75,7 @@ Emulator::Emulator(const Vector<String>& arguments, NonnullRefPtr<ELF::Loader> e
void Emulator::setup_stack(const Vector<String>& arguments)
{
auto stack_region = make<SimpleRegion>(stack_location, stack_size);
+ stack_region->set_stack(true);
m_mmu.add_region(move(stack_region));
m_cpu.set_esp(stack_location + stack_size);
diff --git a/DevTools/UserspaceEmulator/MmapRegion.h b/DevTools/UserspaceEmulator/MmapRegion.h
index d169e1746d..57c02ed73d 100644
--- a/DevTools/UserspaceEmulator/MmapRegion.h
+++ b/DevTools/UserspaceEmulator/MmapRegion.h
@@ -55,6 +55,7 @@ public:
private:
MmapRegion(u32 base, u32 size, int prot);
+ virtual bool is_mmap() const override { return true; }
u8* m_data { nullptr };
int m_prot { 0 };
diff --git a/DevTools/UserspaceEmulator/SoftMMU.h b/DevTools/UserspaceEmulator/SoftMMU.h
index 5d154c4b30..049796158b 100644
--- a/DevTools/UserspaceEmulator/SoftMMU.h
+++ b/DevTools/UserspaceEmulator/SoftMMU.h
@@ -58,6 +58,10 @@ public:
virtual u8* cacheable_ptr([[maybe_unused]] u32 offset) { return nullptr; }
virtual bool is_shared_buffer() const { return false; }
+ virtual bool is_mmap() const { return false; }
+
+ bool is_stack() const { return m_stack; }
+ void set_stack(bool b) { m_stack = b; }
protected:
Region(u32 base, u32 size)
@@ -69,6 +73,8 @@ public:
private:
u32 m_base { 0 };
u32 m_size { 0 };
+
+ bool m_stack { false };
};
u8 read8(X86::LogicalAddress);