diff options
author | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-06-25 16:56:16 +0000 |
---|---|---|
committer | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-06-25 16:56:16 +0000 |
commit | 35c41e00ee2cf9280fe0122c75877ba70b41bb46 (patch) | |
tree | 5b3df3085b0f8743b1c93ffca297062eb28efbb4 /src/common/test_assembler.cc | |
parent | Convert files in .nib format to .xib format. (diff) | |
download | breakpad-35c41e00ee2cf9280fe0122c75877ba70b41bb46.tar.xz |
Breakpad Mac symbol dumper: Add new Mach-O reader class.
This patch adds files defining new classes in the google_breakpad::Mach_O
namespace for parsing fat binaries and Mach-O files. These are used in the
new dumper to handle STABS debugging information, DWARF call frame
information, and .eh_frame exception handling stack walking information.
These new classes are independent of endianness and word size, and
therefore can be used on binaries of all the relevant architectures: x86,
x86_64, ppc, and ARM.
The patch adds a complete set of unit tests for the new classes.
A=jimb R=mark (http://breakpad.appspot.com/93001/show, http://breakpad.appspot.com/115001/show)
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@610 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/test_assembler.cc')
-rw-r--r-- | src/common/test_assembler.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/common/test_assembler.cc b/src/common/test_assembler.cc index 54092f37..261691b0 100644 --- a/src/common/test_assembler.cc +++ b/src/common/test_assembler.cc @@ -32,14 +32,15 @@ // test_assembler.cc: Implementation of google_breakpad::TestAssembler. // See test_assembler.h for details. -#include <cassert> -#include <cstdio> +#include <assert.h> +#include <stdio.h> + #include <iterator> #include "common/test_assembler.h" namespace google_breakpad { -namespace TestAssembler { +namespace test_assembler { using std::back_insert_iterator; @@ -201,7 +202,7 @@ void Label::Binding::Get(Binding **base, u_int64_t *addend) { } template<typename Inserter> -static inline void InsertEndian(TestAssembler::Endianness endianness, +static inline void InsertEndian(test_assembler::Endianness endianness, size_t size, u_int64_t number, Inserter dest) { assert(size > 0); if (endianness == kLittleEndian) { @@ -341,7 +342,7 @@ bool Section::GetContents(string *contents) { Reference &r = references_[i]; u_int64_t value; if (!r.label.IsKnownConstant(&value)) { - fprintf(stderr, "Undefined label #%d at offset 0x%x\n", i, r.offset); + fprintf(stderr, "Undefined label #%zu at offset 0x%zx\n", i, r.offset); return false; } assert(r.offset < contents_.size()); @@ -354,5 +355,5 @@ bool Section::GetContents(string *contents) { return true; } -} // namespace TestAssembler -} // namespace google_breakpad +} // namespace test_assembler +} // namespace google_breakpad |