diff options
author | jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-08-05 00:56:29 +0000 |
---|---|---|
committer | jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-08-05 00:56:29 +0000 |
commit | 3c4de8e8a7c5958c468bcd36fd5e007f8279dc91 (patch) | |
tree | 477ea105a9da7b38dd6789c143dc31eab1afbc2d | |
parent | Linux dumper: Don't switch to wrong source file when starting new function. (diff) | |
download | breakpad-3c4de8e8a7c5958c468bcd36fd5e007f8279dc91.tar.xz |
Linux dumper: Properly separate function names from STABS type data.
STABS strings for N_FUN entries contain a mangled function name,
followed by a colon, followed by type information. The type
information itself may contain colons; mangled names never contain
colons (they need to be legal assembly-language identifiers). So the
current code in src/common/linux/dump_symbols.cc:WriteOneFunction that
attempts to separate the mangled name from the STABS junk will
incorrectly include STABS junk in the name, causing demangling to
fail.
Applying the patch below results in changes like these in the symbol
file produced, where an unmangled name followed by STABS junk becomes
a properly demangled name:
## --- base/libxul.so.syms 2009-07-13 21:46:33.000000000 -0700
## +++ tip/libxul.so.syms 2009-07-13 21:51:04.000000000 -0700
## @@ -3907,7 +3907,7 @@
## FILE 3905 /home/jimb/mc/in/gfx/cairo/libpixman/src/pixman-region.c
## FILE 3906 combine.inc
## FILE 3907 /home/jimb/mc/in/gfx/cairo/libpixman/src/pixman-edge-imp.h
## -FUNC 19898c 54 0 _Z20NS_GetCaseConversionv:F(0,1201)=*(0,1202)=xsnsICaseConvers
## ion
## +FUNC 19898c 54 0 NS_GetCaseConversion()
## 19898c 12 54 1
## 19899e 9 56 1
## 1989a7 6 60 1
## @@ -214776,7 +214776,7 @@
## 3847c9 9 57 506
## 3847d2 13 58 506
## 3847e5 7 59 506
## -FUNC 387e89 27 0 _ZN20nsGenericHTMLElement11FromContentEP10nsIContent:F(0,8117)
## =*(0,8118)=xsnsGenericHTMLElement
## +FUNC 387e89 27 0 nsGenericHTMLElement::FromContent(nsIContent*)
## 387e89 7 80 2584
## 387e90 3 80 2584
## 387e93 e 82 2584
## @@ -250473,7 +250473,7 @@
## 3d0d88 7 82 548
## 3d0d8f 25 84 548
## 3d0db4 5 85 548
## -FUNC 3d0e0c 40 0 _ZL21GetEnclosingListFrameP8nsIFrame:f(0,7182)=*(0,7183)=xsnsL
## istControlFrame
## +FUNC 3d0e0c 40 0 GetEnclosingListFrame(nsIFrame*)
## 3d0e0c 5 146 549
## 3d0e11 3 722 2645
## 3d0e14 d 146 549
a=jimblandy
r=nealsid
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@374 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r-- | src/common/linux/dump_symbols.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 757da93e..3b2331df 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -611,7 +611,7 @@ static bool WriteOneFunction(FILE *file, const struct FuncInfo &func_info){ // Discard the ending part of the name. std::string func_name(func_info.name); - std::string::size_type last_colon = func_name.find_last_of(':'); + std::string::size_type last_colon = func_name.find_first_of(':'); if (last_colon != std::string::npos) func_name = func_name.substr(0, last_colon); func_name = Demangle(func_name.c_str()); |