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
This commit is contained in:
jimblandy@gmail.com 2009-07-27 21:33:25 +00:00
parent 1147cc4920
commit 0eb3c6e5e2

View file

@ -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.