Add heap_debug_set_debugger_calls() which allows to disable debugger calls for

the heap debug panics. Instead syslog output is generated if turned off.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35481 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2010-02-15 21:35:07 +00:00
parent c1502cf1b8
commit ac653a30df
2 changed files with 19 additions and 6 deletions

View File

@ -16,6 +16,7 @@ status_t heap_debug_stop_wall_checking();
void heap_debug_set_memory_reuse(bool enabled);
void heap_debug_set_paranoid_validation(bool enabled);
void heap_debug_set_debugger_calls(bool enabled);
void heap_debug_validate_heaps();
void heap_debug_validate_walls();

View File

@ -32,6 +32,13 @@
#define ASSERT(x) if (!(x)) panic("assert failed: %s", #x);
static bool sDebuggerCalls = true;
static bool sReuseMemory = true;
static bool sParanoidValidation = false;
static thread_id sWallCheckThread = -1;
static bool sStopWallChecking = false;
void
panic(const char *format, ...)
{
@ -42,7 +49,10 @@ panic(const char *format, ...)
vsnprintf(buffer, sizeof(buffer), format, args);
va_end(args);
debugger(buffer);
if (sDebuggerCalls)
debugger(buffer);
else
debug_printf(buffer);
}
@ -52,11 +62,6 @@ panic(const char *format, ...)
#define HEAP_GROW_SIZE 2 * 1024 * 1024
#define HEAP_AREA_USE_THRESHOLD 1 * 1024 * 1024
static bool sReuseMemory = true;
static bool sParanoidValidation = false;
static thread_id sWallCheckThread = -1;
static bool sStopWallChecking = false;
typedef struct heap_leak_check_info_s {
size_t size;
thread_id thread;
@ -1656,6 +1661,13 @@ heap_debug_set_memory_reuse(bool enabled)
}
extern "C" void
heap_debug_set_debugger_calls(bool enabled)
{
sDebuggerCalls = enabled;
}
extern "C" void
heap_debug_validate_heaps()
{