Commit Graph

527 Commits

Author SHA1 Message Date
hansl@google.com
7b106e34ba Changed two files end-line to make it work better with GYP. They were DOS (CR/LF), now they are UNIX (CR).
It seems like the base gyp scripts on Windows were confused about this and didn't handle it well, while using gyp through gclient worked perfectly. I did not investigate the causes further.

Review URL: http://codereview.chromium.org/2128003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@599 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-14 18:43:43 +00:00
nealsid
951583a8ca Fix for uninitialized variable in basic_source_line_resolver.cc
R=TBR
A=nealsid



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@598 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-13 22:21:00 +00:00
hansl@google.com
bcf885c807 Added a death test for the pure virtual function call.
Added a test for the minidump generated by a pure virtual function call.
Changed the pure virtual function call handler so that it creates a minidump with Exception info and a stack.

Review URL: http://codereview.chromium.org/2050013

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@597 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-13 21:00:43 +00:00
hansl@google.com
8cf0a52bec Moved exception_handler_test to the more aptly named exception_handler_death_test. It doesn't test anything else than death and exit.
Created the exception_handler_test that test the generation of dump and the dumps themselves.
Moved all dump analysis code from minidump to its right class DumpAnalysis. The class is used by both minidump_test and exception_handler_test. The tests are way simpler that way (ie. no handling of HANDLE).
minidump_test now uses the minidump_generator class instead of using Win32. It works well and pass all tests.
exception_handler now passes both the exception and assertion infos to the client to generate the dump. If one is NULL it's going to be handled correctly.
crash_generation_client can now RequestDump with both exception and assertion info.
minidump_generator returns both the mini and full dump string pointers, and output both (or either) depending on which was generated.
All original interfaces and method signature are still there, but call the new functions if possible.

Review URL: http://codereview.chromium.org/1994015

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@596 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-12 17:51:21 +00:00
nealsid
7d0d107b17 Adding prebuilt dump_syms.exe.
Http://breakpad.appspot.com/issues/111001

A=nealsid
R=mark mentovai



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@595 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-11 21:25:13 +00:00
nealsid
3d0b3be6c0 This checkin of the binaries was created by refresh_binaries.bat.
Date: Mon 05/10/2010 15:55:34.46 
Repository information (output of 'svn info') follows: 
Path: .
URL: https://google-breakpad.googlecode.com/svn/trunk/src
Repository Root: https://google-breakpad.googlecode.com/svn
Repository UUID: 4c0a9323-5329-0410-9bdc-e9ce6186880e
Revision: 593
Node Kind: directory
Schedule: normal
Last Changed Author: nealsid
Last Changed Rev: 593
Last Changed Date: 2010-05-10 13:35:54 -0700 (Mon, 10 May 2010)



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@594 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-10 22:55:45 +00:00
nealsid
6bc523c618 Changes to fix build warnings on newer versions of GCC, and a fix to not try to open certain mapped files.
A=ZhurunZ, Tristan Schmelcher
R=nealsid



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@593 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-10 20:35:54 +00:00
hansl@google.com
297b1e5a06 Copied minidump_test.cc from chrome_frame (see http://src.chromium.org/viewvc/chrome/trunk/src/chrome_frame/crash_reporting/minidump_test.cc).
I had to remove the dependency from base (was using FilePath and ScopedHandle, replaced them by standard std::wstring and HANDLE). Also removed the logging and the main from the original files.

This will serve as a base for testing breakpad's dump generation. It is kept like this for easier tracking.

Review URL: http://codereview.chromium.org/1964006

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@592 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 21:38:18 +00:00
jimblandy
f6163f1e29 Breakpad Mac dumper: Clean up XCode project file.
The XCode project file has become encrufted with duplicate Executable
entres and some strange settings. This patch deletes and recreates various
entries to make things neat again. It should have no effect on the
project's visible behavior.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@591 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 18:18:28 +00:00
jimblandy
073a7f6695 Breakpad unit tests: Add support for clipped-size null-terminated strings
to TestAssembler::Section.

This patch helps the TestAssembler classes generate Mach-O object files for
use as test input.

This patch adds a new AppendCString overloading to TestAssembler::Section
for emitting null-terminated strings in fixed-length buffers, where the
string is truncated and the terminating null character omitted if the
string is too large for the buffer.

The patch includes unit tests for the new AppendCString overloading. It
also provides some for the existing overloading, which had been neglected.

a=jimblandy, r=mark


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@590 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:37:58 +00:00
jimblandy
52a508dfe2 Breakpad Mac Dumper: Fix compilation warnings on OS X 10.6
Breakpad's Macintosh symbol dumper uses deprecated functions for
dealing with mixed-endianness code. This patch provides an overloaded
function, ByteSwap, that automatically chooses the OSSwap* functions
from <libkern/OSByteOrder.h> appropriate for its argument's
size.

This patch does *not* address warnings in src/common/mac/dump_syms.mm,
because that code is about to be replaced entirely; there's no reason to
bother reviewing a big, detailed patch against it.

a=jimblandy, r=mark


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@589 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:36:16 +00:00
jimblandy
25b512d64d Breakpad symbol dumper: Promise that Module::SetLoadAddress can be called at any time.
It's possible to imagine an implementation of google_breakpad::Module in
which calling SetLoadAddress at different times as the Module is populated
would produce different output. For the Mac dumper, we'd like to depend on
its current behavior --- that the load address is subtracted off only when
writing the symbol file, and can be set at any time prior to that.

This patch makes that promise part of Module's contract, and adjusts the
test suite to verify that that promise is met.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@588 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:35:10 +00:00
jimblandy
775c6f7640 Breakpad Linux dumper: Handle STABS-in-symbol-table, and line number records outside functions.
This patch addresses two differences between Linux and Macintosh OS X STABS
data:

- StabsReader assumes that the STABS entries follow the conventions for
  storing STABS data in object file sections (that is, .stabs and
  .stabstr), rather than in the object files's linker symbol table. On Mac
  OS X, STABS entries live in the Mach-O file's LC_SYMTAB load command,
  along with all the other linker symbols; they are not grouped into units
  by N_UNDF entries.

  This patch adds a boolean argument to the StabsReader constructor
  indicating whether the parser should treat N_UNDF entries as unit
  boundaries; this argument should be true on Linux, and false on Mac. The
  patch changes src/common/linux/dump_symbols.cc to pass this new argument.

- Mac OS X STABS place SLINE (line number) records immediately before the
  FUN record for the function to which they belong, and the values of such
  records are absolute, not relative to the function start.

  This patch extends the parser to queue up such records and report them to
  the handler when we do see the FUN record. The meaning of
  StabsHandler::Line remains unchanged; existing handlers do not need to be
  adjusted.

This patch also adds unit tests for the new parser behaviors.

a=jimblandy, r=mark


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@587 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:34:19 +00:00
jimblandy
d3e4bbb9c7 Breakpad STABS parser: Use a test fixture in StabsReader unit tests.
This patch factors out some of the common code in the StabsReader unit
tests into a fixture class. Pretty mechanical.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@586 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:25:47 +00:00
jimblandy
deb500f6c8 Breakpad STABS reader: Properly compute function end addresses.
An N_FUN stabs with no name is an explicit end-of-function marker, whose
value is the size of the function. This patch changes the stabs reader to
recognize these and use them to compute the function's ending address,
instead of treating them as functions with no names and mysterious
addresses. It also adds appropriate unit tests.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@585 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:13:42 +00:00
jimblandy
b28be1254c Breakpad Linux dumper: Rename DumpStabsHandler to StabsToModule.
All the other classes which receive debugging data from some sort of parser
and use it to populate a Module have names ending in "ToModule":
DwarfCUToModule, DwarfCFIToModule. Also, DumpStabsHandler doesn't actually
dump anything.

This patch renames the DumpStabsHandler class to StabsToModule, which is
more consistent and descriptive.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@584 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:12:38 +00:00
jimblandy
b0ec96cee2 Breakpad Linux dumper: Make StabsReader independent of endianness and word size.
StabsReader simply applies a reinterpret_cast to treat the stab entry data
as an array of 'struct nlist' structures, making the parser specific on the
host endianness, word size, and alignment rules. On Mac OS X, a single fat
binary file may contain object files of different ABIs, of which the user
chooses one at run time.

This patch changes the parser to read the data using the google_breakpad::
ByteCursor class, which can handle different endiannesses and word sizes.
The StabsReader constructor now takes arguments indicating the endianness
of the data and the size of each entry's value field. The patch changes
src/common/linux/dump_symbols.cc to pass the new argument.

This patch changes the StabsReader unit tests to use the google_breakpad::
TestAssembler classes to generate test data, rather than reading it from a
file. This makes it easy to generate test data in various endiannesses and
word sizes. It also adds tests for the new parser behaviors.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@583 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:09:20 +00:00
jimblandy
6c97801617 Breakpad symbol dumper: Define the ByteBuffer and ByteCursor classes.
The ByteBuffer and ByteCursor classes are utility classes for reading
binary files, handling endianness and word size issues in a portable way.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@582 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-05 17:07:23 +00:00
hansl@google.com
ffedcd4945 Replacing solutions with gyp files. Moving tests for windows clients in unittests.
Review URL: http://codereview.chromium.org/1687018

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@581 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-05-03 20:21:40 +00:00
nealsid
eee511f1df Fix dependency on Visual C++ 9 introduced by revision 557.
A=nealsid
r=mmentovai

http://breakpad.appspot.com/105001/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@580 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-29 22:32:32 +00:00
ted.mielczarek
c90769edd6 Fix assembly in the ARM sys_clone implementation to indicate that r7 is clobbered, and also remove some extraneous semicolons from ARM portions of linux_syscall_support. r=jimb at https://bugzilla.mozilla.org/show_bug.cgi?id=555674
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@579 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-29 18:24:04 +00:00
ted.mielczarek
131c0c6a83 issue 372 - fix Mac OS X minidump generation code to handle x86-64 properly. r=mark at http://breakpad.appspot.com/103001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@578 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-29 18:02:42 +00:00
nealsid
f2dfb88b2a Fix include paths to be consistent with rest of project
http://breakpad.appspot.com/104001

A=nealsid



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@577 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-28 23:03:59 +00:00
jimblandy
56e7a3c65d Breakpad Linux Dumper: Have DumpStabsHandler free accumulated functions if Finalize is not called
The DumpStabsHandler class creates Module::Function objects as it processes
data from the StabsReader, but waits to add the Functions to the Module
until all parsing is complete and its Finalize member function is called,
so that it can compute line and function end addresses that the STABS data
may have left implicit.

If the DumpStabsHandler is destructed before its Finalize method is called,
it fails to free the Functions it has created, but not yet added to the
Module. (Adding a Function to a Module transfers ownership of the Function
to the Module.)

This adds a destructor to DumpStabsHandler which takes care of freeing any
Functions that it still owns.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@576 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-28 18:16:00 +00:00
jimblandy
504280af60 Breakpad Dumper: Move CFI register names to DwarfCFIToModule class.
At the moment, the mappings from register numbers appearing in DWARF CFI
and .eh_frame exception handling sections to the appropriate
processor-specific names are in src/common/linux/dump_syms.cc. However, the
numberings are (for the most part) the same on all platforms using DWARF,
so there's no reason those tables shouldn't be shared between the Linux and
Mac symbol dumpers.

This patch moves the tables into a nested class of DwarfCFIToModule, so
they the Mac dumper can use them when it is changed to use
DwarfCFIToModule.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@575 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-28 18:14:59 +00:00
jimblandy
865df5af57 Breakpad test support: Move test_assembler.{h,cc} from src/processor to src/common.
The google_breakpad::TestAssembler classes are used in both the processor's
and the Linux dumper's test suites, and will soon be used in the Mac
dumper's tests as well. This patch moves their source files from
src/processor to src/common.

a=jimblandy, r=thestig


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@574 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-27 19:17:59 +00:00
nealsid
d5b689e7af Patch from Zhurun to fix build breaks in gcc 4.4.1
CR URL: http://breakpad.appspot.com/100001/show

A=Zhurun
R=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@573 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-26 23:52:50 +00:00
jimblandy
089003b7f6 Breakpad processor: Work around overload resolution problems in stream pos_type comparisons
When building with G++ 4.1.2, src/processor/cfi_frame_info.cc fails to
build with the error below. G++ 4.2.1 and later do not seem to report this
problem.

This patch works around the problem by casting stream.tellp() to
std::streamoff before doing the comparison.

src/processor/cfi_frame_info.cc: In member function `std::string google_breakpad::CFIFrameInfo::Serialize() const':
src/processor/cfi_frame_info.cc:105: error: ambiguous overload for `operator!=' in `stream.std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::<anonymous>.std::basic_ostream<_CharT, _Traits>::tellp [with _CharT = char, _Traits = std::char_traits<char>]() != 0'
src/processor/cfi_frame_info.cc:105: note: candidates are: operator!=(std::streamoff, int) <built-in>
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/postypes.h:143: note:                 bool std::fpos<_StateT>::operator!=(const std::fpos<_StateT>&) const [with _StateT = __mbstate_t]

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@572 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-20 15:56:32 +00:00
jimblandy
1e73bad86e Breakpad stack walker: remove embedded newlines from module names.
pdb filenames in crash reports may contain embedded newlines. When
minidump-stackwalk prints these lines, it ends up with:

Module|olek8r4u.dll|6.0.6000.16386|\\xc2\\xeb\\x17\\x04J\\xb6:\\xbaT\\xf3\\xef\\xe8Y\\x90\\x86\\xaa\\xe5\\x16n\\xb1\\x80\\x85\\t\\x12!\\x16\\x0f\\x98\\xf8\\x89\\x16"\\x96\\xd4\\x84\\x88\\xea\\xe3\\r\\r\\x1b\\xca\\x85*^h\\xf5\\xdc\n\\xd9\\xf4}j\\x1d7\\xe39o\\x1f\\xc5\\xc4\\xa6x\\x8ba\\xe8\\xd6K\\x89H\\xe1\\xff\\xe7\\xf5\\xf0Y\\xfd\\xf5\\xdbu\\x0c\\x07\\x86\\xed|29E0B04FCCBE47EB86A6C819E8B89D051|0x00f60000|0x00ff2fff|0\n

Which has an embedded newline and the machine parser can't handle it. This
patch just strips the embedded newline, just as we strip embedded |
separator characters.

a=bsmedberg, r=jimblandy


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@571 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-15 19:00:28 +00:00
jessicag.feedback@gmail.com
a62dc27d23 Mac now takes response code into account when determining success of a symupload.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@570 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-13 19:00:49 +00:00
ted.mielczarek
b223627d81 provide a network source line resolver + server. r=mark,jimb at http://breakpad.appspot.com/36001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@569 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-08 23:06:23 +00:00
mmentovai
c0ec51afe0 Include what you use.
Patch by Adam Langley <agl@chromium.org>.  r=me


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@568 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-05 19:54:48 +00:00
jimblandy
87855248f1 Breakpad symbol dumper: Move Linux dumping classes into src/common.
The Linux symbol dumper's classes are reasonably portable, and should be
usable for the Mac dumper as well. Move them to src/common, along with
their unit tests. Update #include directives and Makefile.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@567 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-05 19:40:17 +00:00
jimblandy
9e6b619ad0 Breakpad Linux Dumper: Disable warnings about unpaired functions and lines by default.
In the process of pairing up DWARF source lines with the functions they
belong to, the dumper detects and warns about regions of functions that
have no source line information, and vice versa. However, this seems to
occur in real code frequently enough (although not often) that the warnings
may obscure more serious problems.

This patch makes those warnings disabled by default in
DwarfCUToModule::WarningReporter. It does not add a way for the dump_syms
user to enable them.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@566 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-05 19:35:10 +00:00
mmentovai
5c27539f91 Add gettimeofday to linux_syscall_support.h
Patch by Adam Langley <agl@chromium.org>.
R=me


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@565 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-02 16:46:13 +00:00
jimblandy
b34b1d8525 Breakpad Linux dumper: Use the correct section's base address.
In order to dump call frame information held in .eh_frame sections, the
dumper needs to know the proper base address to use for pointers encoded
using the DW_EH_PE_textrel encoding. This should be the start of the .text
section. However, due to a cut-and-paste typo, the dumper was supplying the
base address of the ".got" section instead.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@564 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-01 22:58:18 +00:00
jimblandy
2a18f064ce Breakpad Linux dumper: Generate make dependencies on header files automatically.
The Linux dumper's Makefile doesn't record the object files' dependence on
header files at all, just because I was too lazy to write them out and knew
I would forget to keep them up to date anyway. But I've wasted too much
time tracking down mysterious segmentation faults and other problems after
changing header files, and I know it's wasted others' time, too.

a=jimblandy, r=nealsid,dmuir


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@563 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-01 22:57:06 +00:00
jimblandy
a0aca73851 Breakpad Linux dumper: Include filename in error messages.
a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@562 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-31 15:32:31 +00:00
jimblandy
608d142aaa Breakpad DWARF parser: correct comments regarding dynamic_cast.
The comments don't accurately describe what the style guide says.

Regardless of what the style guide says, RTTI seems to make trouble in
practice, because so many people build with it disabled. Since only the
symbol dumper uses RTTI, not the client library, it may be practical for
people to simply enable RTTI for the dumper. Failing that, it may be best
in the long run to violate the style guide and make the code work sans
RTTI.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@561 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-30 21:36:58 +00:00
jimblandy
00dbb73752 Breakpad Linux dumper: Make changes requested by Neal Sidhwaney in issue 59002.
- Use manifest constants for 'z' augmentation letters.
- Fix typos and rearrange some code for legibility.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@560 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-29 18:31:53 +00:00
jimblandy
f3319839c4 [ Mistakenly committed older version of patch. This is the right one. ]
Breakpad Linux client: Simplify VerifyStackReadWithMultipleThreads unit test.

As written, the VerifyStackReadWithMultipleThreads unit test makes
assumptions about the layout of thread_function's stack frame. As a result,
the test will fail when compiled with some compilers, or built with certain
optimization levels.

As an extension to C++, the GNU compilers allow you to request that a
variable be placed in a specific register. Using this, we can have
thread_function put the thread id in place where the test can find it
reliably.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@559 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-29 18:27:11 +00:00
jimblandy
b68b800189 Breakpad Linux client: Simplify VerifyStackReadWithMultipleThreads unit test.
As written, the VerifyStackReadWithMultipleThreads unit test makes
assumptions about the layout of thread_function's stack frame. As a result,
the test will fail when compiled with some compilers, or built with certain
optimization levels.

As an extension to C++, the GNU compilers allow you to request that a
variable be placed in a specific register. Using this, we can have
thread_function put the thread id in place where the test can find it
reliably.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@558 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-29 18:23:42 +00:00
siggi@chromium.org
18dd9d0104 Fix HandleInvalidParameter to provide a locally created exception record for the minidump.
Having an exception of interest makes the resultant minidumps look just like
crash dumps, in that the processor can identify the "crashing" tread. 
This means such minidumps can be classified by the stack signature, in contrast to the current state of things, in which all such dumps get lumped on a single pile.


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@557 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-26 16:03:58 +00:00
jimblandy
43135e6e46 Add omitted newline to warning message in StabsReader::SymbolString.
a=jimblandy, no reviewer


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@555 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-18 18:59:27 +00:00
jimblandy
e7e1e1ebf5 Breakpad processor: Support AMD64 stack unwinding driven by DWARF CFI.
This adds support for 'STACK CFI' records (DWARF CFI) to the AMD64
stack walker. This is necessary for the stack trace to include any
frames other than the youngest. Unit tests are included.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@554 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-16 16:49:53 +00:00
jimblandy
c609f474a9 Breakpad: Support DWARF CFI-driven stack walking on ARM.
This patch allows the Breakpad minidump processor to use data from
STACK CFI records to generate stack traces for the ARM processor.

In the symbol dumper, we need a table mapping DWARF CFI register
numbers to their names: STACK CFI records refer to registers by name.

In the processor, we expand StackwalkerARM::GetCallerFrame to see if
there are STACK CFI records covering the callee, and then use those to
recover the caller's register values.

There's no good reason the ARM walker couldn't use the SimpleCFIWalker
interface declared in cfi_frame_info.h. Unfortunately, that interface
assumes that one can map register names to member pointers of the raw
context type, while MDRawContextARM uses an array to hold the
registers' values: C++ pointer-to-member types can't refer to elements
of member arrays. So we have to write out SimpleCFIWalker::FindCallerRegisters
in StackwalkerARM::GetCallerFrame.

We define enum MDARMRegisterNumbers in minidump_cpu_arm.h, for
convenience in referring to certain ARM registers with dedicated
purposes, like the stack pointer and the PC.

We define validity flags in StackFrameARM for all the registers, since
CFI could theoretically recover any of them. In the same vein, we
expand minidump_stackwalk.cc to print the values of all valid
callee-saves registers in the context --- and use the proper names for
special-purpose registers.

We provide unit tests that give full code and branch coverage (with
minor exceptions). We add a testing interface to StackwalkerARM that
allows us to create context frames that lack some register values.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@553 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-16 16:46:22 +00:00
jimblandy
a76aaa1442 Breakpad Linux dumper: Parse the .eh_frame section.
Extend google_breakpad::CFISection with the ability to produce
.eh_frame data. Entry headers have a different format, and pointers
can be encoded in new and fascinating ways.

Extend dwarf2reader::CallFrameInfo to be able to parse either DWARF
CFI or .eh_frame data, as determined by an argument to the
constructor. Cope with variations in header formats, encoded pointers,
and additional data in 'z' augmentation data blocks. Extend the unit
tests appropriately.

Extend dump_syms to look for a .eh_frame section, and if it is
present, find the necessary base addresess and parse its contents.

There's no need for DwarfCFIToModule to check the version numbers; if
CallFrameInfo can parse it, DwarfCFIToModule should be able to handle
it. Adjust tests accordingly.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@552 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-16 16:37:50 +00:00
jimblandy
0de9f43b87 Breakpad DWARF parser: Add support for parsing .eh_frame encoded pointers.
The Linux C++ exception handling data format (.eh_frame) can specify a
number of different encodings for the addresses it contains. This
patch extends dwarf2reader::ByteReader to read pointers encoded in
these ways.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@551 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-16 16:34:52 +00:00
jimblandy
3e768ed9c0 Breakpad Linux dumper: Add support for dumping DWARF CFI as STACK CFI records.
Define a new DWARF parser class, dwarf2reader::CallFrameInfo.

Extend google_breakpad::Module to store and write out 'STACK CFI' records.

Define a new google_breakpad::DwarfCFIToModule class, to accept DWARF
CFI data from the parser and populate a Module with the equivalent
STACK CFI records.

Extend the Linux symbol dumping tool, dump_syms, to use
dwarf2reader::CallFrameInfo, google_breakpad::DwarfCFIToModule, and
google_breakpad::Module to extract DWARF CFI from the executable or
shared library files and write it to the Breakpad symbol file.

Define CFISection, a new class derived from TestAssembler::Section,
for use in creating DWARF CFI data for test cases.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@550 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-16 16:31:49 +00:00
jimblandy
6d3a825dbf Breakpad: Add minidump processor support for DWARF Call Frame Information.
Add a CFIFrameInfo class (named for symmetry with WindowsFrameInfo) to
represent the set of STACK CFI rules in effect at a given instruction,
and apply them to a set of register values. Provide a SimpleCFIWalker
class template, to allow the essential CFI code to be shared amongst
the different architectures.

Teach BasicSourceLineResolver to partially parse 'STACK CFI' records,
and produce the set of rules in effect at a given instruction on
demand, by combining the initial rule set and the appropriate rule
deltas in a CFIFrameInfo object.

Adapt StackwalkerX86 and StackFrameX86 to retrieve, store, and apply
CFI stack walking information.

Add validity flags for all the general-purpose registers to
StackFrameX86::ContextValidity.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@549 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-16 16:28:32 +00:00