adding gdb utils
This commit is contained in:
17
build.zig
17
build.zig
@@ -94,18 +94,25 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const c_test_exe_install = b.addInstallArtifact(c_test_exe, .{});
|
const c_test_exe_install = b.addInstallArtifact(c_test_exe, .{});
|
||||||
|
c_test_exe_install.step.dependOn(&lib_install.step);
|
||||||
|
|
||||||
try targets.append(b.allocator, lib);
|
try targets.append(b.allocator, lib);
|
||||||
try targets.append(b.allocator, c_test_exe);
|
try targets.append(b.allocator, c_test_exe);
|
||||||
|
|
||||||
_ = zcc.createStep(b, "cdb", try targets.toOwnedSlice(b.allocator));
|
_ = zcc.createStep(b, "cdb", try targets.toOwnedSlice(b.allocator));
|
||||||
|
|
||||||
const run_c_test = b.addRunArtifact(c_test_exe);
|
const run_c_test_exe = b.addRunArtifact(c_test_exe);
|
||||||
run_c_test.step.dependOn(&lib_install.step);
|
run_c_test_exe.step.dependOn(&c_test_exe_install.step);
|
||||||
run_c_test.step.dependOn(&c_test_exe_install.step);
|
|
||||||
|
|
||||||
const test_c_step = b.step(b.fmt("test-c-{s}", .{impl.name}), b.fmt("Run lib{s} C test", .{impl.name}));
|
const run_c_test_step = b.step(b.fmt("test-c-{s}", .{impl.name}), b.fmt("Run lib{s} C test", .{impl.name}));
|
||||||
test_c_step.dependOn(&run_c_test.step);
|
run_c_test_step.dependOn(&run_c_test_exe.step);
|
||||||
|
|
||||||
|
const run_c_test_gdb_exe = b.addRunArtifact(c_test_exe);
|
||||||
|
try run_c_test_gdb_exe.argv.insert(b.allocator, 0, .{ .bytes = b.fmt("gdb", .{}) }); // Hacky
|
||||||
|
run_c_test_gdb_exe.step.dependOn(&c_test_exe_install.step);
|
||||||
|
|
||||||
|
const run_c_test_gdb_step = b.step(b.fmt("test-c-{s}-gdb", .{impl.name}), b.fmt("Run lib{s} C test within gdb", .{impl.name}));
|
||||||
|
run_c_test_gdb_step.dependOn(&run_c_test_gdb_exe.step);
|
||||||
}
|
}
|
||||||
|
|
||||||
const autodoc_test = b.addObject(.{
|
const autodoc_test = b.addObject(.{
|
||||||
|
|||||||
@@ -25,6 +25,5 @@ pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.Comma
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub inline fn destroy(self: *Self, allocator: std.mem.Allocator) void {
|
pub inline fn destroy(self: *Self, allocator: std.mem.Allocator) void {
|
||||||
std.debug.print("{any}\n", .{self});
|
|
||||||
self.vtable.destroy(self, allocator);
|
self.vtable.destroy(self, allocator);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.Comma
|
|||||||
pub fn allocateCommandBuffers(self: *Self, info: *const vk.CommandBufferAllocateInfo) VkError![]*NonDispatchable(CommandBuffer) {
|
pub fn allocateCommandBuffers(self: *Self, info: *const vk.CommandBufferAllocateInfo) VkError![]*NonDispatchable(CommandBuffer) {
|
||||||
const allocator = self.host_allocator.allocator();
|
const allocator = self.host_allocator.allocator();
|
||||||
|
|
||||||
if (self.buffers.items.len < info.command_buffer_count or self.first_free_buffer_index + info.command_buffer_count > self.buffers.items.len) {
|
if (self.buffers.items.len < self.first_free_buffer_index + info.command_buffer_count) {
|
||||||
while (self.buffers.capacity < self.buffers.items.len + info.command_buffer_count) {
|
while (self.buffers.capacity < self.buffers.items.len + info.command_buffer_count) {
|
||||||
self.buffers.ensureUnusedCapacity(allocator, BUFFER_POOL_BASE_CAPACITY) catch return VkError.OutOfHostMemory;
|
self.buffers.ensureUnusedCapacity(allocator, BUFFER_POOL_BASE_CAPACITY) catch return VkError.OutOfHostMemory;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user