aboutsummaryrefslogtreecommitdiff
path: root/src/common/stabs_reader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/stabs_reader.cc')
-rw-r--r--src/common/stabs_reader.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/common/stabs_reader.cc b/src/common/stabs_reader.cc
index 1ca97412..7dd2eecd 100644
--- a/src/common/stabs_reader.cc
+++ b/src/common/stabs_reader.cc
@@ -107,8 +107,19 @@ bool StabsReader::Process() {
string_offset_ = next_cu_string_offset_;
next_cu_string_offset_ = iterator_->value;
++iterator_;
- } else
+ }
+#if defined(HAVE_MACH_O_NLIST_H)
+ // Export symbols in Mach-O binaries look like this.
+ // This is necessary in order to be able to dump symbols
+ // from OS X system libraries.
+ else if ((iterator_->type & N_STAB) == 0 &&
+ (iterator_->type & N_TYPE) == N_SECT) {
+ ProcessExtern();
+ }
+#endif
+ else {
++iterator_;
+ }
}
return true;
}
@@ -282,4 +293,19 @@ bool StabsReader::ProcessFunction() {
return true;
}
+bool StabsReader::ProcessExtern() {
+#if defined(HAVE_MACH_O_NLIST_H)
+ assert(!iterator_->at_end &&
+ (iterator_->type & N_STAB) == 0 &&
+ (iterator_->type & N_TYPE) == N_SECT);
+#endif
+
+ // TODO(mark): only do symbols in the text section?
+ if (!handler_->Extern(SymbolString(), iterator_->value))
+ return false;
+
+ ++iterator_;
+ return true;
+}
+
} // namespace google_breakpad