Write a window of memory around the instruction pointer from the crashing thread to the minidump on OS X.

R=nealsid at http://breakpad.appspot.com/200001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@699 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek
2010-09-23 14:55:50 +00:00
parent cec12872c4
commit 4621ee0691
14 changed files with 930 additions and 18 deletions

View File

@@ -27,15 +27,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef CLIENT_LINUX_HANDLER_MEMORY_H_
#define CLIENT_LINUX_HANDLER_MEMORY_H_
#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_H_
#define GOOGLE_BREAKPAD_COMMON_MEMORY_H_
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#ifdef __APPLE__
#define sys_mmap mmap
#define sys_mmap2 mmap
#define sys_munmap munmap
#define MAP_ANONYMOUS MAP_ANON
#else
#include "third_party/lss/linux_syscall_support.h"
#endif
namespace google_breakpad {
@@ -196,4 +203,4 @@ inline void* operator new(size_t nbytes,
return allocator.Alloc(nbytes);
}
#endif // CLIENT_LINUX_HANDLER_MEMORY_H_
#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_H_

View File

@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "common/linux/memory.h"
#include "common/memory.h"
#include "testing/gtest/include/gtest/gtest.h"
using namespace google_breakpad;
@@ -74,7 +74,7 @@ TEST(WastefulVectorTest, Setup) {
TEST(WastefulVectorTest, Simple) {
PageAllocator allocator_;
wasteful_vector<int> v(&allocator_);
wasteful_vector<unsigned> v(&allocator_);
for (unsigned i = 0; i < 256; ++i)
v.push_back(i);