libdebuggerd: clone registers before we Unwind with them.
Bug: http://b/77296294
Test: manual inspection of tombstone generated by crasher
Change-Id: I4b017701d7d2041db4aefbbb90977e99b844c328
(cherry picked from commit 5d1c14f41b)
This commit is contained in:
parent
fe3963143f
commit
86ea074184
1 changed files with 3 additions and 1 deletions
|
|
@ -418,8 +418,10 @@ static bool dump_thread(log_t* log, BacktraceMap* map, Memory* process_memory,
|
|||
|
||||
dump_registers(log, thread_info.registers.get());
|
||||
|
||||
// Unwind will mutate the registers, so make a copy first.
|
||||
std::unique_ptr<Regs> regs_copy(thread_info.registers->Clone());
|
||||
std::vector<backtrace_frame_data_t> frames;
|
||||
if (!Backtrace::Unwind(thread_info.registers.get(), map, &frames, 0, nullptr)) {
|
||||
if (!Backtrace::Unwind(regs_copy.get(), map, &frames, 0, nullptr)) {
|
||||
_LOG(log, logtype::THREAD, "Failed to unwind");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue