aboutsummaryrefslogtreecommitdiff
path: root/src/common/stabs_to_module.cc
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-03-04 16:08:39 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-03-04 16:08:39 +0000
commitbf25801d837b8fc496bf9c3a34eac525d8a3d8ae (patch)
treeeefc9e418e10864c47cf9055ddf97a79f8a38979 /src/common/stabs_to_module.cc
parentUpdating to ints from unsigned ints so -1 will be an acceptable value. (diff)
downloadbreakpad-bf25801d837b8fc496bf9c3a34eac525d8a3d8ae.tar.xz
Put PUBLIC lines in Mac symbol files.
Exported symbols on Mach-O binaries are defined in a STABS section. This patch makes stabs_reader handle them, adds support for Extern symbols in the Module class (which are output as PUBLIC lines in symbol files), and the proper processing in stabs_to_module to hook it all up. A=mark R=jimb at http://breakpad.appspot.com/163001 and http://breakpad.appspot.com/267001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@778 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/stabs_to_module.cc')
-rw-r--r--src/common/stabs_to_module.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc
index 62fcd39e..e694febc 100644
--- a/src/common/stabs_to_module.cc
+++ b/src/common/stabs_to_module.cc
@@ -132,6 +132,22 @@ bool StabsToModule::Line(uint64_t address, const char *name, int number) {
return true;
}
+bool StabsToModule::Extern(const string &name, uint64_t address) {
+ Module::Extern *ext = new Module::Extern;
+ // Older libstdc++ demangle implementations can crash on unexpected
+ // input, so be careful about what gets passed in.
+ if (name.compare(0, 3, "__Z") == 0) {
+ ext->name = Demangle(name.substr(1));
+ } else if (name[0] == '_') {
+ ext->name = name.substr(1);
+ } else {
+ ext->name = name;
+ }
+ ext->address = address;
+ module_->AddExtern(ext);
+ return true;
+}
+
void StabsToModule::Warning(const char *format, ...) {
va_list args;
va_start(args, format);