| OLD | NEW |
| 1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2005, 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 #include "base/logging.h" // for RAW_LOG | 165 #include "base/logging.h" // for RAW_LOG |
| 166 #ifndef HAVE_CYGWIN_SIGNAL_H | 166 #ifndef HAVE_CYGWIN_SIGNAL_H |
| 167 typedef int ucontext_t; | 167 typedef int ucontext_t; |
| 168 #endif | 168 #endif |
| 169 | 169 |
| 170 inline void* GetPC(const struct ucontext_t& signal_ucontext) { | 170 inline void* GetPC(const struct ucontext_t& signal_ucontext) { |
| 171 RAW_LOG(ERROR, "GetPC is not yet implemented on Windows\n"); | 171 RAW_LOG(ERROR, "GetPC is not yet implemented on Windows\n"); |
| 172 return NULL; | 172 return NULL; |
| 173 } | 173 } |
| 174 | 174 #elif defined(__ANDROID__) |
| 175 typedef int ucontext_t; |
| 176 inline void* GetPC(const ucontext_t& signal_ucontext) { |
| 177 // Bionic doesn't export ucontext, see |
| 178 // https://code.google.com/p/android/issues/detail?id=34784. |
| 179 return NULL; |
| 180 } |
| 181 #else |
| 182 // |
| 175 // Normal cases. If this doesn't compile, it's probably because | 183 // Normal cases. If this doesn't compile, it's probably because |
| 176 // PC_FROM_UCONTEXT is the empty string. You need to figure out | 184 // PC_FROM_UCONTEXT is the empty string. You need to figure out |
| 177 // the right value for your system, and add it to the list in | 185 // the right value for your system, and add it to the list in |
| 178 // configure.ac (or set it manually in your config.h). | 186 // configure.ac (or set it manually in your config.h). |
| 179 #else | |
| 180 inline void* GetPC(const ucontext_t& signal_ucontext) { | 187 inline void* GetPC(const ucontext_t& signal_ucontext) { |
| 181 return (void*)signal_ucontext.PC_FROM_UCONTEXT; // defined in config.h | 188 return (void*)signal_ucontext.PC_FROM_UCONTEXT; // defined in config.h |
| 182 } | 189 } |
| 183 | 190 |
| 184 #endif | 191 #endif |
| 185 | 192 |
| 186 #endif // BASE_GETPC_H_ | 193 #endif // BASE_GETPC_H_ |
| OLD | NEW |