mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
util/u_debug_symbol: remove debug_symbol_name_glibc and execinfo dependency
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12108>
This commit is contained in:
parent
90be0d7963
commit
973e9e25bd
1 changed files with 0 additions and 31 deletions
|
|
@ -218,31 +218,6 @@ debug_symbol_name_dbghelp(const void *addr, char* buf, unsigned size)
|
|||
|
||||
#endif /* PIPE_OS_WINDOWS */
|
||||
|
||||
|
||||
#if defined(HAVE_EXECINFO_H)
|
||||
|
||||
#include <execinfo.h>
|
||||
|
||||
/* This can only provide dynamic symbols, or binary offsets into a file.
|
||||
*
|
||||
* To fix this, post-process the output with tools/addr2line.sh
|
||||
*/
|
||||
static inline boolean
|
||||
debug_symbol_name_glibc(const void *addr, char* buf, unsigned size)
|
||||
{
|
||||
char** syms = backtrace_symbols((void**)&addr, 1);
|
||||
if (!syms) {
|
||||
return FALSE;
|
||||
}
|
||||
strncpy(buf, syms[0], size - 1);
|
||||
buf[size - 1] = 0;
|
||||
free(syms);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_EXECINFO_H) */
|
||||
|
||||
|
||||
void
|
||||
debug_symbol_name(const void *addr, char* buf, unsigned size)
|
||||
{
|
||||
|
|
@ -252,12 +227,6 @@ debug_symbol_name(const void *addr, char* buf, unsigned size)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_EXECINFO_H)
|
||||
if (debug_symbol_name_glibc(addr, buf, size)) {
|
||||
return;
|
||||
}
|
||||
#endif /* defined(HAVE_EXECINFO_H) */
|
||||
|
||||
snprintf(buf, size, "%p", addr);
|
||||
buf[size - 1] = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue