| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Make sure data pointed to by the stack is captured. | 216 // Make sure data pointed to by the stack is captured. |
| 217 const int kDataSize = 512; | 217 const int kDataSize = 512; |
| 218 int* pointed_to_data = new int[kDataSize]; | 218 int* pointed_to_data = new int[kDataSize]; |
| 219 for (int i = 0; i < kDataSize; ++i) | 219 for (int i = 0; i < kDataSize; ++i) |
| 220 pointed_to_data[i] = i | ((i % 2 == 0) ? 0x80000000 : 0); | 220 pointed_to_data[i] = i | ((i % 2 == 0) ? 0x80000000 : 0); |
| 221 int* offset_pointer = &pointed_to_data[128]; | 221 int* offset_pointer = &pointed_to_data[128]; |
| 222 // Encourage the compiler to keep this variable around. | 222 // Encourage the compiler to keep this variable around. |
| 223 printf("%p, %p\n", offset_pointer, &offset_pointer); | 223 printf("%p, %p\n", offset_pointer, &offset_pointer); |
| 224 | 224 |
| 225 crashpad::CrashpadInfo::GetCrashpadInfo() | 225 crashpad::CrashpadInfo::GetCrashpadInfo() |
| 226 ->set_gather_indirectly_referenced_memory(TriState::kEnabled); | 226 ->set_gather_indirectly_referenced_memory( |
| 227 TriState::kEnabled, std::numeric_limits<uint32_t>::max()); |
| 227 | 228 |
| 228 std::vector<uint8_t> data_stream1(128, 'x'); | 229 std::vector<uint8_t> data_stream1(128, 'x'); |
| 229 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( | 230 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( |
| 230 222222, | 231 222222, |
| 231 reinterpret_cast<const void*>(data_stream1.data()), | 232 reinterpret_cast<const void*>(data_stream1.data()), |
| 232 data_stream1.size()); | 233 data_stream1.size()); |
| 233 | 234 |
| 234 std::vector<uint8_t> data_stream2(4096, 'z'); | 235 std::vector<uint8_t> data_stream2(4096, 'z'); |
| 235 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( | 236 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( |
| 236 333333, | 237 333333, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 251 | 252 |
| 252 return EXIT_SUCCESS; | 253 return EXIT_SUCCESS; |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace | 256 } // namespace |
| 256 } // namespace crashpad | 257 } // namespace crashpad |
| 257 | 258 |
| 258 int wmain(int argc, wchar_t* argv[]) { | 259 int wmain(int argc, wchar_t* argv[]) { |
| 259 return crashpad::CrashyMain(argc, argv); | 260 return crashpad::CrashyMain(argc, argv); |
| 260 } | 261 } |
| OLD | NEW |