aboutsummaryrefslogtreecommitdiff
path: root/src/common/module.cc
diff options
context:
space:
mode:
authorjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-03-11 22:16:12 +0000
committerjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-03-11 22:16:12 +0000
commitfd18beeb5c817aa3ecdb21caceee8e6ce08c6ab3 (patch)
tree5997c04fe096f9b15bbe388af5c7fdd2c466cdc9 /src/common/module.cc
parentPut PUBLIC lines in Mac symbol files. (diff)
downloadbreakpad-fd18beeb5c817aa3ecdb21caceee8e6ce08c6ab3.tar.xz
Google Breakpad Issue 417: Handle DWARF that omits function names.
This patch makes sure dump_syms behaves properly when presented with malformed DWARF data that provides no name for a function. We print a warning message to stderr, and subsitute "<name omitted>" for the empty string, so that the "FUNC" record written to the symbol file for the function is still well-formed. (We may have line number data covering the function, so it would be a shame to omit the function altogether.) Unit tests included. a=jimblandy, r=ted.mielczarek git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@779 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/module.cc')
-rw-r--r--src/common/module.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/module.cc b/src/common/module.cc
index 0c36516a..ffaeb87a 100644
--- a/src/common/module.cc
+++ b/src/common/module.cc
@@ -33,6 +33,7 @@
#include "common/module.h"
+#include <assert.h>
#include <errno.h>
#include <string.h>
@@ -65,6 +66,9 @@ void Module::SetLoadAddress(Address address) {
}
void Module::AddFunction(Function *function) {
+ // FUNC lines must not hold an empty name, so catch the problem early if
+ // callers try to add one.
+ assert(!function->name.empty());
std::pair<FunctionSet::iterator,bool> ret = functions_.insert(function);
if (!ret.second) {
// Free the duplicate that was not inserted because this Module