| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // - The callbacks must be async-signal-safe. | 110 // - The callbacks must be async-signal-safe. |
| 111 | 111 |
| 112 // Installs a callback function, which will be called right before a symbol name | 112 // Installs a callback function, which will be called right before a symbol name |
| 113 // is printed. The callback is intended to be used for showing a file name and a | 113 // is printed. The callback is intended to be used for showing a file name and a |
| 114 // line number preceding a symbol name. | 114 // line number preceding a symbol name. |
| 115 // "fd" is a file descriptor of the object file containing the program | 115 // "fd" is a file descriptor of the object file containing the program |
| 116 // counter "pc". The callback function should write output to "out" | 116 // counter "pc". The callback function should write output to "out" |
| 117 // and return the size of the output written. On error, the callback | 117 // and return the size of the output written. On error, the callback |
| 118 // function should return -1. | 118 // function should return -1. |
| 119 typedef int (*SymbolizeCallback)(int fd, void *pc, char *out, size_t out_size, | 119 typedef int (*SymbolizeCallback)(int fd, void *pc, char *out, size_t out_size, |
| 120 uint64 relocation); | 120 uint64_t relocation); |
| 121 void InstallSymbolizeCallback(SymbolizeCallback callback); | 121 void InstallSymbolizeCallback(SymbolizeCallback callback); |
| 122 | 122 |
| 123 // Installs a callback function, which will be called instead of | 123 // Installs a callback function, which will be called instead of |
| 124 // OpenObjectFileContainingPcAndGetStartAddress. The callback is expected | 124 // OpenObjectFileContainingPcAndGetStartAddress. The callback is expected |
| 125 // to searches for the object file (from /proc/self/maps) that contains | 125 // to searches for the object file (from /proc/self/maps) that contains |
| 126 // the specified pc. If found, sets |start_address| to the start address | 126 // the specified pc. If found, sets |start_address| to the start address |
| 127 // of where this object file is mapped in memory, sets the module base | 127 // of where this object file is mapped in memory, sets the module base |
| 128 // address into |base_address|, copies the object file name into | 128 // address into |base_address|, copies the object file name into |
| 129 // |out_file_name|, and attempts to open the object file. If the object | 129 // |out_file_name|, and attempts to open the object file. If the object |
| 130 // file is opened successfully, returns the file descriptor. Otherwise, | 130 // file is opened successfully, returns the file descriptor. Otherwise, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 146 | 146 |
| 147 // Symbolizes a program counter. On success, returns true and write the | 147 // Symbolizes a program counter. On success, returns true and write the |
| 148 // symbol name to "out". The symbol name is demangled if possible | 148 // symbol name to "out". The symbol name is demangled if possible |
| 149 // (supports symbols generated by GCC 3.x or newer). Otherwise, | 149 // (supports symbols generated by GCC 3.x or newer). Otherwise, |
| 150 // returns false. | 150 // returns false. |
| 151 bool Symbolize(void *pc, char *out, int out_size); | 151 bool Symbolize(void *pc, char *out, int out_size); |
| 152 | 152 |
| 153 _END_GOOGLE_NAMESPACE_ | 153 _END_GOOGLE_NAMESPACE_ |
| 154 | 154 |
| 155 #endif // BASE_SYMBOLIZE_H_ | 155 #endif // BASE_SYMBOLIZE_H_ |
| OLD | NEW |