Skip to content
Snippets Groups Projects
Commit 8808f6c1 authored by Josh Gao's avatar Josh Gao
Browse files

libdebuggerd: decode fdsan owner tags.

Test: debuggerd `pidof system_server` | grep " fd "
Change-Id: Ic4bb30b8602acf5912e776a61825d9645ec93c65
parent bf06a40a
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
#include "libdebuggerd/open_files_list.h"
#include <android/fdsan.h>
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
......@@ -122,8 +123,10 @@ void dump_open_files_list(log_t* log, const OpenFilesList& files, const char* pr
const std::optional<std::string>& path = entry.path;
const std::optional<uint64_t>& fdsan_owner = entry.fdsan_owner;
if (path && fdsan_owner) {
_LOG(log, logtype::OPEN_FILES, "%sfd %i: %s (owned by %#" PRIx64 ")\n", prefix, fd,
path->c_str(), *fdsan_owner);
const char* type = android_fdsan_get_tag_type(*fdsan_owner);
uint64_t value = android_fdsan_get_tag_value(*fdsan_owner);
_LOG(log, logtype::OPEN_FILES, "%sfd %i: %s (owned by %s %#" PRIx64 ")\n", prefix, fd,
path->c_str(), type, value);
} else if (path && !fdsan_owner) {
_LOG(log, logtype::OPEN_FILES, "%sfd %i: %s (unowned)\n", prefix, fd, path->c_str());
} else if (!path && fdsan_owner) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment