From ae7c619aaeb01051fe697079b8e3c1fdfaf955dd Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 1 Mar 2005 23:47:59 +0000 Subject: [PATCH] * Added architecture specific structure to thread_debug_info. * Added event callbacks for break- and watchpoints and single stepping. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11520 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/user_debugger.h | 4 ++++ src/kernel/core/user_debugger.cpp | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/headers/private/kernel/user_debugger.h b/headers/private/kernel/user_debugger.h index b1c8b2bc6a..085e5be577 100644 --- a/headers/private/kernel/user_debugger.h +++ b/headers/private/kernel/user_debugger.h @@ -51,6 +51,8 @@ struct thread_debug_info { // won't go). port_id debug_port; // the port the thread is waiting on for commands from the nub thread + + struct arch_thread_debug_info arch_info; }; #define GRAB_TEAM_DEBUG_INFO_LOCK(info) acquire_spinlock(&(info).lock) @@ -131,6 +133,8 @@ void user_debug_thread_created(thread_id threadID); void user_debug_thread_deleted(team_id teamID, thread_id threadID); void user_debug_image_created(const image_info *imageInfo); void user_debug_image_deleted(const image_info *imageInfo); +void user_debug_break_or_watchpoint_hit(bool watchpoint); +void user_debug_single_stepped(); // syscalls diff --git a/src/kernel/core/user_debugger.cpp b/src/kernel/core/user_debugger.cpp index 9067fbadbc..61996935a1 100644 --- a/src/kernel/core/user_debugger.cpp +++ b/src/kernel/core/user_debugger.cpp @@ -116,6 +116,7 @@ void clear_thread_debug_info(struct thread_debug_info *info, bool dying) { if (info) { + arch_clear_thread_debug_info(&info->arch_info); atomic_set(&info->flags, B_THREAD_DEBUG_DEFAULT_FLAGS | (dying ? B_THREAD_DEBUG_DYING : 0)); info->debug_port = -1; @@ -127,6 +128,8 @@ void destroy_thread_debug_info(struct thread_debug_info *info) { if (info) { + arch_destroy_thread_debug_info(&info->arch_info); + if (info->debug_port >= 0) { delete_port(info->debug_port); info->debug_port = -1; @@ -650,6 +653,20 @@ user_debug_image_deleted(const image_info *imageInfo) } +void +user_debug_break_or_watchpoint_hit(bool watchpoint) +{ + stop_thread((watchpoint ? B_WATCHPOINT_HIT : B_BREAKPOINT_HIT), NULL); +} + + +void +user_debug_single_stepped() +{ + stop_thread(B_SINGLE_STEP, NULL); +} + + static void nub_thread_cleanup(struct thread *nubThread) {