Merge "Don't assume size of functions." into main am: 8a2f0358ed
am: 41c6ed2eed
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2681595 Change-Id: I3e88243b150bf4f0c804fd4bcdcf3f41cd3764c4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
ff078f0096
1 changed files with 6 additions and 2 deletions
|
@ -79,9 +79,13 @@ static std::string DumpFrames(std::vector<void*>& frames) {
|
|||
}
|
||||
|
||||
static size_t FindFunction(std::vector<void*>& frames, uintptr_t func_addr) {
|
||||
Dl_info func_info;
|
||||
if (!dladdr(reinterpret_cast<void*>(func_addr), &func_info)) {
|
||||
return 0;
|
||||
}
|
||||
for (size_t i = 0; i < frames.size(); i++) {
|
||||
uintptr_t frame_addr = reinterpret_cast<uintptr_t>(frames[i]);
|
||||
if (frame_addr >= func_addr && frame_addr <= func_addr + 0x100) {
|
||||
Dl_info frame_info;
|
||||
if (dladdr(frames[i], &frame_info) && func_info.dli_saddr == frame_info.dli_saddr) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue