A module that hooks into the debugger to provide it with a demangle() so at least when using C++ in the kernel stack crawls are meaningful.
It does its job by using part of libsupc++, with fake malloc and friends to make sure it won't double fault. Works here, but cp-demangle must be extracted by hand from the lib, can't get the rule to work as I want, Ingo ? Maybe using it directly without malloc hack would be ok with 16KB buffer, but I'm not sure of that. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26581 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -89,6 +89,8 @@ static const uint32 kMaxDebuggerModules = sizeof(sDebuggerModules)
|
||||
static char sLineBuffer[HISTORY_SIZE][LINE_BUFFER_SIZE] = { "", };
|
||||
static int32 sCurrentLine = 0;
|
||||
|
||||
static const char *(*sDemangleHook)(const char *) = NULL;
|
||||
|
||||
#define distance(a, b) ((a) < (b) ? (b) - (a) : (a) - (b))
|
||||
|
||||
|
||||
@@ -1383,3 +1385,20 @@ dump_block(const char *buffer, int size, const char *prefix)
|
||||
dprintf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern void
|
||||
debug_set_demangle_hook(const char *(*hook)(const char *))
|
||||
{
|
||||
sDemangleHook = hook;
|
||||
}
|
||||
|
||||
|
||||
extern const char *
|
||||
debug_demangle(const char *sym)
|
||||
{
|
||||
if (sDemangleHook)
|
||||
return sDemangleHook(sym);
|
||||
return sym;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user