aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac/handler/minidump_generator.h
diff options
context:
space:
mode:
authornealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-04-04 21:35:41 +0000
committernealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-04-04 21:35:41 +0000
commit867df1c65264c657ed71d68c3d266401686edcad (patch)
tree82cdb77a75e104babee681de497e26c54d6474b4 /src/client/mac/handler/minidump_generator.h
parentMinor style changes to comply with Google style guidelines. (diff)
downloadbreakpad-867df1c65264c657ed71d68c3d266401686edcad.tar.xz
Issue 246: Dynamic_images.* needs to be 64-bit ready. Created types that are typedefed to the appropriate types depending on 32/64-bit compilation and modified dynamic_images to use these new types. Tested 32-bit minidump-generation. Also did some code cleanup along the way. Removed all blank lines that had spaces.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@253 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/handler/minidump_generator.h')
-rw-r--r--src/client/mac/handler/minidump_generator.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/client/mac/handler/minidump_generator.h b/src/client/mac/handler/minidump_generator.h
index 33d84c1c..0d3424c3 100644
--- a/src/client/mac/handler/minidump_generator.h
+++ b/src/client/mac/handler/minidump_generator.h
@@ -46,6 +46,26 @@ namespace google_breakpad {
using std::string;
+#if TARGET_CPU_X86_64 || TARGET_CPU_PPC64
+#define TOP_OF_THREAD0_STACK 0x00007fff5fbff000
+#else
+#define TOP_OF_THREAD0_STACK 0xbffff000
+#endif
+
+#if TARGET_CPU_X86_64
+typedef x86_thread_state64_t breakpad_thread_state_t;
+typedef MDRawContextAMD64 MinidumpContext;
+#elif TARGET_CPU_X86
+typedef i386_thread_state_t breakpad_thread_state_t;
+typedef MDRawContextX86 MinidumpContext;
+#elif TARGET_CPU_PPC64
+typedef ppc_thread_state64_t breakpad_thread_state_t;
+typedef MDRawContextPPC64 MinidumpContext;
+#elif TARGET_CPU_PPC
+typedef ppc_thread_state_t breakpad_thread_state_t;
+typedef MDRawContextPPC MinidumpContext;
+#endif
+
// Creates a minidump file of the current process. If there is exception data,
// use SetExceptionInformation() to add this to the minidump. The minidump
// file is generated by the Write() function.
@@ -93,7 +113,7 @@ class MinidumpGenerator {
// Helpers
u_int64_t CurrentPCForStack(breakpad_thread_state_data_t state);
- bool WriteStackFromStartAddress(vm_address_t start_addr,
+ bool WriteStackFromStartAddress(mach_vm_address_t start_addr,
MDMemoryDescriptor *stack_location);
bool WriteStack(breakpad_thread_state_data_t state,
MDMemoryDescriptor *stack_location);
@@ -103,7 +123,9 @@ class MinidumpGenerator {
bool WriteCVRecord(MDRawModule *module, int cpu_type,
const char *module_path);
bool WriteModuleStream(unsigned int index, MDRawModule *module);
- size_t CalculateStackSize(vm_address_t start_addr);
+
+ size_t CalculateStackSize(mach_vm_address_t start_addr);
+
int FindExecutableModule();
// disallow copy ctor and operator=