Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Side by Side Diff: src/google_breakpad/common/minidump_cpu_arm64.h

Issue 664002: Generate minidumps for 64-bit ARM apps on iOS. (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk
Patch Set: Nit Created 11 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* Copyright (c) 2009, Google Inc. 1 /* Copyright 2013, Google Inc.
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer 11 * copyright notice, this list of conditions and the following disclaimer
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 * zero-length arrays are forbidden by standard C and C++. In these cases, 49 * zero-length arrays are forbidden by standard C and C++. In these cases,
50 * *_minsize constants are provided to be used in place of sizeof. For a 50 * *_minsize constants are provided to be used in place of sizeof. For a
51 * cleaner interface to these sizes when using C++, see minidump_size.h. 51 * cleaner interface to these sizes when using C++, see minidump_size.h.
52 * 52 *
53 * These structures are also sufficient to populate minidump files. 53 * These structures are also sufficient to populate minidump files.
54 * 54 *
55 * Because precise data type sizes are crucial for this implementation to 55 * Because precise data type sizes are crucial for this implementation to
56 * function properly and portably, a set of primitive types with known sizes 56 * function properly and portably, a set of primitive types with known sizes
57 * are used as the basis of each structure defined by this file. 57 * are used as the basis of each structure defined by this file.
58 * 58 *
59 * Author: Julian Seward 59 * Author: Colin Blundell
60 */ 60 */
61 61
62 /* 62 /*
63 * ARM support 63 * ARM64 support
64 */ 64 */
65 65
66 #ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ 66 #ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__
67 #define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ 67 #define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__
68 68
69 #define MD_FLOATINGSAVEAREA_ARM_FPR_COUNT 32 69 #define MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT 32
70 #define MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT 8 70 #define MD_FLOATINGSAVEAREA_ARM64_FPEXTRA_COUNT 8
qsr 2013/10/28 10:25:38 Did you check those values?
blundell 2013/11/07 16:41:26 Done.
71 71
72 /* 72 /*
73 * Note that these structures *do not* map directly to the CONTEXT 73 * Note that these structures *do not* map directly to the CONTEXT
74 * structure defined in WinNT.h in the Windows Mobile SDK. That structure 74 * structure defined in WinNT.h in the Windows Mobile SDK. That structure
75 * does not accomodate VFPv3, and I'm unsure if it was ever used in the 75 * does not accomodate VFPv3, and I'm unsure if it was ever used in the
76 * wild anyway, as Windows CE only seems to produce "cedumps" which 76 * wild anyway, as Windows CE only seems to produce "cedumps" which
77 * are not exactly minidumps. 77 * are not exactly minidumps.
78 */ 78 */
79 // TODO(blundell)_: Where can I find the right definition for these?
79 typedef struct { 80 typedef struct {
80 uint64_t fpscr; /* FPU status register */ 81 uint64_t fpscr; /* FPU status register */
81 82
82 /* 32 64-bit floating point registers, d0 .. d31. */ 83 /* 32 64-bit floating point registers, d0 .. d31. */
83 uint64_t regs[MD_FLOATINGSAVEAREA_ARM_FPR_COUNT]; 84 uint64_t regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT];
84 85
85 /* Miscellaneous control words */ 86 /* Miscellaneous control words */
86 uint32_t extra[MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT]; 87 uint32_t extra[MD_FLOATINGSAVEAREA_ARM64_FPEXTRA_COUNT];
87 } MDFloatingSaveAreaARM; 88 } MDFloatingSaveAreaARM64;
88 89
89 #define MD_CONTEXT_ARM_GPR_COUNT 16 90 #define MD_CONTEXT_ARM64_GPR_COUNT 33
90 91
91 typedef struct { 92 typedef struct {
92 /* The next field determines the layout of the structure, and which parts 93 /* The next field determines the layout of the structure, and which parts
93 * of it are populated 94 * of it are populated
94 */ 95 */
95 uint32_t context_flags; 96 uint64_t context_flags;
96 97
97 /* 16 32-bit integer registers, r0 .. r15 98 /* 33 64-bit integer registers, x0 .. x31 + the PC
98 * Note the following fixed uses: 99 * Note the following fixed uses:
99 * r13 is the stack pointer 100 * x29 is the frame pointer
100 * r14 is the link register 101 * x30 is the link register
101 * r15 is the program counter 102 * x31 is the stack pointer
103 * The PC is effectively x32.
102 */ 104 */
103 uint32_t iregs[MD_CONTEXT_ARM_GPR_COUNT]; 105 uint64_t iregs[MD_CONTEXT_ARM64_GPR_COUNT];
104 106
105 /* CPSR (flags, basically): 32 bits: 107 /* CPSR (flags, basically): 32 bits:
106 bit 31 - N (negative) 108 bit 31 - N (negative)
107 bit 30 - Z (zero) 109 bit 30 - Z (zero)
108 bit 29 - C (carry) 110 bit 29 - C (carry)
109 bit 28 - V (overflow) 111 bit 28 - V (overflow)
110 bit 27 - Q (saturation flag, sticky) 112 bit 27 - Q (saturation flag, sticky)
111 All other fields -- ignore */ 113 All other fields -- ignore */
112 uint32_t cpsr; 114 uint32_t cpsr;
113 115
114 /* The next field is included with MD_CONTEXT_ARM_FLOATING_POINT */ 116 /* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */
115 MDFloatingSaveAreaARM float_save; 117 MDFloatingSaveAreaARM64 float_save;
116 118
117 } MDRawContextARM; 119 } MDRawContextARM64;
118 120
119 /* Indices into iregs for registers with a dedicated or conventional 121 /* Indices into iregs for registers with a dedicated or conventional
120 * purpose. 122 * purpose.
121 */ 123 */
122 enum MDARMRegisterNumbers { 124 enum MDARM64RegisterNumbers {
123 MD_CONTEXT_ARM_REG_IOS_FP = 7, 125 MD_CONTEXT_ARM64_REG_FP = 29,
124 MD_CONTEXT_ARM_REG_FP = 11, 126 MD_CONTEXT_ARM64_REG_LR = 30,
125 MD_CONTEXT_ARM_REG_SP = 13, 127 MD_CONTEXT_ARM64_REG_SP = 31,
126 MD_CONTEXT_ARM_REG_LR = 14, 128 MD_CONTEXT_ARM64_REG_PC = 32,
127 MD_CONTEXT_ARM_REG_PC = 15
128 }; 129 };
129 130
130 /* For (MDRawContextARM).context_flags. These values indicate the type of 131 /* For (MDRawContextARM64).context_flags. These values indicate the type of
131 * context stored in the structure. */ 132 * context stored in the structure. */
132 /* CONTEXT_ARM from the Windows CE 5.0 SDK. This value isn't correct 133 /* CONTEXT_ARM64 from the Windows CE 5.0 SDK. This value isn't correct
133 * because this bit can be used for flags. Presumably this value was 134 * because this bit can be used for flags. Presumably this value was
134 * never actually used in minidumps, but only in "CEDumps" which 135 * never actually used in minidumps, but only in "CEDumps" which
135 * are a whole parallel minidump file format for Windows CE. 136 * are a whole parallel minidump file format for Windows CE.
136 * Therefore, Breakpad defines its own value for ARM CPUs. 137 * Therefore, Breakpad defines its own value for ARM CPUs.
qsr 2013/10/28 10:25:38 The comment is completely wrong. Windows CE never
blundell 2013/11/07 16:41:26 Done.
137 */ 138 */
138 #define MD_CONTEXT_ARM_OLD 0x00000040 139 // TODO(blundell): What should these values be?
140 #define MD_CONTEXT_ARM64_OLD 0x00000040
blundell 2013/10/25 16:07:02 I don't know what to use for this value or the val
qsr 2013/10/28 10:25:38 You either need to find documentation, or you need
blundell 2013/11/07 16:41:26 I believe that that MD_CONTEXT_ARM64 is Breakpad-d
139 /* This value was chosen to avoid likely conflicts with MD_CONTEXT_* 141 /* This value was chosen to avoid likely conflicts with MD_CONTEXT_*
140 * for other CPUs. */ 142 * for other CPUs. */
141 #define MD_CONTEXT_ARM 0x40000000 143 #define MD_CONTEXT_ARM64 0x40000000
142 #define MD_CONTEXT_ARM_INTEGER (MD_CONTEXT_ARM | 0x00000002) 144 #define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002)
143 #define MD_CONTEXT_ARM_FLOATING_POINT (MD_CONTEXT_ARM | 0x00000004) 145 #define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004)
144 146
145 #define MD_CONTEXT_ARM_FULL (MD_CONTEXT_ARM_INTEGER | \ 147 #define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_INTEGER | \
146 MD_CONTEXT_ARM_FLOATING_POINT) 148 MD_CONTEXT_ARM64_FLOATING_POINT)
147 149
148 #define MD_CONTEXT_ARM_ALL (MD_CONTEXT_ARM_INTEGER | \ 150 #define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_INTEGER | \
149 MD_CONTEXT_ARM_FLOATING_POINT) 151 MD_CONTEXT_ARM64_FLOATING_POINT)
150 152
151 #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ */ 153 #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ */
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted