Allow building with backtrace symbols.
This commit is contained in:
@@ -97,7 +97,7 @@ RString BacktraceNames::Format() const
|
||||
#if defined(BACKTRACE_LOOKUP_METHOD_DLADDR)
|
||||
/* This version simply asks libdl, which is more robust. */
|
||||
#include <dlfcn.h>
|
||||
void BacktraceNames::FromAddr( const void *p )
|
||||
void BacktraceNames::FromAddr( void * const p )
|
||||
{
|
||||
Address = (intptr_t) p;
|
||||
|
||||
@@ -222,7 +222,7 @@ static const char *osx_find_link_edit( const struct mach_header *header )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void BacktraceNames::FromAddr( const void *p )
|
||||
void BacktraceNames::FromAddr( void * const p )
|
||||
{
|
||||
Address = (intptr_t) p;
|
||||
|
||||
@@ -294,7 +294,7 @@ void BacktraceNames::FromAddr( const void *p )
|
||||
#elif defined(BACKTRACE_LOOKUP_METHOD_BACKTRACE_SYMBOLS)
|
||||
/* This version parses backtrace_symbols(), an doesn't need libdl. */
|
||||
#include <execinfo.h>
|
||||
void BacktraceNames::FromAddr( const void *p )
|
||||
void BacktraceNames::FromAddr( void * const p )
|
||||
{
|
||||
Address = (intptr_t) p;
|
||||
|
||||
@@ -342,7 +342,7 @@ void BacktraceNames::FromString( RString s )
|
||||
}
|
||||
#else
|
||||
#warning Undefined BACKTRACE_LOOKUP_METHOD_*
|
||||
void BacktraceNames::FromAddr( const void *p )
|
||||
void BacktraceNames::FromAddr( void * const p )
|
||||
{
|
||||
Address = intptr_t(p);
|
||||
Offset = 0;
|
||||
|
||||
@@ -6,7 +6,7 @@ struct BacktraceNames
|
||||
RString Symbol, File;
|
||||
intptr_t Address;
|
||||
int Offset;
|
||||
void FromAddr( const void *p );
|
||||
void FromAddr( void * const p );
|
||||
void FromString( RString str );
|
||||
void Demangle();
|
||||
RString Format() const;
|
||||
|
||||
@@ -46,7 +46,7 @@ static void output_stack_trace( FILE *out, const void **BacktracePointers )
|
||||
for( int i = 0; BacktracePointers[i]; ++i)
|
||||
{
|
||||
BacktraceNames bn;
|
||||
bn.FromAddr( BacktracePointers[i] );
|
||||
bn.FromAddr( const_cast<void *>(BacktracePointers[i]) );
|
||||
bn.Demangle();
|
||||
|
||||
/* Don't show the main module name. */
|
||||
|
||||
Reference in New Issue
Block a user