summaryrefslogtreecommitdiff
path: root/ddb
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-07-18 21:41:27 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:17 +0200
commit4df0f89aa4f32b12aab06d81d6ce91a12a64553e (patch)
tree4a1134d42e4ab33317fe9d46a23f55f8198985dd /ddb
parentbf2568df343288fb3644848c3498bd080b6bbde8 (diff)
2008-07-18 Andrei Barbu <andrei@0xab.com>
* 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.
Diffstat (limited to 'ddb')
-rw-r--r--ddb/db_break.c10
-rw-r--r--ddb/db_break.h5
2 files changed, 11 insertions, 4 deletions
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_ */