From c50e7c604cd1b12bba9421b0a95357fc942ecd7c Mon Sep 17 00:00:00 2001 From: jimblandy Date: Tue, 9 Feb 2010 17:10:57 +0000 Subject: Breakpad Linux dumper: Add file comments as required by the style guide. This also includes some comments I promised Cary Coutant I'd write about the appropriateness of processing attributes in EndAttributes calls. The Google C++ Style Guide requires each file to have an author notice and a comment explaining the file's general purpose. For the record, I don't think putting an author notice on the files is a good idea; it's odd to have the original author retain prominence even if the file has been heavily edited by others; the version control system answers this question more accurately. This is only for Style Guide compliance. The Apache group decided to discourage author annotations, partially for these reasons: http://mail-archives.apache.org/mod_mbox/jakarta-jmeter-dev/200402.mbox/%3C4039F65E.7020406@atg.com%3E a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@518 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/linux/dump_stabs.cc | 2 ++ src/common/linux/dump_stabs.h | 6 +++++- src/common/linux/dump_stabs_unittest.cc | 2 ++ src/common/linux/dump_symbols.cc | 5 +++++ src/common/linux/dump_symbols.h | 6 +++--- src/common/linux/dwarf_cu_to_module.cc | 13 +++++++++++++ src/common/linux/dwarf_cu_to_module.h | 7 +++++++ src/common/linux/dwarf_cu_to_module_unittest.cc | 2 ++ src/common/linux/dwarf_line_to_module.cc | 5 +++++ src/common/linux/dwarf_line_to_module.h | 6 ++++++ src/common/linux/dwarf_line_to_module_unittest.cc | 2 ++ src/common/linux/language.cc | 5 +++++ src/common/linux/language.h | 7 +++++-- src/common/linux/module.cc | 4 ++++ src/common/linux/module.h | 6 +++++- src/common/linux/module_unittest.cc | 4 +++- src/common/linux/stabs_reader.cc | 3 +++ src/common/linux/stabs_reader.h | 17 +++++++++++------ src/common/linux/stabs_reader_unittest.cc | 4 +++- 19 files changed, 91 insertions(+), 15 deletions(-) (limited to 'src/common/linux') 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 + // dump_stabs.cc --- implement the DumpStabsHandler class. #include 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 + +// 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 + // dump_stabs_unittest.cc: Unit tests for DumpStabsHandler. #include 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 + +// dump_symbols.cc: implement google_breakpad::WriteSymbolFile: +// Find all the debugging info in a file and dump it as a Breakpad symbol file. + #include #include #include 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 + +// Implement the DwarfCUToModule class; see dwarf_cu_to_module.h. + #include #include @@ -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 + +// 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 + // dwarf_cu_to_module.cc: Unit tests for google_breakpad::DwarfCUToModule. #include 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 + +// 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 + +// 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 + // 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 + +// 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 + +// 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 + +// module.cc: Implement google_breakpad::Module. See module.h. + #include #include 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 + +// 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 + +// module_unittest.cc: Unit tests for google_breakpad::Module. #include #include 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 + // This file implements the google_breakpad::StabsReader class. +// See stabs_reader.h. #include #include 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 + +// 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 and +// This parser assumes that the system's and // 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 + +// stabs_reader_unittest.cc: Unit tests for google_breakpad::StabsReader. #include #include -- cgit v1.2.1