diff options
author | Christopher Ferris <cferris@google.com> | 2018-12-13 03:18:58 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-12-13 03:18:58 +0000 |
commit | 583ce2deff4caa28fdadd80796cce41e6e7be99a (patch) | |
tree | 80ddb0ae99831f16c5feaaa4d9244fdf60c2dbd1 /libunwindstack/tools/unwind_for_offline.cpp | |
parent | 78f94a39f24c2d8b5f988627d12b44a48a8b0bc7 (diff) | |
parent | 01040b10b2393014c2d49265b6ef75a1a2a459a7 (diff) | |
download | system_core-583ce2deff4caa28fdadd80796cce41e6e7be99a.tar.gz system_core-583ce2deff4caa28fdadd80796cce41e6e7be99a.tar.bz2 system_core-583ce2deff4caa28fdadd80796cce41e6e7be99a.zip |
Merge "Fix handling of ro segments for embedded libs."
Diffstat (limited to 'libunwindstack/tools/unwind_for_offline.cpp')
-rw-r--r-- | libunwindstack/tools/unwind_for_offline.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libunwindstack/tools/unwind_for_offline.cpp b/libunwindstack/tools/unwind_for_offline.cpp index c8a8ab55f..652dbd1d3 100644 --- a/libunwindstack/tools/unwind_for_offline.cpp +++ b/libunwindstack/tools/unwind_for_offline.cpp @@ -50,7 +50,12 @@ struct map_info_t { }; static bool Attach(pid_t pid) { - if (ptrace(PTRACE_ATTACH, pid, 0, 0) == -1) { + if (ptrace(PTRACE_SEIZE, pid, 0, 0) == -1) { + return false; + } + + if (ptrace(PTRACE_INTERRUPT, pid, 0, 0) == -1) { + ptrace(PTRACE_DETACH, pid, 0, 0); return false; } |