Compare commits
2 Commits
6d6a109a08
...
215e053b9a
Author | SHA1 | Date | |
---|---|---|---|
215e053b9a | |||
acb59994fc |
@@ -6,19 +6,14 @@ fn path(comptime suffix: []const u8) []const u8 {
|
||||
return comptime (std.fs.path.dirname(@src().file) orelse ".") ++ std.fs.path.sep_str ++ suffix;
|
||||
}
|
||||
|
||||
pub fn link(exe: *CompileStep) void {
|
||||
// create zig-network module
|
||||
const b = exe.builder;
|
||||
|
||||
pub fn getModule(b: *std.Build) *std.build.Module {
|
||||
// https://github.com/MasterQ32/zig-network
|
||||
const network = b.createModule(.{ .source_file = .{ .path = path("lib/zig-network/network.zig") } });
|
||||
|
||||
const gdbstub = b.createModule(.{
|
||||
return b.createModule(.{
|
||||
.source_file = .{ .path = path("src/lib.zig") },
|
||||
.dependencies = &.{.{ .name = "network", .module = network }},
|
||||
});
|
||||
|
||||
exe.addModule("gdbstub", gdbstub);
|
||||
}
|
||||
|
||||
pub fn build(b: *std.Build) void {
|
||||
|
Submodule lib/zig-network updated: a8c4502538...45ae8cf0ce
@@ -47,7 +47,7 @@ const SwBkpt = struct {
|
||||
}
|
||||
|
||||
pub fn remove(self: *@This(), addr: u32) void {
|
||||
for (self.list.items) |bkpt, i| {
|
||||
for (self.list.items, 0..) |bkpt, i| {
|
||||
if (bkpt.addr == addr) {
|
||||
_ = self.list.orderedRemove(i);
|
||||
log.debug("Removed Breakpoint at 0x{X:0>8}", .{addr});
|
||||
@@ -73,7 +73,7 @@ const HwBkpt = struct {
|
||||
}
|
||||
|
||||
pub fn add(self: *@This(), addr: u32, kind: u32) !void {
|
||||
for (self.list) |*bkpt_opt| {
|
||||
for (&self.list) |*bkpt_opt| {
|
||||
if (bkpt_opt.*) |bkpt| {
|
||||
if (bkpt.addr == addr) return; // idempotent
|
||||
} else {
|
||||
@@ -88,7 +88,7 @@ const HwBkpt = struct {
|
||||
}
|
||||
|
||||
pub fn remove(self: *@This(), addr: u32) void {
|
||||
for (self.list) |*bkpt_opt| {
|
||||
for (&self.list) |*bkpt_opt| {
|
||||
const bkpt = bkpt_opt.* orelse continue;
|
||||
|
||||
if (bkpt.addr == addr) {
|
||||
|
Reference in New Issue
Block a user