From b402964841fa24370e4964a0f8f99e36aad365c0 Mon Sep 17 00:00:00 2001 From: dd86k Date: Mon, 30 Sep 2024 16:21:26 -0400 Subject: [PATCH] Fix tests --- src/adbg/debugger.d | 3 ++- src/adbg/process/thread.d | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/adbg/debugger.d b/src/adbg/debugger.d index db21c04..c5ac42a 100644 --- a/src/adbg/debugger.d +++ b/src/adbg/debugger.d @@ -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); @@ -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); } @@ -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); } diff --git a/src/adbg/process/thread.d b/src/adbg/process/thread.d index c382346..7a754af 100644 --- a/src/adbg/process/thread.d +++ b/src/adbg/process/thread.d @@ -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;