diff --git a/system/utest/debugger/debugger.cpp b/system/utest/debugger/debugger.cpp index d4b0d356e3af262a26b5111cb356bef4b0052c5e..d5ae3704df7f00d8a68574231abe8e07085ce312 100644 --- a/system/utest/debugger/debugger.cpp +++ b/system/utest/debugger/debugger.cpp @@ -204,7 +204,7 @@ bool expect_debugger_attached_eq(zx_handle_t inferior, bool expected, const char // This returns a bool as it's a unittest "helper" routine. // N.B. This runs on the wait-inferior thread. -bool handle_thread_exiting(zx_handle_t inferior, const zx_port_packet_t* packet) { +bool handle_thread_exiting(zx_handle_t inferior, zx_handle_t port, const zx_port_packet_t* packet) { BEGIN_HELPER; zx_koid_t tid = packet->exception.tid; @@ -235,7 +235,7 @@ bool handle_thread_exiting(zx_handle_t inferior, const zx_port_packet_t* packet) } unittest_printf("wait-inf: thread %" PRId64 " exited\n", tid); // A thread is gone, but we only care about the process. - if (!resume_inferior(inferior, tid)) + if (!resume_inferior(inferior, port, tid)) return false; END_HELPER; @@ -305,14 +305,14 @@ bool debugger_test_exception_handler(zx_handle_t inferior, zx_handle_t port, switch (packet->type) { case ZX_EXCP_THREAD_STARTING: unittest_printf("wait-inf: inferior started\n"); - if (!resume_inferior(inferior, tid)) + if (!resume_inferior(inferior, port, tid)) return false; break; case ZX_EXCP_THREAD_EXITING: // N.B. We could get thread exiting messages from previous // tests. - EXPECT_TRUE(handle_thread_exiting(inferior, packet)); + EXPECT_TRUE(handle_thread_exiting(inferior, port, packet)); break; case ZX_EXCP_FATAL_PAGE_FAULT: @@ -929,7 +929,7 @@ bool suspended_in_exception_handler(zx_handle_t inferior, zx_handle_t port, case ZX_EXCP_THREAD_EXITING: // N.B. We could get thread exiting messages from previous // tests. - EXPECT_TRUE(handle_thread_exiting(inferior, packet)); + EXPECT_TRUE(handle_thread_exiting(inferior, port, packet)); break; case ZX_EXCP_FATAL_PAGE_FAULT: { diff --git a/system/utest/debugger/utils.cpp b/system/utest/debugger/utils.cpp index 36319d8646cad9c0464d19433eeb87ef53fb9190..dc4a4056d6df40ba7c2df0fac18f447fe34836c7 100644 --- a/system/utest/debugger/utils.cpp +++ b/system/utest/debugger/utils.cpp @@ -349,7 +349,7 @@ bool get_inferior_thread_handle(zx_handle_t channel, zx_handle_t* thread) { END_HELPER; } -bool resume_inferior(zx_handle_t inferior, zx_koid_t tid) { +bool resume_inferior(zx_handle_t inferior, zx_handle_t port, zx_koid_t tid) { BEGIN_HELPER; zx_handle_t thread; @@ -363,7 +363,7 @@ bool resume_inferior(zx_handle_t inferior, zx_koid_t tid) { ASSERT_EQ(status, ZX_OK, "zx_object_get_child failed"); unittest_printf("Resuming inferior ...\n"); - status = zx_task_resume(thread, ZX_RESUME_EXCEPTION); + status = zx_task_resume_from_exception(thread, port, 0); if (status == ZX_ERR_BAD_STATE) { // If the process has exited then the thread may have exited // ExceptionHandlerExchange already. Check. @@ -373,7 +373,7 @@ bool resume_inferior(zx_handle_t inferior, zx_koid_t tid) { } } tu_handle_close(thread); - ASSERT_EQ(status, ZX_OK, "zx_task_resume failed"); + ASSERT_EQ(status, ZX_OK, "zx_task_resume_from_exception failed"); END_HELPER; } @@ -448,7 +448,7 @@ bool wait_thread_suspended(zx_handle_t proc, zx_handle_t thread, zx_handle_t epo zx_object_get_child(proc, report_tid, ZX_RIGHT_SAME_RIGHTS, &other_thread); if (status == ZX_OK) { // And even if it's not gone it may be dead now. - status = zx_task_resume(other_thread, ZX_RESUME_EXCEPTION); + status = zx_task_resume_from_exception(other_thread, eport, 0); if (status == ZX_ERR_BAD_STATE) ASSERT_TRUE(tu_thread_is_dying_or_dead(other_thread)); else diff --git a/system/utest/debugger/utils.h b/system/utest/debugger/utils.h index d74a93f90eb99b1e433c2be256ff010d1b9d5a03..6bd562b6542d4751987f71a5d59a730e32a34dee 100644 --- a/system/utest/debugger/utils.h +++ b/system/utest/debugger/utils.h @@ -88,7 +88,7 @@ extern bool verify_inferior_running(zx_handle_t channel); extern bool get_inferior_thread_handle(zx_handle_t channel, zx_handle_t* thread); -extern bool resume_inferior(zx_handle_t inferior, zx_koid_t tid); +extern bool resume_inferior(zx_handle_t inferior, zx_handle_t port, zx_koid_t tid); extern bool shutdown_inferior(zx_handle_t channel, zx_handle_t inferior);