OLD | NEW |
1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #endif | 86 #endif |
87 # elif defined(__linux__) | 87 # elif defined(__linux__) |
88 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall. | 88 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall. |
89 cacheflush(const_cast<char*>(memory), memory_size, ICACHE); | 89 cacheflush(const_cast<char*>(memory), memory_size, ICACHE); |
90 # else | 90 # else |
91 # error "Your operating system is not supported yet" | 91 # error "Your operating system is not supported yet" |
92 # endif | 92 # endif |
93 #endif | 93 #endif |
94 } | 94 } |
95 | 95 |
96 // Length of a formatted GUID string = | |
97 // sizeof(MDGUID) * 2 + 4 (for dashes) + 1 (null terminator) | |
98 const int kGUIDStringSize = 37; | |
99 | |
100 void sigchld_handler(int signo) { } | 96 void sigchld_handler(int signo) { } |
101 | 97 |
102 int CreateTMPFile(const string& dir, string* path) { | 98 int CreateTMPFile(const string& dir, string* path) { |
103 string file = dir + "/exception-handler-unittest.XXXXXX"; | 99 string file = dir + "/exception-handler-unittest.XXXXXX"; |
104 const char* c_file = file.c_str(); | 100 const char* c_file = file.c_str(); |
105 // Copy that string, mkstemp needs a C string it can modify. | 101 // Copy that string, mkstemp needs a C string it can modify. |
106 char* c_path = strdup(c_file); | 102 char* c_path = strdup(c_file); |
107 const int fd = mkstemp(c_path); | 103 const int fd = mkstemp(c_path); |
108 if (fd >= 0) | 104 if (fd >= 0) |
109 *path = c_path; | 105 *path = c_path; |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 EXPECT_EQ(child, static_cast<int32_t>(thread_id)); | 1170 EXPECT_EQ(child, static_cast<int32_t>(thread_id)); |
1175 | 1171 |
1176 const MDRawExceptionStream* raw = exception->exception(); | 1172 const MDRawExceptionStream* raw = exception->exception(); |
1177 ASSERT_TRUE(raw); | 1173 ASSERT_TRUE(raw); |
1178 EXPECT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED, | 1174 EXPECT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED, |
1179 raw->exception_record.exception_code); | 1175 raw->exception_record.exception_code); |
1180 | 1176 |
1181 close(fds[1]); | 1177 close(fds[1]); |
1182 unlink(minidump_filename.c_str()); | 1178 unlink(minidump_filename.c_str()); |
1183 } | 1179 } |
OLD | NEW |