diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ddb/db_break.c | 10 | ||||
-rw-r--r-- | ddb/db_break.h | 5 |
3 files changed, 15 insertions, 4 deletions
@@ -9,6 +9,10 @@ u_int16_t, int32_t, uint32_t, u_int32_t, int64_t, uint64_t, u_int64_t): New types. * ddb/db_sym.c (db_task_printsym): Do not print empty symbols. + * ddb/db_break.c (db_set_breakpoint): Add db_breakpoint_t return type, + return the breakpoint in non-ddb case. + * ddb/db_break.h (BKPT_EXTERNAL): New macro. + (db_set_breakpoint): Add declaration. 2008-07-15 Barry deFreese <bddebian@comcast.net> diff --git a/ddb/db_break.c b/ddb/db_break.c index c8e12f5..9b1d604 100644 --- a/ddb/db_break.c +++ b/ddb/db_break.c @@ -264,7 +264,7 @@ db_check_breakpoint_valid() } } -void +db_breakpoint_t db_set_breakpoint(task, addr, count, thread, task_bpt) task_t task; db_addr_t addr; @@ -281,17 +281,17 @@ db_set_breakpoint(task, addr, count, thread, task_bpt) if (thread == THREAD_NULL || db_find_thread_breakpoint(bkpt, thread)) { db_printf("Already set.\n"); - return; + return NULL; } } else { if (!DB_CHECK_ACCESS(addr, BKPT_SIZE, task)) { db_printf("Cannot set break point at %X\n", addr); - return; + return NULL; } alloc_bkpt = bkpt = db_breakpoint_alloc(); if (bkpt == 0) { db_printf("Too many breakpoints.\n"); - return; + return NULL; } bkpt->task = task; bkpt->flags = (task && thread == THREAD_NULL)? @@ -306,12 +306,14 @@ db_set_breakpoint(task, addr, count, thread, task_bpt) if (alloc_bkpt) db_breakpoint_free(alloc_bkpt); db_printf("Too many thread_breakpoints.\n"); + return NULL; } else { db_printf("set breakpoint #%d\n", db_breakpoint_number); if (alloc_bkpt) { bkpt->link = db_breakpoint_list; db_breakpoint_list = bkpt; } + return bkpt; } } diff --git a/ddb/db_break.h b/ddb/db_break.h index ec7d880..20d74d2 100644 --- a/ddb/db_break.h +++ b/ddb/db_break.h @@ -64,6 +64,7 @@ struct db_breakpoint { #define BKPT_USR_GLOBAL 0x8 /* global user space break point */ #define BKPT_SET_IN_MEM 0x10 /* break point is set in memory */ #define BKPT_1ST_SET 0x20 /* 1st time set of user global bkpt */ +#define BKPT_EXTERNAL 0x40 /* break point is not from ddb */ vm_size_t bkpt_inst; /* saved instruction at bkpt */ struct db_breakpoint *link; /* link in in-use or free chain */ }; @@ -83,4 +84,8 @@ extern db_breakpoint_t db_set_temp_breakpoint( task_t task, db_addr_t addr); extern void db_delete_temp_breakpoint ( task_t task, db_breakpoint_t bkpt); +extern db_breakpoint_t db_set_breakpoint(task_t task, db_addr_t addr, + int count, thread_t thread, + boolean_t task_bpt); + #endif /* _DDB_DB_BREAK_H_ */ |