Breakpad STABS reader: Properly compute function end addresses.

An N_FUN stabs with no name is an explicit end-of-function marker, whose
value is the size of the function. This patch changes the stabs reader to
recognize these and use them to compute the function's ending address,
instead of treating them as functions with no names and mysterious
addresses. It also adds appropriate unit tests.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@585 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
jimblandy 2010-05-05 17:13:42 +00:00
parent b28be1254c
commit deb500f6c8
3 changed files with 72 additions and 7 deletions

View file

@ -107,9 +107,13 @@ bool StabsToModule::EndFunction(uint64_t address) {
// of duplicated entries for functions in the STABS data; only one
// entry can meet this requirement.
//
// (I don't really understand the above comment; just bringing it
// along from the previous code, and leaving the behaivor unchanged.
// If you know the whole story, please patch this comment. --jimb)
// (I don't really understand the above comment; just bringing it along
// from the previous code, and leaving the behavior unchanged. GCC marks
// the end of each function with an N_FUN entry with no name, whose value
// is the size of the function; perhaps this test was concerned with
// skipping those. Now StabsReader interprets them properly. If you know
// the whole story, please patch this comment. --jimb)
//
if (current_function_->address >= comp_unit_base_address_)
functions_.push_back(current_function_);
else