forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve ProcessElfCore::GetLoadedModuleList() dealing with duplicate …
…NT_FILE ranges Summary: Currently ProcessElfCore::GetLoadedModuleList() assumes NT_FILE entries are mostly continuous, and if there are discontinuous ranges, it uses lower start address range base address and brutally merge all ranges. However, during real world testing, I discovered MySQL team's coredump has discontinuous ranges for many modules and some module's later ranges are the correct one. We have two options here: 1. Keep all duplicate ranges and create duplicate modules 2. Rate the ranges and select a best one. Since lldb does not support duplicate modules I chose option #2 above: * Merge continuous entries into one range. * Rate among duplicate ranges and select a "better" one. * "Better" range is defined to have more NT_FILE entry count; and have larger size if entry count equals. MySQL's coredump has zero mismatch modules after this change. Test Plan: Tested with MySQL's coredump. Reviewers: wanyi, hyubo, #lldb_team Reviewed By: wanyi Subscribers: generatedunixname89002005328444, #lldb_team Differential Revision: https://phabricator.intern.facebook.com/D45869549 [Easy] handling corner cases of NT_FILE in ProcessElfCore::GetLoadedModuleList Summary: This diff handles the corner cases of the algorithm added in D45869549: 1. When m_nt_file_entries is empty, we should simply return without adding any range 2. The first entry should simply record Test Plan: Found a coredumper triggering the corner cases and can be debugged fine. Reviewers: wanyi, hyubo, #lldb_team Reviewed By: wanyi Subscribers: #lldb_team Differential Revision: https://phabricator.intern.facebook.com/D46076584
- Loading branch information
1 parent
e23c0ed
commit 9a06a86
Showing
2 changed files
with
96 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters