Commit b1de6baa authored by Brett Wilson's avatar Brett Wilson Committed by Commit Bot

Implement BeingDebugged() on Fuchsia.

This information is supplied by a straightforward system call.

Change-Id: Ic035732ecee94d1ca04d384dc223d6d3987bb91d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037821
Commit-Queue: Brett Wilson <brettw@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738630}
parent 775a3cd0
...@@ -39,6 +39,11 @@ ...@@ -39,6 +39,11 @@
#include <sys/user.h> #include <sys/user.h>
#endif #endif
#if defined(OS_FUCHSIA)
#include <zircon/process.h>
#include <zircon/syscalls.h>
#endif
#include <ostream> #include <ostream>
#include "base/debug/alias.h" #include "base/debug/alias.h"
...@@ -230,8 +235,12 @@ void VerifyDebugger() { ...@@ -230,8 +235,12 @@ void VerifyDebugger() {
#elif defined(OS_FUCHSIA) #elif defined(OS_FUCHSIA)
bool BeingDebugged() { bool BeingDebugged() {
// TODO(fuchsia): No gdb/gdbserver in the SDK yet. zx_info_process_t info = {};
return false; // Ignore failures. The 0-initialization above will result in "false" for
// error cases.
zx_object_get_info(zx_process_self(), ZX_INFO_PROCESS, &info, sizeof(info),
nullptr, nullptr);
return info.debugger_attached;
} }
void VerifyDebugger() {} void VerifyDebugger() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment