Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151132432
D22191.id135746.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D22191.id135746.diff
View Options
diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c
--- a/sys/ddb/db_break.c
+++ b/sys/ddb/db_break.c
@@ -39,6 +39,8 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
+#include <machine/kdb.h>
+
#include <ddb/ddb.h>
#include <ddb/db_break.h>
#include <ddb/db_access.h>
@@ -245,11 +247,45 @@
db_set_breakpoint(db_map_addr(addr), (db_addr_t)addr, count);
}
+#ifdef HAS_HW_BREAKPOINT
+/* Delete hardware breakpoint */
+void
+db_deletehbreak_cmd(db_expr_t addr, bool have_addr, db_expr_t count,
+ char *modif)
+{
+ int rc;
+
+ if (count == -1)
+ count = 1;
+
+ rc = kdb_cpu_clr_breakpoint(addr, count);
+ if (rc < 0)
+ db_printf("hardware breakpoint could not be delete\n");
+}
+
+/* Set hardware breakpoint */
+void
+db_hbreakpoint_cmd(db_expr_t addr, bool have_addr, db_expr_t count, char *modif)
+{
+ int rc;
+
+ if (count == -1)
+ count = 1;
+
+ rc = kdb_cpu_set_breakpoint(addr, count);
+ if (rc < 0)
+ db_printf("hardware breakpoint could not be set\n");
+}
+#endif
+
/* list breakpoints */
void
db_listbreak_cmd(db_expr_t dummy1, bool dummy2, db_expr_t dummy3, char *dummy4)
{
db_list_breakpoints();
+#ifdef HAS_HW_BREAKPOINT
+ db_md_list_breakpoints();
+#endif
}
/*
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -126,6 +126,10 @@
DB_CMD("delete", db_delete_cmd, 0),
DB_CMD("d", db_delete_cmd, 0),
DB_CMD("dump", db_dump, DB_CMD_MEMSAFE),
+#ifdef HAS_HW_BREAKPOINT
+ DB_CMD("dhbreak", db_deletehbreak_cmd, 0),
+ DB_CMD("hbreak", db_hbreakpoint_cmd, 0),
+#endif
DB_CMD("break", db_breakpoint_cmd, 0),
DB_CMD("b", db_breakpoint_cmd, 0),
DB_CMD("dwatch", db_deletewatch_cmd, 0),
diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h
--- a/sys/ddb/ddb.h
+++ b/sys/ddb/ddb.h
@@ -298,6 +298,13 @@
db_cmdfcn_t db_watchpoint_cmd;
db_cmdfcn_t db_write_cmd;
+#ifdef HAS_HW_BREAKPOINT
+void db_md_list_breakpoints(void);
+
+db_cmdfcn_t db_deletehbreak_cmd;
+db_cmdfcn_t db_hbreakpoint_cmd;
+#endif
+
/*
* Interface between DDB and the DDB output capture facility.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 7:34 AM (1 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31018854
Default Alt Text
D22191.id135746.diff (2 KB)
Attached To
Mode
D22191: sys/ddb: Add hardware breakpoint support to ddb
Attached
Detach File
Event Timeline
Log In to Comment