| 6 | // |
| 7 | // https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 |
| 15 | // SKIP_ABSL_INLINE_NAMESPACE_CHECK |
| 16 |
| 17 | #include "absl/debugging/symbolize.h" |
| 18 |
| 19 | #ifdef _WIN32 |
| 20 | #include <winapifamily.h> |
| 21 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| 22 | // UWP doesn't have access to win32 APIs. |
| 23 | #define ABSL_INTERNAL_HAVE_SYMBOLIZE_WIN32 |
| 24 | #endif |
| 25 | #endif |
| 26 |
| 27 | // Emscripten symbolization relies on JS. Do not use them in standalone mode. |
| 28 | #if defined(__EMSCRIPTEN__) && !defined(STANDALONE_WASM) |
| 29 | #define ABSL_INTERNAL_HAVE_SYMBOLIZE_WASM |
| 30 | #endif |
| 31 |
| 32 | #if defined(ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE) |
| 33 | #include "absl/debugging/symbolize_elf.inc" |
| 34 | #elif defined(ABSL_INTERNAL_HAVE_SYMBOLIZE_WIN32) |
| 35 | // The Windows Symbolizer only works if PDB files containing the debug info |
| 36 | // are available to the program at runtime. |
| 37 | #include "absl/debugging/symbolize_win32.inc" |
| 38 | #elif defined(__APPLE__) |
| 39 | #include "absl/debugging/symbolize_darwin.inc" |
| 40 | #elif defined(ABSL_INTERNAL_HAVE_SYMBOLIZE_WASM) |
| 41 | #include "absl/debugging/symbolize_emscripten.inc" |
| 42 | #else |
| 43 | #include "absl/debugging/symbolize_unimplemented.inc" |
| 44 | #endif |
| 45 |