aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-07-27 21:33:25 +0000
committerjimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-07-27 21:33:25 +0000
commit0eb3c6e5e2846cc71a7fbcf581596f3b5b3135b6 (patch)
tree1e55786d8e3087b69980326a2ce32bdec8d9dc6a
parentThe has_sol field of struct FuncInfo is unused. This patch removes it. (diff)
downloadbreakpad-0eb3c6e5e2846cc71a7fbcf581596f3b5b3135b6.tar.xz
Linux dumper: Correctly find boundary address when computing line and function sizes.
In NextAddress, check both the file list and the function list for the nearest boundary. Don't assume that, if we find any bounding entry in the function list, that must be the nearest thing. A=jimblandy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@365 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r--src/common/linux/dump_symbols.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
index 55680d5f..b8846e33 100644
--- a/src/common/linux/dump_symbols.cc
+++ b/src/common/linux/dump_symbols.cc
@@ -347,9 +347,6 @@ static ElfW(Addr) NextAddress(
),
&func_info)
);
- if (next_func_iter != sorted_functions->end())
- return (*next_func_iter)->addr;
-
std::vector<struct SourceFileInfo *>::iterator next_file_iter =
std::find_if(sorted_files->begin(),
sorted_files->end(),
@@ -360,10 +357,17 @@ static ElfW(Addr) NextAddress(
),
&func_info)
);
- if (next_file_iter != sorted_files->end()) {
- return (*next_file_iter)->addr;
+ if (next_func_iter != sorted_functions->end()) {
+ if (next_file_iter != sorted_files->end())
+ return std::min((*next_file_iter)->addr, (*next_func_iter)->addr);
+ else
+ return (*next_func_iter)->addr;
+ } else {
+ if (next_file_iter != sorted_files->end())
+ return (*next_file_iter)->addr;
+ else
+ return 0;
}
- return 0;
}
// Add included file information.