aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/stabs_reader.h
diff options
context:
space:
mode:
authorjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-01-14 17:19:34 +0000
committerjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-01-14 17:19:34 +0000
commit5251e64f48f52f0bc73a4b4dcfa6efa327b1b2ff (patch)
treebce37375ce267b2eb3e073f6c073e359e99994a0 /src/common/linux/stabs_reader.h
parentLinux Breakpad Dumper: support running unit tests under valgrind or other wra... (diff)
downloadbreakpad-5251e64f48f52f0bc73a4b4dcfa6efa327b1b2ff.tar.xz
Breakpad Linux dumper: STABS reader incorrectly assumes a single compilation unit
The stabs reading code in google-breakpad incorrectly assumes that the stabs data is a single compilation unit. Specifically, it ignores N_UNDF stabs and assumes that all string indices are relative to the beginning of the .stabstr section. This is true when linking with the GNU linker by default, because the GNU linker optimizes stabs debug info. The gold linker does not do this optimization. It can be disabled when using the GNU linker with the --traditional-format command line option. For more details of the problem, see: http://sourceware.org/bugzilla/show_bug.cgi?id=10338 http://code.google.com/p/google-breakpad/issues/detail?id=359 This patch adds unit tests that reproduce the failure, and fixes the stabs parser. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@490 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/stabs_reader.h')
-rw-r--r--src/common/linux/stabs_reader.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/linux/stabs_reader.h b/src/common/linux/stabs_reader.h
index 2465942b..06bd115e 100644
--- a/src/common/linux/stabs_reader.h
+++ b/src/common/linux/stabs_reader.h
@@ -96,6 +96,13 @@ class StabsReader {
StabsHandler *handler_;
+ // The offset of the current compilation unit's strings within stabstr_.
+ size_t string_offset_;
+
+ // The value string_offset_ should have for the next compilation unit,
+ // as established by N_UNDF entries.
+ size_t next_cu_string_offset_;
+
// The current symbol we're processing.
const struct nlist *symbol_;