mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-03-05 20:16:32 +00:00
Use stdint types everywhere
R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
@@ -265,7 +265,7 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
|
||||
testing::DisableExceptionHandlerInScope disable_exception_handler;
|
||||
|
||||
// Get some executable memory.
|
||||
const u_int32_t kMemorySize = 256; // bytes
|
||||
const uint32_t kMemorySize = 256; // bytes
|
||||
const int kOffset = kMemorySize / 2;
|
||||
// This crashes with SIGILL on x86/x86-64/arm.
|
||||
const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
|
||||
@@ -314,7 +314,7 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
|
||||
MinidumpContext* context = exception->GetContext();
|
||||
ASSERT_TRUE(context);
|
||||
|
||||
u_int64_t instruction_pointer;
|
||||
uint64_t instruction_pointer;
|
||||
ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
|
||||
|
||||
MinidumpMemoryRegion* region =
|
||||
@@ -322,11 +322,11 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
|
||||
ASSERT_TRUE(region);
|
||||
|
||||
EXPECT_EQ(kMemorySize, region->GetSize());
|
||||
const u_int8_t* bytes = region->GetMemory();
|
||||
const uint8_t* bytes = region->GetMemory();
|
||||
ASSERT_TRUE(bytes);
|
||||
|
||||
u_int8_t prefix_bytes[kOffset];
|
||||
u_int8_t suffix_bytes[kMemorySize - kOffset - sizeof(instructions)];
|
||||
uint8_t prefix_bytes[kOffset];
|
||||
uint8_t suffix_bytes[kMemorySize - kOffset - sizeof(instructions)];
|
||||
memset(prefix_bytes, 0, sizeof(prefix_bytes));
|
||||
memset(suffix_bytes, 0, sizeof(suffix_bytes));
|
||||
EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0);
|
||||
@@ -352,7 +352,7 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMinBound) {
|
||||
SYSTEM_INFO sSysInfo; // Useful information about the system
|
||||
GetSystemInfo(&sSysInfo); // Initialize the structure.
|
||||
|
||||
const u_int32_t kMemorySize = 256; // bytes
|
||||
const uint32_t kMemorySize = 256; // bytes
|
||||
const DWORD kPageSize = sSysInfo.dwPageSize;
|
||||
const int kOffset = 0;
|
||||
// This crashes with SIGILL on x86/x86-64/arm.
|
||||
@@ -407,7 +407,7 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMinBound) {
|
||||
MinidumpContext* context = exception->GetContext();
|
||||
ASSERT_TRUE(context);
|
||||
|
||||
u_int64_t instruction_pointer;
|
||||
uint64_t instruction_pointer;
|
||||
ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
|
||||
|
||||
MinidumpMemoryRegion* region =
|
||||
@@ -415,10 +415,10 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMinBound) {
|
||||
ASSERT_TRUE(region);
|
||||
|
||||
EXPECT_EQ(kMemorySize / 2, region->GetSize());
|
||||
const u_int8_t* bytes = region->GetMemory();
|
||||
const uint8_t* bytes = region->GetMemory();
|
||||
ASSERT_TRUE(bytes);
|
||||
|
||||
u_int8_t suffix_bytes[kMemorySize / 2 - sizeof(instructions)];
|
||||
uint8_t suffix_bytes[kMemorySize / 2 - sizeof(instructions)];
|
||||
memset(suffix_bytes, 0, sizeof(suffix_bytes));
|
||||
EXPECT_TRUE(memcmp(bytes + kOffset,
|
||||
instructions, sizeof(instructions)) == 0);
|
||||
@@ -492,7 +492,7 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMaxBound) {
|
||||
MinidumpContext* context = exception->GetContext();
|
||||
ASSERT_TRUE(context);
|
||||
|
||||
u_int64_t instruction_pointer;
|
||||
uint64_t instruction_pointer;
|
||||
ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
|
||||
|
||||
MinidumpMemoryRegion* region =
|
||||
@@ -501,10 +501,10 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMaxBound) {
|
||||
|
||||
const size_t kPrefixSize = 128; // bytes
|
||||
EXPECT_EQ(kPrefixSize + sizeof(instructions), region->GetSize());
|
||||
const u_int8_t* bytes = region->GetMemory();
|
||||
const uint8_t* bytes = region->GetMemory();
|
||||
ASSERT_TRUE(bytes);
|
||||
|
||||
u_int8_t prefix_bytes[kPrefixSize];
|
||||
uint8_t prefix_bytes[kPrefixSize];
|
||||
memset(prefix_bytes, 0, sizeof(prefix_bytes));
|
||||
EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0);
|
||||
EXPECT_TRUE(memcmp(bytes + kPrefixSize,
|
||||
|
||||
Reference in New Issue
Block a user