Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Sep 30, 2024
1 parent 6d5402d commit b402964
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/adbg/debugger.d
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ version (Windows) {
proc.status = options & OPT_STOP ? AdbgProcStatus.paused : AdbgProcStatus.running;
proc.pid = cast(pid_t)pid;
} else version (FreeBSD) {
version (Trace) if (options & OPT_STOP) trace("Sending break...");
if (ptrace(PT_ATTACH, pid, null, 0) < 0) {
adbg_oops(AdbgError.os);
adbg_process_free(proc);
Expand Down Expand Up @@ -741,6 +740,7 @@ version (Windows) {
switch (proc.status) with (AdbgProcStatus) {
case loaded, stopped:
if (ptrace(PT_CONT, proc.pid, null, null) < 0) {
version (Trace) trace("ptrace=%s", strerror(errno));
proc.status = AdbgProcStatus.unknown;
return adbg_oops(AdbgError.os);
}
Expand All @@ -755,6 +755,7 @@ version (Windows) {
// addr can be an address to resume at, or 1
// data can be a signal number, or 0
if (ptrace(PT_CONTINUE, proc.pid, cast(caddr_t)1, 0) < 0) {
version (Trace) trace("ptrace=%s", strerror(errno));
proc.status = AdbgProcStatus.unknown;
return adbg_oops(AdbgError.os);
}
Expand Down
3 changes: 2 additions & 1 deletion src/adbg/process/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,9 @@ int adbg_register_format(char *buffer, size_t len, adbg_register_t *reg, AdbgReg
return snprintf(buffer, len, sformat, n);
}
unittest {
static immutable adbg_register_info_t info = { "example", AdbgRegisterType.u16 };
adbg_register_t reg = void;
reg.info.type = AdbgRegisterType.u16;
reg.info = &info;
reg.u16 = 0x1234;
enum BUFSZ = 16;
char[BUFSZ] buffer = void;
Expand Down

0 comments on commit b402964

Please sign in to comment.