Breakpad symbol dumper: Move Linux dumping classes into src/common.

The Linux symbol dumper's classes are reasonably portable, and should be
usable for the Mac dumper as well. Move them to src/common, along with
their unit tests. Update #include directives and Makefile.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@567 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
jimblandy 2010-04-05 19:40:17 +00:00
parent 9e6b619ad0
commit 87855248f1
29 changed files with 38 additions and 36 deletions

View file

@ -37,7 +37,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include "common/linux/dump_stabs.h" #include "common/dump_stabs.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -43,8 +43,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "common/linux/module.h" #include "common/module.h"
#include "common/linux/stabs_reader.h" #include "common/stabs_reader.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -34,7 +34,7 @@
#include <vector> #include <vector>
#include "breakpad_googletest_includes.h" #include "breakpad_googletest_includes.h"
#include "common/linux/dump_stabs.h" #include "common/dump_stabs.h"
using google_breakpad::DumpStabsHandler; using google_breakpad::DumpStabsHandler;
using google_breakpad::Module; using google_breakpad::Module;

View file

@ -36,7 +36,7 @@
#include <sstream> #include <sstream>
#include "common/linux/dwarf_cfi_to_module.h" #include "common/dwarf_cfi_to_module.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -43,7 +43,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "common/linux/module.h" #include "common/module.h"
#include "common/dwarf/dwarf2reader.h" #include "common/dwarf/dwarf2reader.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -32,7 +32,7 @@
// dwarf_cfi_to_module_unittest.cc: Tests for google_breakpad::DwarfCFIToModule. // dwarf_cfi_to_module_unittest.cc: Tests for google_breakpad::DwarfCFIToModule.
#include "breakpad_googletest_includes.h" #include "breakpad_googletest_includes.h"
#include "common/linux/dwarf_cfi_to_module.h" #include "common/dwarf_cfi_to_module.h"
using google_breakpad::Module; using google_breakpad::Module;
using google_breakpad::DwarfCFIToModule; using google_breakpad::DwarfCFIToModule;

View file

@ -34,8 +34,8 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include "common/linux/dwarf_cu_to_module.h" #include "common/dwarf_cu_to_module.h"
#include "common/linux/dwarf_line_to_module.h" #include "common/dwarf_line_to_module.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -43,8 +43,8 @@
#include <elf.h> #include <elf.h>
#include <link.h> #include <link.h>
#include "common/linux/language.h" #include "common/language.h"
#include "common/linux/module.h" #include "common/module.h"
#include "common/dwarf/bytereader.h" #include "common/dwarf/bytereader.h"
#include "common/dwarf/dwarf2diehandler.h" #include "common/dwarf/dwarf2diehandler.h"
#include "common/dwarf/dwarf2reader.h" #include "common/dwarf/dwarf2reader.h"

View file

@ -34,7 +34,7 @@
#include <vector> #include <vector>
#include "breakpad_googletest_includes.h" #include "breakpad_googletest_includes.h"
#include "common/linux/dwarf_cu_to_module.h" #include "common/dwarf_cu_to_module.h"
using std::vector; using std::vector;
@ -828,7 +828,7 @@ struct Situation {
uncovered_functions, uncovered_lines }, uncovered_functions, uncovered_lines },
Situation situations[] = { Situation situations[] = {
#include "common/linux/testdata/func-line-pairing.h" #include "common/testdata/func-line-pairing.h"
}; };
#undef PAIRING #undef PAIRING

View file

@ -32,7 +32,7 @@
// dwarf_line_to_module.cc: Implementation of DwarfLineToModule class. // dwarf_line_to_module.cc: Implementation of DwarfLineToModule class.
// See dwarf_line_to_module.h for details. // See dwarf_line_to_module.h for details.
#include "common/linux/dwarf_line_to_module.h" #include "common/dwarf_line_to_module.h"
// Trying to support Windows paths in a reasonable way adds a lot of // Trying to support Windows paths in a reasonable way adds a lot of
// variations to test; it would be better to just put off dealing with // variations to test; it would be better to just put off dealing with

View file

@ -38,7 +38,7 @@
#ifndef COMMON_LINUX_DWARF_LINE_TO_MODULE_H #ifndef COMMON_LINUX_DWARF_LINE_TO_MODULE_H
#define COMMON_LINUX_DWARF_LINE_TO_MODULE_H #define COMMON_LINUX_DWARF_LINE_TO_MODULE_H
#include "common/linux/module.h" #include "common/module.h"
#include "common/dwarf/dwarf2reader.h" #include "common/dwarf/dwarf2reader.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -32,7 +32,7 @@
// dwarf_line_to_module.cc: Unit tests for google_breakpad::DwarfLineToModule. // dwarf_line_to_module.cc: Unit tests for google_breakpad::DwarfLineToModule.
#include "breakpad_googletest_includes.h" #include "breakpad_googletest_includes.h"
#include "common/linux/dwarf_line_to_module.h" #include "common/dwarf_line_to_module.h"
using google_breakpad::DwarfLineToModule; using google_breakpad::DwarfLineToModule;
using google_breakpad::Module; using google_breakpad::Module;

View file

@ -32,7 +32,7 @@
// language.cc: Subclasses and singletons for google_breakpad::Language. // language.cc: Subclasses and singletons for google_breakpad::Language.
// See language.h for details. // See language.h for details.
#include "common/linux/language.h" #include "common/language.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -48,14 +48,14 @@
#include "common/dwarf/bytereader-inl.h" #include "common/dwarf/bytereader-inl.h"
#include "common/dwarf/dwarf2diehandler.h" #include "common/dwarf/dwarf2diehandler.h"
#include "common/linux/dump_stabs.h" #include "common/dump_stabs.h"
#include "common/linux/dump_symbols.h" #include "common/linux/dump_symbols.h"
#include "common/linux/dwarf_cfi_to_module.h" #include "common/dwarf_cfi_to_module.h"
#include "common/linux/dwarf_cu_to_module.h" #include "common/dwarf_cu_to_module.h"
#include "common/linux/dwarf_line_to_module.h" #include "common/dwarf_line_to_module.h"
#include "common/linux/file_id.h" #include "common/linux/file_id.h"
#include "common/linux/module.h" #include "common/module.h"
#include "common/linux/stabs_reader.h" #include "common/stabs_reader.h"
// This namespace contains helper functions. // This namespace contains helper functions.
namespace { namespace {

View file

@ -34,7 +34,7 @@
#include <cerrno> #include <cerrno>
#include <cstring> #include <cstring>
#include "common/linux/module.h" #include "common/module.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -40,7 +40,7 @@
#include <string> #include <string>
#include "breakpad_googletest_includes.h" #include "breakpad_googletest_includes.h"
#include "common/linux/module.h" #include "common/module.h"
using google_breakpad::Module; using google_breakpad::Module;
using std::string; using std::string;

View file

@ -36,7 +36,7 @@
#include <cstring> #include <cstring>
#include <cassert> #include <cassert>
#include "common/linux/stabs_reader.h" #include "common/stabs_reader.h"
namespace google_breakpad { namespace google_breakpad {

View file

@ -45,7 +45,7 @@
#include <stab.h> #include <stab.h>
#include "breakpad_googletest_includes.h" #include "breakpad_googletest_includes.h"
#include "common/linux/stabs_reader.h" #include "common/stabs_reader.h"
using std::istream; using std::istream;
using std::istringstream; using std::istringstream;
@ -569,7 +569,7 @@ TEST(StabsReader, MockStabsInput) {
ASSERT_TRUE(ApplyHandlerToMockStabsData( ASSERT_TRUE(ApplyHandlerToMockStabsData(
&mock_handler, &mock_handler,
"common/linux/testdata/stabs_reader_unittest.input1")); "common/testdata/stabs_reader_unittest.input1"));
} }
TEST(StabsReader, AbruptCU) { TEST(StabsReader, AbruptCU) {
@ -587,7 +587,7 @@ TEST(StabsReader, AbruptCU) {
ASSERT_TRUE(ApplyHandlerToMockStabsData( ASSERT_TRUE(ApplyHandlerToMockStabsData(
&mock_handler, &mock_handler,
"common/linux/testdata/stabs_reader_unittest.input2")); "common/testdata/stabs_reader_unittest.input2"));
} }
TEST(StabsReader, AbruptFunction) { TEST(StabsReader, AbruptFunction) {
@ -609,7 +609,7 @@ TEST(StabsReader, AbruptFunction) {
ASSERT_TRUE(ApplyHandlerToMockStabsData( ASSERT_TRUE(ApplyHandlerToMockStabsData(
&mock_handler, &mock_handler,
"common/linux/testdata/stabs_reader_unittest.input3")); "common/testdata/stabs_reader_unittest.input3"));
} }
TEST(StabsReader, NoCU) { TEST(StabsReader, NoCU) {
@ -622,7 +622,7 @@ TEST(StabsReader, NoCU) {
ASSERT_TRUE(ApplyHandlerToMockStabsData( ASSERT_TRUE(ApplyHandlerToMockStabsData(
&mock_handler, &mock_handler,
"common/linux/testdata/stabs_reader_unittest.input4")); "common/testdata/stabs_reader_unittest.input4"));
} }
@ -646,7 +646,7 @@ TEST(StabsReader, NoCUEnd) {
ASSERT_TRUE(ApplyHandlerToMockStabsData( ASSERT_TRUE(ApplyHandlerToMockStabsData(
&mock_handler, &mock_handler,
"common/linux/testdata/stabs_reader_unittest.input5")); "common/testdata/stabs_reader_unittest.input5"));
} }
@ -677,7 +677,7 @@ TEST(StabsReader, MultipleCUs) {
ASSERT_TRUE(ApplyHandlerToMockStabsData( ASSERT_TRUE(ApplyHandlerToMockStabsData(
&mock_handler, &mock_handler,
"common/linux/testdata/stabs_reader_unittest.input6")); "common/testdata/stabs_reader_unittest.input6"));
} }
// name duplication // name duplication

View file

@ -96,7 +96,7 @@ clean::
dump_syms.o: dump_syms.cc dump_syms.o: dump_syms.cc
VPATH += $(SRC)/common/linux VPATH += $(SRC)/common
dwarf_cfi_to_module.o: dwarf_cfi_to_module.cc dwarf_cfi_to_module.o: dwarf_cfi_to_module.cc
COVERAGE_SOURCES += dwarf_cfi_to_module.cc COVERAGE_SOURCES += dwarf_cfi_to_module.cc
dwarf_cu_to_module.o: dwarf_cu_to_module.cc dwarf_cu_to_module.o: dwarf_cu_to_module.cc
@ -105,14 +105,16 @@ dwarf_line_to_module.o: dwarf_line_to_module.cc
COVERAGE_SOURCES += dwarf_line_to_module.cc COVERAGE_SOURCES += dwarf_line_to_module.cc
dump_stabs.o: dump_stabs.cc dump_stabs.o: dump_stabs.cc
COVERAGE_SOURCES += dump_stabs.cc COVERAGE_SOURCES += dump_stabs.cc
dump_symbols.o: dump_symbols.cc
file_id.o: file_id.cc
language.o: language.cc language.o: language.cc
module.o: module.cc module.o: module.cc
COVERAGE_SOURCES += module.cc COVERAGE_SOURCES += module.cc
stabs_reader.o: stabs_reader.cc stabs_reader.o: stabs_reader.cc
COVERAGE_SOURCES += stabs_reader.cc COVERAGE_SOURCES += stabs_reader.cc
VPATH += $(SRC)/common/linux
dump_symbols.o: dump_symbols.cc
file_id.o: file_id.cc
VPATH += $(SRC)/common/dwarf VPATH += $(SRC)/common/dwarf
bytereader.o: bytereader.cc bytereader.o: bytereader.cc
COVERAGE_SOURCES += bytereader.cc COVERAGE_SOURCES += bytereader.cc