aboutsummaryrefslogtreecommitdiff
path: root/src/common/mac
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-12-08 13:00:29 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-12-08 13:00:29 +0000
commitd3441c2c96346611abd752270144d5f71d4f68b3 (patch)
treed099db763abbc385efaa0ec2f0e33f8fc40e88e8 /src/common/mac
parentissue 286 - clean up some demangling code in dump_syms.mm. r=chris rogers (diff)
downloadbreakpad-d3441c2c96346611abd752270144d5f71d4f68b3.tar.xz
Issue 284 - DWARF dumper doesn't output function names including arguments. r=nealsid
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@302 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/mac')
-rw-r--r--src/common/mac/dump_syms.mm10
-rw-r--r--src/common/mac/dwarf/functioninfo.cc8
-rw-r--r--src/common/mac/dwarf/functioninfo.h2
3 files changed, 17 insertions, 3 deletions
diff --git a/src/common/mac/dump_syms.mm b/src/common/mac/dump_syms.mm
index 901f6276..88f1f4f1 100644
--- a/src/common/mac/dump_syms.mm
+++ b/src/common/mac/dump_syms.mm
@@ -63,7 +63,6 @@ static NSString *kHeaderSizeKey = @"size";
static NSString *kHeaderOffsetKey = @"offset"; // Offset to the header
static NSString *kHeaderIs64BitKey = @"is64";
static NSString *kHeaderCPUTypeKey = @"cpuType";
-static NSString *kUnknownSymbol = @"???";
// The section for __TEXT, __text seems to be always 1. This is useful
// for pruning out extraneous non-function symbols.
@@ -433,6 +432,15 @@ void DumpFunctionMap(const dwarf2reader::FunctionMap function_map) {
NSString *symbolName = [NSString stringWithUTF8String:iter->second->name.c_str()];
[dict setObject:symbolName forKey:kAddressSymbolKey];
}
+
+ // try demangling function name if we have a mangled name
+ if (![dict objectForKey:kAddressConvertedSymbolKey] &&
+ !iter->second->mangled_name.empty()) {
+ NSString *mangled = [NSString stringWithUTF8String:iter->second->mangled_name.c_str()];
+ NSString *demangled = [self convertCPlusPlusSymbol:mangled];
+ if (demangled != nil)
+ [dict setObject:demangled forKey:kAddressConvertedSymbolKey];
+ }
// set line number for beginning of function
if (iter->second->line && ![dict objectForKey:kAddressSourceLineKey])
diff --git a/src/common/mac/dwarf/functioninfo.cc b/src/common/mac/dwarf/functioninfo.cc
index e9d33b83..66355ec0 100644
--- a/src/common/mac/dwarf/functioninfo.cc
+++ b/src/common/mac/dwarf/functioninfo.cc
@@ -152,8 +152,12 @@ void CUFunctionInfoHandler::ProcessAttributeString(uint64 offset,
enum DwarfAttribute attr,
enum DwarfForm form,
const string &data) {
- if (attr == DW_AT_name && current_function_info_)
- current_function_info_->name = data;
+ if (current_function_info_) {
+ if (attr == DW_AT_name)
+ current_function_info_->name = data;
+ else if(attr == DW_AT_MIPS_linkage_name)
+ current_function_info_->mangled_name = data;
+ }
}
void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64 offset,
diff --git a/src/common/mac/dwarf/functioninfo.h b/src/common/mac/dwarf/functioninfo.h
index f529f092..aa8bf705 100644
--- a/src/common/mac/dwarf/functioninfo.h
+++ b/src/common/mac/dwarf/functioninfo.h
@@ -47,6 +47,8 @@ namespace dwarf2reader {
struct FunctionInfo {
// Name of the function
string name;
+ // Mangled name of the function
+ string mangled_name;
// File containing this function
string file;
// Line number for start of function.