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

Unified Diff: snapshot/mac/process_types.h

Issue 1277513003: Recognize crashreporter_annotations_t version 5 found on OS X 10.11 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: ExpectedSizeForVersion(), ReadIntoVersioned() Created 5 years, 4 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/mac/process_types.h
diff --git a/snapshot/mac/process_types.h b/snapshot/mac/process_types.h
index b38fea789c4669334fd206ba8ce22c343c167bcd..62b4663695be9b2dcdbb9bf544ce148eccfbd3bc 100644
--- a/snapshot/mac/process_types.h
+++ b/snapshot/mac/process_types.h
@@ -85,7 +85,14 @@ DECLARE_PROCESS_TYPE_TRAITS_CLASS(Generic, 64)
/* Similar to Size(), but computes the expected size of a structure based \
* on the process’ bitness. This can be used prior to reading any data \
* from a process. */ \
- static size_t ExpectedSize(ProcessReader* process_reader);
+ static size_t ExpectedSize(ProcessReader* process_reader); \
+ \
+ /* Similar to ExpectedSize(), but computes the expected size of a \
+ * structure based on the process’ bitness and a custom value, such as a \
+ * structure version number. This can be used prior to reading any data \
+ * from a process. */ \
+ static size_t ExpectedSizeForVersion(ProcessReader* process_reader, \
+ uint64_t version);
#define PROCESS_TYPE_STRUCT_MEMBER(member_type, member_name, ...) \
member_type member_name __VA_ARGS__;
@@ -143,8 +150,8 @@ DECLARE_PROCESS_TYPE_TRAITS_CLASS(Generic, 64)
using UIntPtr = typename Traits::UIntPtr; \
using Reserved64Only = typename Traits::Reserved64Only; \
\
- /* Read(), ReadArrayInto(), and Size() are as in the generic user-visible \
- * struct above. */ \
+ /* Read(), ReadArrayInto(), Size(), and ExpectedSizeForVersion() are as in \
+ * the generic user-visible struct above. */ \
bool Read(ProcessReader* process_reader, mach_vm_address_t address) { \
return ReadInto(process_reader, address, this); \
} \
@@ -153,6 +160,7 @@ DECLARE_PROCESS_TYPE_TRAITS_CLASS(Generic, 64)
size_t count, \
struct_name<Traits>* specific); \
static size_t Size() { return sizeof(struct_name<Traits>); } \
+ static size_t ExpectedSizeForVersion(uint64_t version); \
\
/* Translates a struct from the representation used in the remote process \
* into the generic form. */ \
« no previous file with comments | « snapshot/mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc ('k') | snapshot/mac/process_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698