medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ca62ca8a590238ece80108e0aa280a1ebcd389ab
parent b30be0ce210961955243b456a7f98c1b598ccfcb
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Nov  5 17:06:57 +0200

No need for backtraces when debuggers do it for you

Diffstat:
intrinsics.h | 3---
linuxdarwin_backtrace.h | 15---------------
platform_backtrace.h | 15---------------
3 files changed, 0 insertions(+), 33 deletions(-)
diff --git a/intrinsics.h b/intrinsics.h @@ -87,8 +87,6 @@ T clamp11( T x ) { #define slots_required( data_size, slot_size ) ( ( data_size ) / ( slot_size ) + ( ( data_size ) % ( slot_size ) != 0 ) ) -#include "platform_backtrace.h" - #if defined( assert ) #undef assert #endif @@ -98,7 +96,6 @@ inline void mike_assert( const bool predicate, const char * message ) { puts( message ); int err = errno; printf( "errno(%d): %s\n", err, strerror( err ) ); - print_backtrace(); // TODO #if defined( __GNUC__ ) __builtin_trap(); diff --git a/linuxdarwin_backtrace.h b/linuxdarwin_backtrace.h @@ -1,15 +0,0 @@ -#ifndef _LINUXDARWIN_BACKTRACE_H_ -#define _LINUXDARWIN_BACKTRACE_H_ - -#include <unistd.h> -#include <execinfo.h> - -#include "intrinsics.h" - -inline void print_backtrace() { - void * stack[ 128 ]; - const int stack_size = backtrace( stack, array_count( stack ) ); - backtrace_symbols_fd( stack, stack_size, STDERR_FILENO ); -} - -#endif // _LINUXDARWIN_BACKTRACE_H_ diff --git a/platform_backtrace.h b/platform_backtrace.h @@ -1,15 +0,0 @@ -#ifndef _PLATFORM_BACKTRACE_H_ -#define _PLATFORM_BACKTRACE_H_ - -#if defined( __linux__ ) || defined( __APPLE__ ) -#include "linuxdarwin_backtrace.h" -#elif defined( _WIN32 ) -#include <stdio.h> -inline void print_backtrace() { - printf( "implement print_backtrace!!!!\n" ); -} -#else -#error new platform -#endif - -#endif // _PLATFORM_BACKTRACE_H_