| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 exception_snapshot.SetExceptionAddress( | 225 exception_snapshot.SetExceptionAddress( |
| 226 expect_exception.ExceptionRecord.ExceptionAddress); | 226 expect_exception.ExceptionRecord.ExceptionAddress); |
| 227 exception_snapshot.SetCodes(exception_codes); | 227 exception_snapshot.SetCodes(exception_codes); |
| 228 | 228 |
| 229 InitializeCPUContextX86(exception_snapshot.MutableContext(), kSeed); | 229 InitializeCPUContextX86(exception_snapshot.MutableContext(), kSeed); |
| 230 | 230 |
| 231 MinidumpThreadIDMap thread_id_map; | 231 MinidumpThreadIDMap thread_id_map; |
| 232 thread_id_map[kThreadID] = expect_exception.ThreadId; | 232 thread_id_map[kThreadID] = expect_exception.ThreadId; |
| 233 | 233 |
| 234 auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter()); | 234 auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter()); |
| 235 exception_writer->InitializeFromSnapshot(&exception_snapshot, &thread_id_map); | 235 exception_writer->InitializeFromSnapshot(&exception_snapshot, thread_id_map); |
| 236 | 236 |
| 237 MinidumpFileWriter minidump_file_writer; | 237 MinidumpFileWriter minidump_file_writer; |
| 238 minidump_file_writer.AddStream(exception_writer.Pass()); | 238 minidump_file_writer.AddStream(exception_writer.Pass()); |
| 239 | 239 |
| 240 StringFileWriter file_writer; | 240 StringFileWriter file_writer; |
| 241 ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer)); | 241 ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer)); |
| 242 | 242 |
| 243 const MINIDUMP_EXCEPTION_STREAM* exception; | 243 const MINIDUMP_EXCEPTION_STREAM* exception; |
| 244 ASSERT_NO_FATAL_FAILURE(GetExceptionStream(file_writer.string(), &exception)); | 244 ASSERT_NO_FATAL_FAILURE(GetExceptionStream(file_writer.string(), &exception)); |
| 245 | 245 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 267 MinidumpExceptionWriter exception_writer; | 267 MinidumpExceptionWriter exception_writer; |
| 268 std::vector<uint64_t> exception_information(EXCEPTION_MAXIMUM_PARAMETERS + 1, | 268 std::vector<uint64_t> exception_information(EXCEPTION_MAXIMUM_PARAMETERS + 1, |
| 269 0x5a5a5a5a5a5a5a5a); | 269 0x5a5a5a5a5a5a5a5a); |
| 270 ASSERT_DEATH(exception_writer.SetExceptionInformation(exception_information), | 270 ASSERT_DEATH(exception_writer.SetExceptionInformation(exception_information), |
| 271 "kMaxParameters"); | 271 "kMaxParameters"); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace | 274 } // namespace |
| 275 } // namespace test | 275 } // namespace test |
| 276 } // namespace crashpad | 276 } // namespace crashpad |
| OLD | NEW |