mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-01 20:24:40 +01:00
Breakpad Linux dumper: Make StabsReader independent of endianness and word size.
StabsReader simply applies a reinterpret_cast to treat the stab entry data as an array of 'struct nlist' structures, making the parser specific on the host endianness, word size, and alignment rules. On Mac OS X, a single fat binary file may contain object files of different ABIs, of which the user chooses one at run time. This patch changes the parser to read the data using the google_breakpad:: ByteCursor class, which can handle different endiannesses and word sizes. The StabsReader constructor now takes arguments indicating the endianness of the data and the size of each entry's value field. The patch changes src/common/linux/dump_symbols.cc to pass the new argument. This patch changes the StabsReader unit tests to use the google_breakpad:: TestAssembler classes to generate test data, rather than reading it from a file. This makes it easy to generate test data in various endiannesses and word sizes. It also adds tests for the new parser behaviors. a=jimblandy, r=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@583 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
6c97801617
commit
b0ec96cee2
12 changed files with 478 additions and 627 deletions
|
|
@ -154,6 +154,7 @@ stabs_reader_unittest: \
|
|||
gtest-all.o \
|
||||
gtest_main.o \
|
||||
stabs_reader.o \
|
||||
test_assembler.o \
|
||||
$(empty)
|
||||
CPP_EXECUTABLES += stabs_reader_unittest
|
||||
stabs_reader_unittest.o: stabs_reader_unittest.cc
|
||||
|
|
@ -360,7 +361,7 @@ $(CPP_EXECUTABLES): %: %.o
|
|||
|
||||
# Allow #include directives to refer to files below 'src'; generate
|
||||
# dependency files automatically; and I doubt _REENTRANT is needed at all.
|
||||
BREAKPAD_CPPFLAGS = -I$(SRC) -MMD -D_REENTRANT
|
||||
BREAKPAD_CPPFLAGS = -I$(SRC) -MMD -D_REENTRANT -DHAVE_A_OUT_H
|
||||
|
||||
# Bring in whatever dependency files we have generated by compiling with -MMD.
|
||||
-include *.d
|
||||
|
|
@ -383,7 +384,7 @@ clean::
|
|||
### appropriate for Google C++ Testing Framework test programs. But
|
||||
### you can provide your own commands.
|
||||
check-%: %
|
||||
srcdir=$(SRC) $(TEST_WRAPPER) ./$< $(TEST_ARGS)
|
||||
$(TEST_WRAPPER) ./$< $(TEST_ARGS)
|
||||
|
||||
|
||||
### Generic coverage reporting rules.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue