Commit Graph

543 Commits

Author SHA1 Message Date
jimblandy
32d1b2882b Typo: "An" -> "A".
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@496 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-23 01:22:32 +00:00
jimblandy
bc64ee962f Breakpad DWARF Parser: Improved DWARF-processing interface.
dwarf2reader::CompilationUnit is a simple and direct parser for DWARF
data, but its handler interface is not convenient to use. In
particular, the same handler object receives data about all DIEs
processed. One can't use distinct classes to separate the information
needed to handle different kinds of data.

This patch defines a new adapter type, dwarf2reader::DIEHandler, which
implements the existing DWARF parser's handler interface, given a
handler written to a more comfortable, object-orient interface. The
comments in dwarf2diehandler.h provide more detail.

a=jimblandy, r=ccoutant


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@495 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-23 01:20:55 +00:00
jimblandy
8bfcc2683f Breakpad DWARF Reader: Change LineInfoHandler::AddLine to provide the line's length.
Breakpad's DWARF line number info parser provides a code address,
file, and line number for each code/source pairing, but doesn't
provide the length of the machine code. This makes that change, as
discussed in the following thread:

http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/ed8d2fde79319368p

This patch also makes the corresponding changes to the functioninfo.cc
module, used by the Mac dumper. This patch has no effect on the Mac
dumper's output.

a=jimblandy, r=ccoutant


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@494 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-22 23:30:36 +00:00
jimblandy
e15bffe466 Breakpad DWARF Reader: Also look for DWARF in sections with the proper names.
The DWARF specification specifices which names the sections containing
DWARF information should have. OSX uses slightly different names. This
patch changes the DWARF reader to look for the sections under both
sets of names.

a=jimblandy, r=ccoutant


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@493 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-22 23:26:12 +00:00
jimblandy
f4a106d4b5 Add new file missed in r490.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@492 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-14 23:08:24 +00:00
jimblandy
2684b4dc19 Breakpad processor: Don't pass Windows stack walking information to all walkers.
At the moment, the StackWalker GetCallerFrame member function expects
a vector of WindowsFrameInfo structures, even though WindowsFrameInfo
is only used or useful on one one implementation (StackWalkerX86).

This patch changes StackWalker::GetCallerFrame to no longer expect the
WindowsFrameInfo structures, and changes all implementations to match.

In particular, StackWalkerX86 is changed to find the WindowsFrameInfo
data itself, and store a pointer to whatever it got in the StackFrame
object itself (which is really a StackFrameX86).

To allow GetCallerFrame implementations to look up stack walking data,
StackWalker::resolver_ needs to be made protected, not private.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@491 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-14 19:17:36 +00:00
jimblandy
5251e64f48 Breakpad Linux dumper: STABS reader incorrectly assumes a single compilation unit
The stabs reading code in google-breakpad incorrectly assumes that the
stabs data is a single compilation unit. Specifically, it ignores
N_UNDF stabs and assumes that all string indices are relative to the
beginning of the .stabstr section.

This is true when linking with the GNU linker by default, because the
GNU linker optimizes stabs debug info. The gold linker does not do
this optimization. It can be disabled when using the GNU linker with
the --traditional-format command line option.

For more details of the problem, see:

http://sourceware.org/bugzilla/show_bug.cgi?id=10338
http://code.google.com/p/google-breakpad/issues/detail?id=359

This patch adds unit tests that reproduce the failure, and fixes the
stabs parser.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@490 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-14 17:19:34 +00:00
jimblandy
7b873221e6 Linux Breakpad Dumper: support running unit tests under valgrind or other wrapper programs.
This adds a new variable, TEST_WRAPPER, to src/tools/linux/dump_syms.
Comments in the patch provide details.

This patch also moves the public variable section to sit after the
public phony targets.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@486 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-13 07:41:22 +00:00
jimblandy
eef5ccc61f Breakpad processor: Opening a map file is not an error.
a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@485 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-13 07:39:24 +00:00
jimblandy
cf55ca5b5c Breakpad: Fix Emacs mode settings mingled with copyright notice text.
a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@484 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-12 19:51:14 +00:00
nealsid
e7b2043dd2 Move file_id.cc from test_src to lib_src
A=nealsid
R=ted.mielczarek



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@483 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-12 19:20:39 +00:00
jimblandy
330ca2f7c7 Google Breakpad DWARF reader: Add a handler function for DIE references.
Add a new member function to dwarf2reader::Dwarf2Handler,
ProcessAttributeReference, for reporting attribute values that are
references to other DIEs. This handler member function always receives
an absolute offset (that is, relative to the start of the .debug_info
section, not to the start of the compilation unit), regardless of the
form the attribute uses. (Some forms are CU-relative, some are
absolute.)

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@482 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-12 16:53:02 +00:00
jimblandy
0441036f9e Breakpad: Avoid warnings building with G++ 4.4.1 using -O3 -Wall.
src/processor/minidump.cc:1067: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 3 has type ‘unsigned int’
src/processor/stackwalker_arm.cc:83: warning: unused variable ‘last_frame’
src/processor/minidump_stackwalk.cc:163: warning: ‘trust_name’ may be used uninitialized in this function

a=jimblandy, r=ted.mielczarek


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@481 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-12 16:41:13 +00:00
jimblandy
e9faf54828 Issue 49013: Breakpad Processor: Use a separate API to retrieve Windows stack debugging info.
At the moment, FillSourceLineInfo returns Windows DIA-based stack
walking data. In addition to being ugly, this makes it difficult to
provide access to DWARF CFI-based stack walking data in a symmetrical
way.

This patch changes FillSourceLineInfo to do the single job its name
suggests, and adds a second member function to
SourceLineResolverInterface to retrieve Windows DIA stack walking
information. A sibling member function will provide access to DWARF
CFI stack walking data.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@480 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-11 22:31:50 +00:00
jimblandy
5b787b1911 Breakpad DWARF Reader: Add DWARF language enumeration values.
a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@479 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-11 22:23:05 +00:00
nealsid
2832dc011c Patch from Kris Rambish to keep memory usage flat when processing a directory full of minidump files
A=krisr
R=nealsid



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@478 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-11 21:24:43 +00:00
nealsid
c65d3e6206 INclude stackwalker_arm.{cc,h} in crash_report build
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@477 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-11 20:26:22 +00:00
nealsid
718478d95d Fix solaris build break
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@476 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-08 23:04:14 +00:00
stuart.morgan
910f68a5d4 Make Mac comment and email text field placeholders localizable. r=nealsid
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@475 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-01 00:21:18 +00:00
stuart.morgan
6f50ca38bb Add email mapping for Socorro. r=nealsid
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@474 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-01-01 00:17:33 +00:00
jimblandy
b64d76a3b8 Issue 49012: Breakpad Processor: Rename 'StackFrameInfo' structure to 'WindowsFrameInfo'.
Also, rename stack_frame_info.h to windows_frame_info.h.

If it seems odd to have functions like FillSourceLineInfo returning
Windows-specific data structures... well, it is! This patch just makes
it more obvious what's going on.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@471 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 22:32:14 +00:00
jimblandy
92b1f834d1 Breakpad: Regenerate build files with latest versions of autotools.
This patch refreshes the build system files to those generated by:
- Libtool 2.2.6
- Automake 1.11
- Autoconf 2.64

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@470 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 22:23:49 +00:00
jimblandy
5ebd6507e3 Breakpad processor: Use unsigned constants in comparisons, to quiet compiler warnings.
This patch avoids comparisons between signed and unsigned values, as
warned about by G++ 4.4.1.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@469 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 22:01:57 +00:00
jimblandy
0468306245 Breakpad Linux Dumper: Fix up comments in google_breakpad::Module interface.
Use the term "own", since ownership is the concept at work here.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@468 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 21:56:41 +00:00
jimblandy
c823931376 Issue 49003: Breakpad Linux Dumper: Add unit tests for STABS dumper.
Previous patches added unit tests for the STABS parser and the
Breakpad symbol file writer; this adds unit tests for the "dumper"
class that sits between them, receiving data from the parser and
handing it to the writer.  So now the whole pathway has coverage.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@467 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 21:50:01 +00:00
jimblandy
52cb2c6f42 Breakpad Linux dumper: Add unit tests for google_breakpad::Module.
Adjust Module's interface a bit to facilitate testing:
- Make AssignSourceIds something a client can call --- it's perfectly
  well-defined, so this is an okay change.
- Add GetFunctions, GetFiles and FindExistingfile member functions,
  which the test harness will use to get results to examine.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@466 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 21:46:00 +00:00
jimblandy
6ed5383245 Breakpad Linux Dumper: Use proper sizes and radixes when writing Breakpad symbol files.
A FUNC record's parameter size is also hexadecimal, and all values are
64 bits wide.

A line record's address and size are 64 bits wide.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@465 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 21:15:23 +00:00
jimblandy
5a6e1d3f03 Breakpad Linux dumper: move DumpStabsHandler into its own file, for testing.
This will make it easier to write unit tests for DumpStabsHandler.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@464 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 21:13:11 +00:00
ted.mielczarek
9f211b4283 fix compilation on 64-bit, followup from issue 357
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@463 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 20:44:32 +00:00
ted.mielczarek
0a5fc5d663 Issue 357: New Linux file_id code doesn't persist across strip. r=agl,nealsid at http://breakpad.appspot.com/49008
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@461 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 17:09:27 +00:00
ted.mielczarek
1adb184d42 fix a badly-applied patch, and also re-run automake which I forgot to do
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@455 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-21 13:12:20 +00:00
ted.mielczarek
9276b0d301 Basic arm cpu support for processor. r=mark at http://breakpad.appspot.com/49011
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@454 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-19 21:43:53 +00:00
jimblandy@gmail.com
7a77f45f79 Breakpad DWARF parser: Fix up documentation for DWARF reader classes.
Fix typos.

For CompilationUnit::Start, I was confused by the '-' in the original
comment, taking it for a parenthetic clause marker, assuming an
implicit "of the next compilation unit" at the end of the sentence.

The comments should refer to the ".debug_info" section, not the
"debug_info" section. The latter is not the section name actually used
on any system (ELF or Mach-O), and the former is the name prescribed
by the DWARF spec.

Some of the comments for ProcessAttribute* member functions claim that
OFFSET is from the start of the compilation unit, but that's not so:
the code has always passed an offset relative to the start of the
.debug_info section.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@453 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-18 22:57:54 +00:00
nealsid
e4ffacd0d8 Fix build break for 64-bit compilation.
A=Gregory Dardyk
R=nealsid



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@452 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-17 23:00:12 +00:00
brdevmn
f7f9dfcab6 Added on-demand minidump generation for Linux, and a Linux test app.
A=brdevmn
R=mochalatte

Code review: http://breakpad.appspot.com/48001/show



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@451 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-16 20:10:57 +00:00
jimblandy@gmail.com
5fb436d5bb Issue 41004: Breakpad DWARF parser: fixes to compile without warnings under GNU C++ 4.3.3.
a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@450 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 17:25:27 +00:00
jimblandy@gmail.com
315c4f6b20 Issue 41003: Breakpad DWARF parser: Include <cstdio>, since we use it
src/common/dwarf/dwarf2reader.cc uses the old-fashioned <stdio.h>
facilities to report errors. Ideally, we would add a 'Warning' message
to the handler and make the client responsible for dealing with the
errors, but this at least allows us to compile.

Ubuntu 9.10 uses GCC 4.4.1; under older versions of GCC, this wasn't a
problem, probably because stdio.h was being brought in inadvertently
somewhere else.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@449 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 17:23:43 +00:00
jimblandy@gmail.com
bdd7ca54cd Issue 42002: Breakpad DWARF parser: avoid using <stdint.h> type
It seems that a use of the <stdint.h> type uintptr_t has crept into
the DWARF parser. This defines a workaround for the GNU compilers
(tested on both Mac and Linux) which will raise an error if it doesn't
work.

My personal preference would be just to assume that the <stdint.h>
header is available and use the standard types everywhere, but 1) that
would be a large change, likely to make merges with the other branches
of the DWARF parser more difficult, and 2) it would make it quite
difficult to build under Microsoft Visual Studio, which doesn't have
the <stdint.h> header; Microsoft has said they have no plans to
provide it, as they would rather "focus their efforts" on C++ and
.NET.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@448 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 17:21:14 +00:00
jimblandy@gmail.com
07466260e2 Issue 42001: Breakpad Linux Dumper: remove compilation warnings in guid_creator.cc.
Building on Ubuntu 9.10 with the distributed compiler (GCC 4.4.1), we get
warnings like the following:

guid_creator.cc:56: warning: dereferencing type-punned pointer will break strict-aliasing rules

It doesn't matter in this case, but there's no crying need to use
reinterpret casts in an endian-dependent way when there are plenty of
well-defined ways to get the same effect.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@447 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 17:11:54 +00:00
jimblandy@gmail.com
4969cfc647 Issue 39002: Breakpad DWARF parser: Move DWARF parser to platform-independent directory.
Move the DWARF parser, and the functioninfo.cc DWARF consumer, from
src/common/mac/dwarf to src/commmon/dwarf, so that it can be shared
between the Mac and Linux dumpers.

Fix up #include directives, multiple inclusion protection macros, and
Xcode build files.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@446 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 17:06:21 +00:00
jimblandy@gmail.com
08fecb2e43 Issue 26001: Linux dumper: fix comments in STABS reader
Typos; ambiguities; dangling references to arguments whose names got
changed.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@445 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 16:58:37 +00:00
jimblandy@gmail.com
7f941f990a Linux dumper: Add unit tests for google_breakpad::StabsReader.
The test system is based on Google C++ Testing Framework and the
Google C++ Mocking Framework.

This includes a parser that turns human-readable input files ("mock
stabs") into .stab and .stabstr section contents, which we can then
pass to a StabsReader instance, using a handler object written with
GoogleMock. The 'make check' target in src/tools/linux/dump_syms runs
this.

The supplied input file is pretty small, but I've done coverage
testing, and it does cover the parser.

I thought the mock stabs parser would be less elaborate than it turned
out to be. Lesson learned.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@444 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 16:54:44 +00:00
jimblandy@gmail.com
0397da8e08 Issue 25003: Linux dumper: Fix infinite loop in stabs parser.
If the input passed to a StabsReader instance contains a compilation
unit whose first entry is an N_SO with no name, the parser enters an
infinite loop.  Since such entries mark the end of a compilation unit,
ProcessCompilationUnit should skip them.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@443 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 16:34:02 +00:00
jimblandy@gmail.com
bb846bdc98 Issue 25002: Linux symbol dumper: Require STABS consumers to provide a Warning member.
The StabsHandler class should not provide a fallback definition for
its Warning member function that just throws away warning messages.
It should require the consumer to provide an appropriate definition.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@442 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 16:32:32 +00:00
jimblandy@gmail.com
1c9c0568e0 Issue 39001: Breakpad Linux dumper: Refactor Makefile.
Use GNU Make features to make the dumper, unit tests, and maintenance
targets more independent, so I get fewer conflicts as I work on
different parts of the patch series.

In particular:
- Provide targets to run tests and produce test coverage reports.
- Gather C and C++ build rules in one place.
- Avoid variables that list object files, as pattern rules can compute
  these values directly from the dependencies.
- Use VPATH to find sources in other directories.

a=jimb, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@441 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-15 16:28:43 +00:00
ted.mielczarek
9dcc03f47d Mozilla bug 532713 - OS X client code doesn't decoded extended family ids in CPU info. Patch by Jeff Muizelaar <jmuizelaar@mozilla.com>, r=me
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@440 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-14 11:47:53 +00:00
nealsid
bb618860df Fix some build warnings
A=zhurunz
R=nealsid



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@439 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-10 19:15:44 +00:00
ted.mielczarek
0cbd50c975 Allow Minidump class to be instantiated with stream instead of file. r=mark at http://breakpad.appspot.com/46001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@438 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-09 01:24:37 +00:00
ted.mielczarek
d95a88c3f1 remove trailing comma from enum definition to make it compile with -pedantic
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@437 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-03 20:58:31 +00:00
ted.mielczarek
72a2bff592 issue 330 - linux_syscall_support.h has extra semicolons causing compilation to fail with certain gcc options. Patch by Josh Aas <joshmoz@gmail.com>, r=me
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@436 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-03 18:16:31 +00:00