Introduced the notion of a currently debugged thread in the kernel
debugger and added respective getter/setter methods
debug_{get,set}_debugged_thread(). By default the currently debugged
thread is the thread that dropped into the kernel debugger, but commands
like "in_context" can change it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27164 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -93,6 +93,8 @@ static int32 sCurrentLine = 0;
|
||||
|
||||
static const char *(*sDemangleHook)(const char *) = NULL;
|
||||
|
||||
static struct thread* sDebuggedThread;
|
||||
|
||||
#define distance(a, b) ((a) < (b) ? (b) - (a) : (a) - (b))
|
||||
|
||||
|
||||
@@ -1216,6 +1218,8 @@ kernel_debugger(const char *message)
|
||||
|
||||
sDebugOutputFilter = &gDefaultDebugOutputFilter;
|
||||
|
||||
sDebuggedThread = NULL;
|
||||
|
||||
if (message)
|
||||
kprintf("PANIC: %s\n", message);
|
||||
|
||||
@@ -1426,6 +1430,23 @@ debug_demangle(const char *sym)
|
||||
}
|
||||
|
||||
|
||||
struct thread*
|
||||
debug_set_debugged_thread(struct thread* thread)
|
||||
{
|
||||
struct thread* previous = sDebuggedThread;
|
||||
sDebuggedThread = thread;
|
||||
return previous;
|
||||
}
|
||||
|
||||
|
||||
struct thread*
|
||||
debug_get_debugged_thread()
|
||||
{
|
||||
return sDebuggedThread != NULL
|
||||
? sDebuggedThread : thread_get_current_thread();
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// userland syscalls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user