Symbolizes a program counter (instruction pointer value) pc and, on success, writes the name to out. The symbol name is demangled, if possible. Note that the symbolized name may be truncated and will be NUL-terminated. Demangling is supported for symbols generated by GCC 3.x or newer). Returns false on failure.
Declared in <absl/debugging/symbolize.h>
bool
Symbolize(
void const* pc,
char* out,
int out_size);
Example:
// Print a program counter and its symbol name. static void DumpPCAndSymbol(void *pc) { char tmp[1024]; const char *symbol = "(unknown)"; if (absl::Symbolize(pc, tmp, sizeof(tmp))) { symbol = tmp; } absl::PrintF("%p %sn", pc, symbol); }
True on success, false if the program counter could not be symbolized.
| Name | Description |
|---|---|
| pc | Program counter (instruction pointer value) to symbolize. |
| out | Buffer to receive the demangled symbol name. |
| out_size | Size, in bytes, of the out buffer. |