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

Side by Side Diff: src/google_breakpad/processor/minidump.h

Issue 49011: Basic arm support for processor (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: Created 15 years, 4 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) 2006, Google Inc. 1 // Copyright (c) 2006, 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
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 // Returns an MD_CONTEXT_* value such as MD_CONTEXT_X86 or MD_CONTEXT_PPC 173 // Returns an MD_CONTEXT_* value such as MD_CONTEXT_X86 or MD_CONTEXT_PPC
174 // identifying the CPU type that the context was collected from. The 174 // identifying the CPU type that the context was collected from. The
175 // returned value will identify the CPU only, and will have any other 175 // returned value will identify the CPU only, and will have any other
176 // MD_CONTEXT_* bits masked out. Returns 0 on failure. 176 // MD_CONTEXT_* bits masked out. Returns 0 on failure.
177 u_int32_t GetContextCPU() const; 177 u_int32_t GetContextCPU() const;
178 178
179 // Returns raw CPU-specific context data for the named CPU type. If the 179 // Returns raw CPU-specific context data for the named CPU type. If the
180 // context data does not match the CPU type or does not exist, returns 180 // context data does not match the CPU type or does not exist, returns
181 // NULL. 181 // NULL.
182 const MDRawContextAMD64* GetContextAMD64() const;
183 const MDRawContextARM* GetContextARM() const;
184 const MDRawContextPPC* GetContextPPC() const;
185 const MDRawContextSPARC* GetContextSPARC() const;
182 const MDRawContextX86* GetContextX86() const; 186 const MDRawContextX86* GetContextX86() const;
183 const MDRawContextPPC* GetContextPPC() const;
184 const MDRawContextAMD64* GetContextAMD64() const;
185 const MDRawContextSPARC* GetContextSPARC() const;
186 187
187 // Print a human-readable representation of the object to stdout. 188 // Print a human-readable representation of the object to stdout.
188 void Print(); 189 void Print();
189 190
190 private: 191 private:
191 friend class MinidumpThread; 192 friend class MinidumpThread;
192 friend class MinidumpException; 193 friend class MinidumpException;
193 194
194 explicit MinidumpContext(Minidump* minidump); 195 explicit MinidumpContext(Minidump* minidump);
195 196
196 bool Read(u_int32_t expected_size); 197 bool Read(u_int32_t expected_size);
197 198
198 // Free the CPU-specific context structure. 199 // Free the CPU-specific context structure.
199 void FreeContext(); 200 void FreeContext();
200 201
201 // If the minidump contains a SYSTEM_INFO_STREAM, makes sure that the 202 // If the minidump contains a SYSTEM_INFO_STREAM, makes sure that the
202 // system info stream gives an appropriate CPU type matching the context 203 // system info stream gives an appropriate CPU type matching the context
203 // CPU type in context_cpu_type. Returns false if the CPU type does not 204 // CPU type in context_cpu_type. Returns false if the CPU type does not
204 // match. Returns true if the CPU type matches or if the minidump does 205 // match. Returns true if the CPU type matches or if the minidump does
205 // not contain a system info stream. 206 // not contain a system info stream.
206 bool CheckAgainstSystemInfo(u_int32_t context_cpu_type); 207 bool CheckAgainstSystemInfo(u_int32_t context_cpu_type);
207 208
208 // Store this separately because of the weirdo AMD64 context 209 // Store this separately because of the weirdo AMD64 context
209 u_int32_t context_flags_; 210 u_int32_t context_flags_;
210 211
211 // The CPU-specific context structure. 212 // The CPU-specific context structure.
212 union { 213 union {
213 MDRawContextBase* base; 214 MDRawContextBase* base;
Mark Mentovai 2009/12/18 21:46:59 Looks like the union fields were once lined up ver
214 MDRawContextX86* x86; 215 MDRawContextX86* x86;
215 MDRawContextPPC* ppc; 216 MDRawContextPPC* ppc;
216 MDRawContextAMD64* amd64; 217 MDRawContextAMD64* amd64;
217 // on Solaris SPARC, sparc is defined as a numeric constant, 218 // on Solaris SPARC, sparc is defined as a numeric constant,
218 // so variables can NOT be named as sparc 219 // so variables can NOT be named as sparc
219 MDRawContextSPARC* ctx_sparc; 220 MDRawContextSPARC* ctx_sparc;
221 MDRawContextARM* arm;
220 } context_; 222 } context_;
221 }; 223 };
222 224
223 225
224 // MinidumpMemoryRegion does not wrap any MDRaw structure, and only contains 226 // MinidumpMemoryRegion does not wrap any MDRaw structure, and only contains
225 // a reference to an MDMemoryDescriptor. This object is intended to wrap 227 // a reference to an MDMemoryDescriptor. This object is intended to wrap
226 // portions of a minidump file that contain memory dumps. In normal 228 // portions of a minidump file that contain memory dumps. In normal
227 // minidumps, each MinidumpThread owns a MinidumpMemoryRegion corresponding 229 // minidumps, each MinidumpThread owns a MinidumpMemoryRegion corresponding
228 // to the thread's stack memory. MinidumpMemoryList also gives access to 230 // to the thread's stack memory. MinidumpMemoryList also gives access to
229 // memory regions in its list as MinidumpMemoryRegions. This class 231 // memory regions in its list as MinidumpMemoryRegions. This class
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // construction or after a failed Read(); true following a successful 950 // construction or after a failed Read(); true following a successful
949 // Read(). 951 // Read().
950 bool valid_; 952 bool valid_;
951 }; 953 };
952 954
953 955
954 } // namespace google_breakpad 956 } // namespace google_breakpad
955 957
956 958
957 #endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__ 959 #endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__
OLDNEW

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