diff options
23 files changed, 116 insertions, 17 deletions
diff --git a/src/common/dwarf/dwarf2diehandler.cc b/src/common/dwarf/dwarf2diehandler.cc index 1998a854..099f5193 100644 --- a/src/common/dwarf/dwarf2diehandler.cc +++ b/src/common/dwarf/dwarf2diehandler.cc @@ -26,7 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Implementation of dwarf2reader::DieDispatcher class. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// dwarf2diehandler.cc: Implement the dwarf2reader::DieDispatcher class. +// See dwarf2diehandler.h for details. #include <cassert> diff --git a/src/common/dwarf/dwarf2diehandler.h b/src/common/dwarf/dwarf2diehandler.h index f2985c03..4c9d7536 100644 --- a/src/common/dwarf/dwarf2diehandler.h +++ b/src/common/dwarf/dwarf2diehandler.h @@ -28,6 +28,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + // dwarf2reader::CompilationUnit is a simple and direct parser for // DWARF data, but its handler interface is not convenient to use. In // particular: @@ -56,7 +58,7 @@ // type DIEs don't. It would be nice to be able to have separate // handler classes for separate kinds of DIEs, each with the members // appropriate to its role, instead of having one handler class that -// needs to hold data for all every DIE type. +// needs to hold data for every DIE type. // // - There should be a separate instance of the appropriate handler // class for each DIE, instead of a single object with tables @@ -184,6 +186,12 @@ class DIEHandler { // same restrictions as the corresponding member functions of // dwarf2reader::Dwarf2Handler. // + // Since DWARF does not specify in what order attributes must + // appear, avoid making decisions in these functions that would be + // affected by the presence of other attributes. The EndAttributes + // function is a more appropriate place for such work, as all the + // DIE's attributes have been seen at that point. + // // The default definitions ignore the values they are passed. virtual void ProcessAttributeUnsigned(enum DwarfAttribute attr, enum DwarfForm form, @@ -208,6 +216,11 @@ class DIEHandler { // child. If that returns a handler object, we use that to visit // the child; otherwise, we skip the child. // + // This is a good place to make decisions that depend on more than + // one attribute. DWARF does not specify in what order attributes + // must appear, so only when the EndAttributes function is called + // does the handler have a complete picture of the DIE's attributes. + // // The default definition elects to ignore the DIE's children. // You'll need to override this if you override FindChildHandler, // but at least the default behavior isn't to pass the children to diff --git a/src/common/dwarf/dwarf2diehandler_unittest.cc b/src/common/dwarf/dwarf2diehandler_unittest.cc index 4cfe1117..67ccb95f 100644 --- a/src/common/dwarf/dwarf2diehandler_unittest.cc +++ b/src/common/dwarf/dwarf2diehandler_unittest.cc @@ -28,6 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// dwarf2diehander_unittest.cc: Unit tests for google_breakpad::DIEDispatcher. + #include "breakpad_googletest_includes.h" #include "common/dwarf/dwarf2diehandler.h" diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 028531f4..ec30a309 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -26,6 +26,9 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Implementation of dwarf2reader::LineInfo and dwarf2reader::CompilationUnit. +// See dwarf2reader.h for details. + #include <cassert> #include <cstdio> #include <cstring> diff --git a/src/common/linux/dump_stabs.cc b/src/common/linux/dump_stabs.cc index ed683ccb..adc79fd0 100644 --- a/src/common/linux/dump_stabs.cc +++ b/src/common/linux/dump_stabs.cc @@ -27,6 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + // dump_stabs.cc --- implement the DumpStabsHandler class. #include <cstdarg> diff --git a/src/common/linux/dump_stabs.h b/src/common/linux/dump_stabs.h index 99a52854..fb69e596 100644 --- a/src/common/linux/dump_stabs.h +++ b/src/common/linux/dump_stabs.h @@ -29,7 +29,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// dump_stabs.h: A StabsHandler that populates a Module. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// dump_stabs.h: Define the DumpStabsHandler class, which receives +// STABS debugging information from a parser and adds it to a Breakpad +// symbol file. #ifndef COMMON_LINUX_DUMP_STABS_H__ #define COMMON_LINUX_DUMP_STABS_H__ diff --git a/src/common/linux/dump_stabs_unittest.cc b/src/common/linux/dump_stabs_unittest.cc index 27a465e6..f135d9bd 100644 --- a/src/common/linux/dump_stabs_unittest.cc +++ b/src/common/linux/dump_stabs_unittest.cc @@ -27,6 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + // dump_stabs_unittest.cc: Unit tests for DumpStabsHandler. #include <vector> diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index b92fdf21..61dbee86 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -27,6 +27,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Restructured in 2009 by: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// dump_symbols.cc: implement google_breakpad::WriteSymbolFile: +// Find all the debugging info in a file and dump it as a Breakpad symbol file. + #include <elf.h> #include <fcntl.h> #include <link.h> diff --git a/src/common/linux/dump_symbols.h b/src/common/linux/dump_symbols.h index 03e61709..5093da10 100644 --- a/src/common/linux/dump_symbols.h +++ b/src/common/linux/dump_symbols.h @@ -26,9 +26,9 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// dump_symbols.cc: Implements a linux stab debugging format dumper. -// + +// dump_symbols.h: Read debugging information from an ELF file, and write +// it out as a Breakpad symbol file. #ifndef COMMON_LINUX_DUMP_SYMBOLS_H__ #define COMMON_LINUX_DUMP_SYMBOLS_H__ diff --git a/src/common/linux/dwarf_cu_to_module.cc b/src/common/linux/dwarf_cu_to_module.cc index 5b9c33f8..3c339870 100644 --- a/src/common/linux/dwarf_cu_to_module.cc +++ b/src/common/linux/dwarf_cu_to_module.cc @@ -27,6 +27,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// Implement the DwarfCUToModule class; see dwarf_cu_to_module.h. + #include <algorithm> #include <cassert> @@ -168,6 +172,10 @@ class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler { // DIE is a declaration DIE, to be cited by other DIEs' // DW_AT_specification attributes, record its enclosing name and // unqualified name in the specification table. + // + // Use this from EndAttributes member functions, not ProcessAttribute* + // functions; only the former can be sure that all the DIE's attributes + // have been seen. string ComputeQualifiedName(); CUContext *cu_context_; @@ -204,6 +212,11 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference( uint64 data) { switch (attr) { case dwarf2reader::DW_AT_specification: { + // Find the Specification to which this attribute refers, and + // set specification_ appropriately. We could do more processing + // here, but it's better to leave the real work to our + // EndAttribute member function, at which point we know we have + // seen all the DIE's attributes. FileContext *file_context = cu_context_->file_context; SpecificationByOffset *specifications = &file_context->file_private->specifications; diff --git a/src/common/linux/dwarf_cu_to_module.h b/src/common/linux/dwarf_cu_to_module.h index c8d6469a..9b33af9a 100644 --- a/src/common/linux/dwarf_cu_to_module.h +++ b/src/common/linux/dwarf_cu_to_module.h @@ -29,6 +29,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// Add DWARF debugging information to a Breakpad symbol file. This +// file defines the DwarfCUToModule class, which accepts parsed DWARF +// data and populates a google_breakpad::Module with the results; the +// Module can then write its contents as a Breakpad symbol file. + #ifndef COMMON_LINUX_DWARF_CU_TO_MODULE_H__ #define COMMON_LINUX_DWARF_CU_TO_MODULE_H__ diff --git a/src/common/linux/dwarf_cu_to_module_unittest.cc b/src/common/linux/dwarf_cu_to_module_unittest.cc index 73f81c5d..d9e4ac0a 100644 --- a/src/common/linux/dwarf_cu_to_module_unittest.cc +++ b/src/common/linux/dwarf_cu_to_module_unittest.cc @@ -27,6 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + // dwarf_cu_to_module.cc: Unit tests for google_breakpad::DwarfCUToModule. #include <vector> diff --git a/src/common/linux/dwarf_line_to_module.cc b/src/common/linux/dwarf_line_to_module.cc index f3fa527c..bc1cd507 100644 --- a/src/common/linux/dwarf_line_to_module.cc +++ b/src/common/linux/dwarf_line_to_module.cc @@ -27,6 +27,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// dwarf_line_to_module.cc: Implementation of DwarfLineToModule class. +// See dwarf_line_to_module.h for details. + #include "common/linux/dwarf_line_to_module.h" // Trying to support Windows paths in a reasonable way adds a lot of diff --git a/src/common/linux/dwarf_line_to_module.h b/src/common/linux/dwarf_line_to_module.h index 5cba7530..ab8bf11d 100644 --- a/src/common/linux/dwarf_line_to_module.h +++ b/src/common/linux/dwarf_line_to_module.h @@ -29,6 +29,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// The DwarfLineToModule class accepts line number information from a +// DWARF parser and adds it to a google_breakpad::Module. The Module +// can write that data out as a Breakpad symbol file. + #ifndef COMMON_LINUX_DWARF_LINE_TO_MODULE_H #define COMMON_LINUX_DWARF_LINE_TO_MODULE_H diff --git a/src/common/linux/dwarf_line_to_module_unittest.cc b/src/common/linux/dwarf_line_to_module_unittest.cc index 4f3ff3af..4b9743ce 100644 --- a/src/common/linux/dwarf_line_to_module_unittest.cc +++ b/src/common/linux/dwarf_line_to_module_unittest.cc @@ -27,6 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + // dwarf_line_to_module.cc: Unit tests for google_breakpad::DwarfLineToModule. #include "breakpad_googletest_includes.h" diff --git a/src/common/linux/language.cc b/src/common/linux/language.cc index 980bb8a5..5e6473a1 100644 --- a/src/common/linux/language.cc +++ b/src/common/linux/language.cc @@ -27,6 +27,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// language.cc: Subclasses and singletons for google_breakpad::Language. +// See language.h for details. + #include "common/linux/language.h" namespace google_breakpad { diff --git a/src/common/linux/language.h b/src/common/linux/language.h index 26792c6d..03bdf7f0 100644 --- a/src/common/linux/language.h +++ b/src/common/linux/language.h @@ -29,8 +29,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// language.h: defines google_breakpad::Language, providing -// language-specific operations for use by the dumper. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// language.h: Define google_breakpad::Language. Instances of +// subclasses of this class provide language-appropriate operations +// for the Breakpad symbol dumper. #ifndef COMMON_LINUX_LANGUAGE_H__ #define COMMON_LINUX_LANGUAGE_H__ diff --git a/src/common/linux/module.cc b/src/common/linux/module.cc index 3d190745..bd0ae9f9 100644 --- a/src/common/linux/module.cc +++ b/src/common/linux/module.cc @@ -27,6 +27,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// module.cc: Implement google_breakpad::Module. See module.h. + #include <cerrno> #include <cstring> diff --git a/src/common/linux/module.h b/src/common/linux/module.h index a2f179c2..eeda305e 100644 --- a/src/common/linux/module.h +++ b/src/common/linux/module.h @@ -29,7 +29,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// module.h: defines google_breakpad::Module, for writing breakpad symbol files +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// module.h: Define google_breakpad::Module. A Module holds debugging +// information, and can write that information out as a Breakpad +// symbol file. #ifndef COMMON_LINUX_MODULE_H__ #define COMMON_LINUX_MODULE_H__ diff --git a/src/common/linux/module_unittest.cc b/src/common/linux/module_unittest.cc index 6ce82243..d289f132 100644 --- a/src/common/linux/module_unittest.cc +++ b/src/common/linux/module_unittest.cc @@ -27,7 +27,9 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// module_unittest.cc: Unit tests for google_breakpad::Module +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// module_unittest.cc: Unit tests for google_breakpad::Module. #include <cerrno> #include <cstdio> diff --git a/src/common/linux/stabs_reader.cc b/src/common/linux/stabs_reader.cc index 84d680e2..e8341d30 100644 --- a/src/common/linux/stabs_reader.cc +++ b/src/common/linux/stabs_reader.cc @@ -26,7 +26,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + // This file implements the google_breakpad::StabsReader class. +// See stabs_reader.h. #include <a.out.h> #include <stab.h> diff --git a/src/common/linux/stabs_reader.h b/src/common/linux/stabs_reader.h index 098b50ae..5cfcdfb5 100644 --- a/src/common/linux/stabs_reader.h +++ b/src/common/linux/stabs_reader.h @@ -28,15 +28,20 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// This file contains definitions related to the STABS reader and -// its handler interfaces. -// A description of the STABS debugging format can be found at -// http://sourceware.org/gdb/current/onlinedocs/stabs_toc.html +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// stabs_reader.h: Define StabsReader, a parser for STABS debugging +// information. A description of the STABS debugging format can be +// found at: +// +// http://sourceware.org/gdb/current/onlinedocs/stabs_toc.html +// // The comments here assume you understand the format. // -// This reader assumes that the system's <a.out.h> and <stab.h> +// This parser assumes that the system's <a.out.h> and <stab.h> // headers accurately describe the layout of the STABS data; this code -// is not cross-platform safe. +// will not parse STABS data for a system with a different address +// size or endianness. #ifndef COMMON_LINUX_STABS_READER_H__ #define COMMON_LINUX_STABS_READER_H__ diff --git a/src/common/linux/stabs_reader_unittest.cc b/src/common/linux/stabs_reader_unittest.cc index 1fbdfee3..88fcfe67 100644 --- a/src/common/linux/stabs_reader_unittest.cc +++ b/src/common/linux/stabs_reader_unittest.cc @@ -27,7 +27,9 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// stabs_reader_unittest.cc: Unit tests for StabsReader. +// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com> + +// stabs_reader_unittest.cc: Unit tests for google_breakpad::StabsReader. #include <a.out.h> #include <cassert> |