aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux
diff options
context:
space:
mode:
authorjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-02-09 17:10:57 +0000
committerjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-02-09 17:10:57 +0000
commitc50e7c604cd1b12bba9421b0a95357fc942ecd7c (patch)
tree04bb8865b5b3a065d69b843cf904027b5d3c19b7 /src/common/linux
parentBreakpad: Update copyright notice years on all files changed in 2010. (diff)
downloadbreakpad-c50e7c604cd1b12bba9421b0a95357fc942ecd7c.tar.xz
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
Diffstat (limited to 'src/common/linux')
-rw-r--r--src/common/linux/dump_stabs.cc2
-rw-r--r--src/common/linux/dump_stabs.h6
-rw-r--r--src/common/linux/dump_stabs_unittest.cc2
-rw-r--r--src/common/linux/dump_symbols.cc5
-rw-r--r--src/common/linux/dump_symbols.h6
-rw-r--r--src/common/linux/dwarf_cu_to_module.cc13
-rw-r--r--src/common/linux/dwarf_cu_to_module.h7
-rw-r--r--src/common/linux/dwarf_cu_to_module_unittest.cc2
-rw-r--r--src/common/linux/dwarf_line_to_module.cc5
-rw-r--r--src/common/linux/dwarf_line_to_module.h6
-rw-r--r--src/common/linux/dwarf_line_to_module_unittest.cc2
-rw-r--r--src/common/linux/language.cc5
-rw-r--r--src/common/linux/language.h7
-rw-r--r--src/common/linux/module.cc4
-rw-r--r--src/common/linux/module.h6
-rw-r--r--src/common/linux/module_unittest.cc4
-rw-r--r--src/common/linux/stabs_reader.cc3
-rw-r--r--src/common/linux/stabs_reader.h17
-rw-r--r--src/common/linux/stabs_reader_unittest.cc4
19 files changed, 91 insertions, 15 deletions
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>