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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 } | 766 } |
767 FileDescriptor wrapped_object_fd(object_fd); | 767 FileDescriptor wrapped_object_fd(object_fd); |
768 int elf_type = FileGetElfType(wrapped_object_fd.get()); | 768 int elf_type = FileGetElfType(wrapped_object_fd.get()); |
769 if (elf_type == -1) { | 769 if (elf_type == -1) { |
770 return false; | 770 return false; |
771 } | 771 } |
772 if (g_symbolize_callback) { | 772 if (g_symbolize_callback) { |
773 // Run the call back if it's installed. | 773 // Run the call back if it's installed. |
774 // Note: relocation (and much of the rest of this code) will be | 774 // Note: relocation (and much of the rest of this code) will be |
775 // wrong for prelinked shared libraries and PIE executables. | 775 // wrong for prelinked shared libraries and PIE executables. |
776 uint64 relocation = (elf_type == ET_DYN) ? start_address : 0; | 776 uint64_t relocation = (elf_type == ET_DYN) ? start_address : 0; |
777 int num_bytes_written = g_symbolize_callback(wrapped_object_fd.get(), | 777 int num_bytes_written = g_symbolize_callback(wrapped_object_fd.get(), |
778 pc, out, out_size, | 778 pc, out, out_size, |
779 relocation); | 779 relocation); |
780 if (num_bytes_written > 0) { | 780 if (num_bytes_written > 0) { |
781 out += num_bytes_written; | 781 out += num_bytes_written; |
782 out_size -= num_bytes_written; | 782 out_size -= num_bytes_written; |
783 } | 783 } |
784 } | 784 } |
785 if (!GetSymbolFromObjectFile(wrapped_object_fd.get(), pc0, | 785 if (!GetSymbolFromObjectFile(wrapped_object_fd.get(), pc0, |
786 out, out_size, start_address)) { | 786 out, out_size, start_address)) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 | 840 |
841 // TODO: Support other environments. | 841 // TODO: Support other environments. |
842 bool Symbolize(void *pc, char *out, int out_size) { | 842 bool Symbolize(void *pc, char *out, int out_size) { |
843 assert(0); | 843 assert(0); |
844 return false; | 844 return false; |
845 } | 845 } |
846 | 846 |
847 _END_GOOGLE_NAMESPACE_ | 847 _END_GOOGLE_NAMESPACE_ |
848 | 848 |
849 #endif | 849 #endif |
OLD | NEW |