| OLD | NEW |
| 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 28 matching lines...) Expand all Loading... |
| 39 // - sizeof(Elf32_Sym) = 16 | 39 // - sizeof(Elf32_Sym) = 16 |
| 40 // - sizeof(Elf32_Shdr) = 40 | 40 // - sizeof(Elf32_Shdr) = 40 |
| 41 // - sizeof(Elf64_Sym) = 24 | 41 // - sizeof(Elf64_Sym) = 24 |
| 42 // - sizeof(Elf64_Shdr) = 64 | 42 // - sizeof(Elf64_Shdr) = 64 |
| 43 // | 43 // |
| 44 // This implementation is intended to be async-signal-safe but uses | 44 // This implementation is intended to be async-signal-safe but uses |
| 45 // some functions which are not guaranteed to be so, such as memchr() | 45 // some functions which are not guaranteed to be so, such as memchr() |
| 46 // and memmove(). We assume they are async-signal-safe. | 46 // and memmove(). We assume they are async-signal-safe. |
| 47 // | 47 // |
| 48 | 48 |
| 49 #include "build/build_config.h" |
| 49 #include "utilities.h" | 50 #include "utilities.h" |
| 50 | 51 |
| 51 #if defined(HAVE_SYMBOLIZE) | 52 #if defined(HAVE_SYMBOLIZE) |
| 52 | 53 |
| 53 #include <limits> | 54 #include <limits> |
| 54 | 55 |
| 55 #include "symbolize.h" | 56 #include "symbolize.h" |
| 56 #include "demangle.h" | 57 #include "demangle.h" |
| 57 | 58 |
| 58 _START_GOOGLE_NAMESPACE_ | 59 _START_GOOGLE_NAMESPACE_ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 88 memmove(out, demangled, len + 1); | 89 memmove(out, demangled, len + 1); |
| 89 } | 90 } |
| 90 } | 91 } |
| 91 } | 92 } |
| 92 | 93 |
| 93 _END_GOOGLE_NAMESPACE_ | 94 _END_GOOGLE_NAMESPACE_ |
| 94 | 95 |
| 95 #if defined(__ELF__) | 96 #if defined(__ELF__) |
| 96 | 97 |
| 97 #include <dlfcn.h> | 98 #include <dlfcn.h> |
| 99 #if defined(OS_OPENBSD) |
| 100 #include <sys/exec_elf.h> |
| 101 #else |
| 98 #include <elf.h> | 102 #include <elf.h> |
| 103 #endif |
| 99 #include <errno.h> | 104 #include <errno.h> |
| 100 #include <fcntl.h> | 105 #include <fcntl.h> |
| 101 #include <limits.h> | 106 #include <limits.h> |
| 102 #include <stdint.h> | 107 #include <stdint.h> |
| 103 #include <stdio.h> | 108 #include <stdio.h> |
| 104 #include <stdlib.h> | 109 #include <stdlib.h> |
| 105 #include <stddef.h> | 110 #include <stddef.h> |
| 106 #include <string.h> | 111 #include <string.h> |
| 107 #include <sys/stat.h> | 112 #include <sys/stat.h> |
| 108 #include <sys/types.h> | 113 #include <sys/types.h> |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 676 |
| 672 // TODO: Support other environments. | 677 // TODO: Support other environments. |
| 673 bool Symbolize(void *pc, char *out, int out_size) { | 678 bool Symbolize(void *pc, char *out, int out_size) { |
| 674 assert(0); | 679 assert(0); |
| 675 return false; | 680 return false; |
| 676 } | 681 } |
| 677 | 682 |
| 678 _END_GOOGLE_NAMESPACE_ | 683 _END_GOOGLE_NAMESPACE_ |
| 679 | 684 |
| 680 #endif | 685 #endif |
| OLD | NEW |