feat: add hardware breakpoints

This commit is contained in:
2023-01-26 20:44:55 -06:00
parent 4bca44e5f2
commit 59b6b51466
3 changed files with 124 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
const std = @import("std");
const network = @import("network");
const Packet = @import("Packet.zig");
const State = @import("State.zig");
const Socket = network.Socket;
const Allocator = std.mem.Allocator;
@@ -59,6 +60,7 @@ pkt_cache: ?[]const u8 = null,
client: Socket,
_socket: Socket,
state: State = .{},
emu: Emulator,
pub fn init(emulator: Emulator) !Self {
@@ -129,7 +131,7 @@ fn handlePacket(self: *Self, allocator: Allocator, input: []const u8) !Action {
var packet = Packet.from(allocator, input) catch return .nack;
defer packet.deinit(allocator);
var string = packet.parse(allocator, self.emu) catch return .nack;
var string = packet.parse(allocator, &self.state, self.emu) catch return .nack;
defer string.deinit(allocator);
const reply = string.inner();