chore: remove unnecesary gdb.zig file

This commit is contained in:
Rekai Nyangadzayi Musuka 2024-01-12 11:21:14 -06:00
parent 117a95d3a9
commit 62db837442
3 changed files with 70 additions and 92 deletions

@ -1 +1 @@
Subproject commit 580e7baca962dd73815bb4717db05b83d55fd58e
Subproject commit bdc4bfc6423f173e28d1ee8a4608d0d90e1da3f3

View File

@ -452,8 +452,8 @@ pub const debug = struct {
;
};
// FIXME: for now, assume ARM7
pub const Wrapper = struct {
pub fn Wrapper(comptime proc: System.Process) type {
return struct {
system: System,
scheduler: *Scheduler,
@ -465,21 +465,40 @@ pub const debug = struct {
return Interface.init(allocator, self);
}
// FIXME: What about ICTM? DTCM?
pub fn read(self: *const @This(), addr: u32) u8 {
return self.system.bus7.dbgRead(u8, addr);
const arm = switch (proc) {
.nds7 => self.system.arm7tdmi,
.nds9 => self.system.arm946es,
};
return arm.dbgRead(u8, addr);
}
pub fn write(self: *@This(), addr: u32, value: u8) void {
self.system.bus7.dbgWrite(u8, addr, value);
const arm = switch (proc) {
.nds7 => self.system.arm7tdmi,
.nds9 => self.system.arm946es,
};
return arm.dbgWrite(u8, addr, value);
}
pub fn registers(self: *const @This()) *[16]u32 {
return &self.system.arm7tdmi.r;
const arm = switch (proc) {
.nds7 => self.system.arm7tdmi,
.nds9 => self.system.arm946es,
};
return &arm.r;
}
pub fn cpsr(self: *const @This()) u32 {
return self.system.arm7tdmi.cpsr.raw;
const arm = switch (proc) {
.nds7 => self.system.arm7tdmi,
.nds9 => self.system.arm946es,
};
return arm.cpsr.raw;
}
pub fn step(self: *@This()) void {
@ -514,9 +533,10 @@ pub const debug = struct {
}
}
};
}
pub fn run(allocator: Allocator, system: System, scheduler: *Scheduler, should_quit: *AtomicBool) !void {
var wrapper = Wrapper.init(system, scheduler);
var wrapper = Wrapper(.nds7).init(system, scheduler);
var emu_interface = wrapper.interface(allocator);
defer emu_interface.deinit();

View File

@ -1,42 +0,0 @@
const std = @import("std");
const Server = @import("gdbstub").Server;
const Interface = @import("gdbstub").Emulator;
const System = @import("core/emu.zig").System;
const Scheduler = @import("core/Scheduler.zig");
const Allocator = std.mem.Allocator;
pub const TurboWrapper = struct {
system: System,
scheduler: *Scheduler,
pub fn init(system: System, scheduler: *Scheduler) @This() {
return .{ .system = system, .scheduler = scheduler };
}
pub fn interface(self: *@This(), allocator: Allocator) Interface {
return Interface.init(allocator, self);
}
pub fn read(self: *const @This(), addr: u32) u8 {
return self.cpu.bus.dbgRead(u8, addr);
}
pub fn write(self: *@This(), addr: u32, value: u8) void {
self.cpu.bus.dbgWrite(u8, addr, value);
}
pub fn registers(self: *const @This()) *[16]u32 {
return &self.cpu.r;
}
pub fn cpsr(self: *const @This()) u32 {
return self.cpu.cpsr.raw;
}
pub fn step(self: *@This()) void {
_ = self;
@panic("TODO: Handle ARM7 and ARM9 lol");
}
};