* Added B_TEAM_DEBUG_DEFAULT_FLAGS and B_THREAD_DEBUG_DEFAULT_FLAGS for

convenience.
* Added/implemented callbacks for almost all missing debug events (team,
  thread, image creation/deletion, exceptions/faults, signals).
* The debugger can now specify how to deal with the event that stopped an
  event (ignore or handle signals, exceptions/faults).
* Implemented B_DEBUGGED_THREAD_GET_WHY_STOPPED debugger message.
* The cpu_state is now passed to the debugger with
  B_DEBUGGER_MESSAGE_THREAD_STOPPED notifications.
* Completed _user_debugger() implementation.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11474 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-02-24 16:07:19 +00:00
parent fc0eb1b266
commit e988d66022
2 changed files with 359 additions and 67 deletions
+28 -13
View File
@@ -7,7 +7,7 @@
#ifndef _KERNEL_USER_DEBUGGER_H
#define _KERNEL_USER_DEBUGGER_H
#include <OS.h>
#include <debugger.h>
struct team_debug_info {
int32 flags;
@@ -35,6 +35,10 @@ enum {
B_TEAM_DEBUG_DEBUGGER_INSTALLED = 0x0001,
B_TEAM_DEBUG_KERNEL_FLAG_MASK = 0xffff,
B_TEAM_DEBUG_DEFAULT_FLAGS = B_TEAM_DEBUG_SIGNALS
| B_TEAM_DEBUG_PRE_SYSCALL
| B_TEAM_DEBUG_POST_SYSCALL,
};
// thread debugging flags (user-specifiable flags are in <debugger.h>)
@@ -45,23 +49,24 @@ enum {
B_THREAD_DEBUG_STOPPED = 0x0008,
B_THREAD_DEBUG_KERNEL_FLAG_MASK = 0xffff,
B_THREAD_DEBUG_DEFAULT_FLAGS = 0,
};
// messages sent from the debug nub thread to a debugged thread
enum {
typedef enum {
B_DEBUGGED_THREAD_MESSAGE_CONTINUE = 0,
};
typedef union {
B_DEBUGGED_THREAD_GET_WHY_STOPPED,
} debugged_thread_message;
typedef struct {
uint32 handle_event;
} debugged_thread_run;
typedef union {
debugged_thread_run run;
} debugged_thread_message_data;
// Return value of user_debug_handle_signal(), telling the caller how to
// proceed.
enum {
B_THREAD_DEBUG_IGNORE_SIGNAL, // ignore the signal and continue
B_THREAD_DEBUG_HANDLE_SIGNAL, // handle the signal normally
};
#ifdef __cplusplus
extern "C" {
@@ -76,12 +81,22 @@ void clear_thread_debug_info(struct thread_debug_info *info,
bool dying);
void destroy_thread_debug_info(struct thread_debug_info *info);
// debug event callbacks
void user_debug_pre_syscall(uint32 syscall, void *args);
void user_debug_post_syscall(uint32 syscall, void *args, uint64 returnValue,
bigtime_t startTime);
uint32 user_debug_handle_signal(int signal, bool deadly);
bool user_debug_fault_occurred(debug_why_stopped fault);
bool user_debug_handle_signal(int signal, struct sigaction *handler,
bool deadly);
void user_debug_stop_thread();
void user_debug_team_created(team_id teamID);
void user_debug_team_deleted(team_id teamID, port_id debuggerPort);
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);
// syscalls