aboutsummaryrefslogtreecommitdiff
path: root/src/common/stabs_to_module.cc
diff options
context:
space:
mode:
authorjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-05-05 17:13:42 +0000
committerjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-05-05 17:13:42 +0000
commitdeb500f6c85e4eb65218d171dbdbc528df8ebcfe (patch)
tree0ea47cd891eabf867536fae5a866ca3d5e4a4837 /src/common/stabs_to_module.cc
parentBreakpad Linux dumper: Rename DumpStabsHandler to StabsToModule. (diff)
downloadbreakpad-deb500f6c85e4eb65218d171dbdbc528df8ebcfe.tar.xz
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
Diffstat (limited to 'src/common/stabs_to_module.cc')
-rw-r--r--src/common/stabs_to_module.cc10
1 files changed, 7 insertions, 3 deletions
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