Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Unified Diff: snapshot/win/exception_snapshot_win.h

Issue 1126413008: win: Implement exception snapshot (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: snapshot/win/exception_snapshot_win.h
diff --git a/snapshot/mac/exception_snapshot_mac.h b/snapshot/win/exception_snapshot_win.h
similarity index 57%
copy from snapshot/mac/exception_snapshot_mac.h
copy to snapshot/win/exception_snapshot_win.h
index ea1161c3de5f272257cd724c096ae0e6c454f43e..fab8de6e4f2a7edb745694d11f0ca566900289cd 100644
--- a/snapshot/mac/exception_snapshot_mac.h
+++ b/snapshot/win/exception_snapshot_win.h
@@ -1,4 +1,4 @@
-// Copyright 2014 The Crashpad Authors. All rights reserved.
+// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,53 +12,41 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_
-#define CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_
+#ifndef CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_
+#define CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_
-#include <mach/mach.h>
#include <stdint.h>
-
-#include <vector>
+#include <windows.h>
#include "base/basictypes.h"
#include "build/build_config.h"
#include "snapshot/cpu_context.h"
#include "snapshot/exception_snapshot.h"
-#include "util/mach/mach_extensions.h"
#include "util/misc/initialization_state_dcheck.h"
namespace crashpad {
-class ProcessReader;
+class ProcessReaderWin;
namespace internal {
-//! \brief An ExceptionSnapshot of an exception sustained by a running (or
-//! crashed) process on a Mac OS X system.
-class ExceptionSnapshotMac final : public ExceptionSnapshot {
+class ExceptionSnapshotWin final : public ExceptionSnapshot {
public:
- ExceptionSnapshotMac();
- ~ExceptionSnapshotMac() override;
+ ExceptionSnapshotWin();
+ ~ExceptionSnapshotWin() override;
//! \brief Initializes the object.
//!
- //! Other than \a process_reader, the parameters may be passed directly
- //! through from a Mach exception handler.
- //!
//! \param[in] process_reader A ProcessReader for the task that sustained the
//! exception.
+ //! \param[in] thread_handle Thread in which the exception occurred.
+ //! \param[in] exception_pointers Passed through from the exception handler.
//!
//! \return `true` if the snapshot could be created, `false` otherwise with
//! an appropriate message logged.
- bool Initialize(ProcessReader* process_reader,
- exception_behavior_t behavior,
- thread_t exception_thread,
- exception_type_t exception,
- const mach_exception_data_type_t* code,
- mach_msg_type_number_t code_count,
- thread_state_flavor_t flavor,
- ConstThreadState state,
- mach_msg_type_number_t state_count);
+ bool Initialize(ProcessReaderWin* process_reader,
+ HANDLE thread_handle,
+ EXCEPTION_POINTERS* exception_pointers);
// ExceptionSnapshot:
@@ -80,14 +68,14 @@ class ExceptionSnapshotMac final : public ExceptionSnapshot {
std::vector<uint64_t> codes_;
uint64_t thread_id_;
uint64_t exception_address_;
- exception_type_t exception_;
- uint32_t exception_code_0_;
+ uint32_t exception_flags_;
+ DWORD exception_;
cpu_(ooo_6.6-7.5) 2015/05/15 01:24:13 I personally would call this the exception code si
scottmg 2015/08/18 05:08:40 Done.
InitializationStateDcheck initialized_;
- DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotMac);
+ DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotWin);
};
} // namespace internal
} // namespace crashpad
-#endif // CRASHPAD_SNAPSHOT_MAC_EXCEPTION_SNAPSHOT_MAC_H_
+#endif // CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698