summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/db_interface.c12
-rw-r--r--i386/i386/db_interface.h58
-rw-r--r--i386/i386/db_machdep.h6
-rw-r--r--i386/i386/db_trace.c1
-rw-r--r--i386/i386/trap.c5
5 files changed, 75 insertions, 7 deletions
diff --git a/i386/i386/db_interface.c b/i386/i386/db_interface.c
index f254776..cf1e1c4 100644
--- a/i386/i386/db_interface.c
+++ b/i386/i386/db_interface.c
@@ -45,9 +45,16 @@
#include "vm_param.h"
#include <vm/vm_map.h>
#include <kern/cpu_number.h>
+#include <kern/printf.h>
#include <kern/thread.h>
#include <kern/task.h>
+#include <ddb/db_access.h>
+#include <ddb/db_command.h>
+#include <ddb/db_output.h>
+#include <ddb/db_run.h>
#include <ddb/db_task_thread.h>
+#include <ddb/db_trap.h>
+#include <machine/db_interface.h>
#include <machine/machspl.h>
struct i386_saved_state *i386_last_saved_statep;
@@ -59,6 +66,7 @@ extern thread_t db_default_thread;
/*
* Print trap reason.
*/
+void
kdbprinttrap(type, code)
int type, code;
{
@@ -258,7 +266,7 @@ int
db_user_to_kernel_address(
task_t task,
vm_offset_t addr,
- unsigned *kaddr,
+ unsigned int *kaddr,
int flag)
{
register pt_entry_t *ptp;
@@ -518,7 +526,7 @@ db_task_name(
task_t task)
{
register char *p;
- register n;
+ register int n;
unsigned vaddr, kaddr;
vaddr = DB_USER_STACK_ADDR;
diff --git a/i386/i386/db_interface.h b/i386/i386/db_interface.h
new file mode 100644
index 0000000..8cd1690
--- /dev/null
+++ b/i386/i386/db_interface.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Barry deFreese.
+ */
+
+#ifndef _I386_DB_INTERFACE_H_
+#define _I386_DB_INTERFACE_H_
+
+#include <sys/types.h>
+#include <kern/task.h>
+#include <machine/thread.h>
+
+extern boolean_t kdb_trap (
+ int type,
+ int code,
+ struct i386_saved_state *regs);
+
+extern void db_read_bytes (
+ vm_offset_t addr,
+ int size,
+ char *data,
+ task_t task);
+
+extern void db_write_bytes (
+ vm_offset_t addr,
+ int size,
+ char *data,
+ task_t task);
+
+extern boolean_t db_check_access (
+ vm_offset_t addr,
+ int size,
+ task_t task);
+
+extern boolean_t db_phys_eq (
+ task_t task1,
+ vm_offset_t addr1,
+ task_t task2,
+ vm_offset_t addr2);
+
+extern void db_task_name (task_t task);
+
+#endif /* _I386_DB_INTERFACE_H_ */
diff --git a/i386/i386/db_machdep.h b/i386/i386/db_machdep.h
index ee5853a..cba259c 100644
--- a/i386/i386/db_machdep.h
+++ b/i386/i386/db_machdep.h
@@ -34,6 +34,7 @@
#include <mach/machine/vm_types.h>
#include <mach/machine/vm_param.h>
#include <mach/machine/eflags.h>
+#include <machine/db_interface.h>
#include <i386/thread.h> /* for thread_status */
#include <i386/trap.h>
@@ -87,9 +88,6 @@ db_regs_t ddb_regs; /* register state */
((!(user) && DB_VALID_KERN_ADDR(addr)) || \
((user) && (addr) < VM_MIN_KERNEL_ADDRESS))
-boolean_t db_check_access(/* vm_offset_t, int, task_t */);
-boolean_t db_phys_eq(/* task_t, vm_offset_t, task_t, vm_offset_t */);
-
/* macros for printing OS server dependent task name */
#define DB_TASK_NAME(task) db_task_name(task)
@@ -97,8 +95,6 @@ boolean_t db_phys_eq(/* task_t, vm_offset_t, task_t, vm_offset_t */);
#define DB_TASK_NAME_LEN 23
#define DB_NULL_TASK_NAME "? "
-void db_task_name(/* task_t */);
-
/* macro for checking if a thread has used floating-point */
#define db_thread_fp_used(thread) ((thread)->pcb->ims.ifps != 0)
diff --git a/i386/i386/db_trace.c b/i386/i386/db_trace.c
index 4402161..d1c9512 100644
--- a/i386/i386/db_trace.c
+++ b/i386/i386/db_trace.c
@@ -124,6 +124,7 @@ db_lookup_i386_kreg(
return 0;
}
+int
db_i386_reg_value(
struct db_variable *vp,
db_expr_t *valuep,
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index bd0d8e0..2cb81e6 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -52,6 +52,11 @@
#include <i386/io_emulate.h>
+#if MACH_KDB
+#include <ddb/db_run.h>
+#include <ddb/db_watch.h>
+#endif
+
#include "debug.h"
extern void exception();