From deb500f6c85e4eb65218d171dbdbc528df8ebcfe Mon Sep 17 00:00:00 2001 From: jimblandy Date: Wed, 5 May 2010 17:13:42 +0000 Subject: 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 --- src/common/stabs_to_module.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/common/stabs_to_module.cc') diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index 858d0dff..fbe4c02f 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -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 -- cgit v1.2.1