summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheron <tspiegl@gmail.com>2021-05-05 21:07:30 -0500
committerTheron <tspiegl@gmail.com>2021-05-05 21:07:30 -0500
commite41661906310184be9f49de4292091b91fa49835 (patch)
tree3c8030b78bb3970468084f3444de919a9baf2a70
parente4a65824c878ac009499924480cc48bb5be55481 (diff)
android
-rw-r--r--Makefile3
-rw-r--r--src/attach.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 8be2206..025a4d1 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,9 @@ all: bin/whatfiles
bin/whatfiles: $(SOURCES)
$(CC) $(CFLAGS) -o $@ $(SOURCES) src/$(ARCH_DIR)/registers.c
+bin/androidWhatfiles: $(SOURCES)
+ ~/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 $(CFLAGS) -o $@ $(SOURCES) src/arm64/registers.c
+
# utils
install:
diff --git a/src/attach.c b/src/attach.c
index 1846288..5c9c647 100644
--- a/src/attach.c
+++ b/src/attach.c
@@ -36,12 +36,13 @@ char read_status(pid_t pid)
FILE *h_status = fopen(path, "rb");
if (!h_status) return 0;
read_file(str, 4096, h_status);
+ DEBUG("PROC FILE\n%s", str->data);
int err;
regmatch_t pmatch[2];
err = regexec(&regex, str->data, 2, pmatch, 0);
if (err) {
- DEBUG("failed to find regex match in /proc/%d/status file\n", pid);
+ DEBUG("failed to find regex match in /proc/%d/status file: 0x%x\n", pid, err);
} else {
c = *(str->data + pmatch[1].rm_so);
}