aboutsummaryrefslogtreecommitdiffstats
path: root/tools/debugger
diff options
context:
space:
mode:
authorach61@arcadians.cl.cam.ac.uk <ach61@arcadians.cl.cam.ac.uk>2005-08-01 10:43:16 +0000
committerach61@arcadians.cl.cam.ac.uk <ach61@arcadians.cl.cam.ac.uk>2005-08-01 10:43:16 +0000
commitdf47943bc5345bf3ccbdbcdffebc520d0c14f225 (patch)
tree45c4896c44d4bbc759604c0bd9bd3769595be157 /tools/debugger
parentb640da2bc5fe1ccf06fffdc12352c3be26335c59 (diff)
downloadxen-df47943bc5345bf3ccbdbcdffebc520d0c14f225.tar.gz
xen-df47943bc5345bf3ccbdbcdffebc520d0c14f225.tar.bz2
xen-df47943bc5345bf3ccbdbcdffebc520d0c14f225.zip
PDB: convert ptrace.c and traps.c changes to local patches
Diffstat (limited to 'tools/debugger')
-rw-r--r--tools/debugger/pdb/Makefile5
-rw-r--r--tools/debugger/pdb/linux-2.6-module/module.c9
-rw-r--r--tools/debugger/pdb/linux-2.6-patches/Makefile10
-rw-r--r--tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch11
-rw-r--r--tools/debugger/pdb/linux-2.6-patches/kdebug.patch11
-rw-r--r--tools/debugger/pdb/linux-2.6-patches/makefile.patch12
-rw-r--r--tools/debugger/pdb/linux-2.6-patches/ptrace.patch11
-rw-r--r--tools/debugger/pdb/linux-2.6-patches/traps.patch20
8 files changed, 81 insertions, 8 deletions
diff --git a/tools/debugger/pdb/Makefile b/tools/debugger/pdb/Makefile
index 12ec4be453..9652a11013 100644
--- a/tools/debugger/pdb/Makefile
+++ b/tools/debugger/pdb/Makefile
@@ -33,7 +33,7 @@ LIBDIRS += ../libxendebug
LIBS += unix str
# bc = byte-code, dc = debug byte-code
-all : dc
+all : patches dc
SOURCES += pdb_caml_xc.c
SOURCES += pdb_caml_domain.c pdb_caml_process.c
@@ -50,3 +50,6 @@ RESULT = pdb
include $(OCAMLMAKEFILE)
+PATCHDIR = ./linux-2.6-patches
+patches :
+ make -C $(PATCHDIR) patches
diff --git a/tools/debugger/pdb/linux-2.6-module/module.c b/tools/debugger/pdb/linux-2.6-module/module.c
index 811c95a26d..c75b9cd647 100644
--- a/tools/debugger/pdb/linux-2.6-module/module.c
+++ b/tools/debugger/pdb/linux-2.6-module/module.c
@@ -278,14 +278,10 @@ pdb_initialize (void)
return err;
}
-extern struct notifier_block *i386die_chain;
-extern spinlock_t die_notifier_lock;
-
static void __exit
pdb_terminate(void)
{
int err = 0;
- unsigned long flags;
printk("pdb cleanup\n");
@@ -305,9 +301,8 @@ pdb_terminate(void)
pdb_send_connection_status(PDB_CONNECTION_STATUS_DOWN, 0);
- spin_lock_irqsave(&die_notifier_lock, flags);
- err = notifier_chain_unregister(&i386die_chain, &pdb_exceptions_nb);
- spin_unlock_irqrestore(&die_notifier_lock, flags);
+ /* handler for int1 & int3 */
+ err = unregister_die_notifier(&pdb_exceptions_nb);
return;
}
diff --git a/tools/debugger/pdb/linux-2.6-patches/Makefile b/tools/debugger/pdb/linux-2.6-patches/Makefile
new file mode 100644
index 0000000000..7d062510d8
--- /dev/null
+++ b/tools/debugger/pdb/linux-2.6-patches/Makefile
@@ -0,0 +1,10 @@
+XEN_ROOT = ../../../..
+LINUX_DIR = linux-2.6.12-xenU
+KDIR = $(XEN_ROOT)/$(LINUX_DIR)
+PATCH_DIR = $(CURDIR)
+
+patches : patches-done
+
+patches-done :
+ ( for i in *.patch ; do ( cd $(KDIR) ; patch -p1 < $(PATCH_DIR)/$$i || exit 1 ) ; done )
+ touch $@
diff --git a/tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch b/tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch
new file mode 100644
index 0000000000..031d41b917
--- /dev/null
+++ b/tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch
@@ -0,0 +1,11 @@
+diff -u linux-2.6.12/arch/xen/i386/kernel/i386_ksyms.c linux-2.6.12-pdb/arch/xen/i386/kernel/i386_ksyms.c
+--- linux-2.6.12/arch/xen/i386/kernel/i386_ksyms.c 2005-07-31 22:36:50.000000000 +0100
++++ linux-2.6.12-pdb/arch/xen/i386/kernel/i386_ksyms.c 2005-08-01 10:57:31.000000000 +0100
+@@ -172,6 +172,7 @@
+ EXPORT_SYMBOL_GPL(unset_nmi_callback);
+
+ EXPORT_SYMBOL(register_die_notifier);
++EXPORT_SYMBOL(unregister_die_notifier);
+ #ifdef CONFIG_HAVE_DEC_LOCK
+ EXPORT_SYMBOL(_atomic_dec_and_lock);
+ #endif
diff --git a/tools/debugger/pdb/linux-2.6-patches/kdebug.patch b/tools/debugger/pdb/linux-2.6-patches/kdebug.patch
new file mode 100644
index 0000000000..8ceca41dc5
--- /dev/null
+++ b/tools/debugger/pdb/linux-2.6-patches/kdebug.patch
@@ -0,0 +1,11 @@
+diff -u linux-2.6.12/include/asm-i386/kdebug.h linux-2.6.12-pdb/include/asm-i386/kdebug.h
+--- linux-2.6.12/include/asm-i386/kdebug.h 2005-06-17 20:48:29.000000000 +0100
++++ linux-2.6.12-pdb/include/asm-i386/kdebug.h 2005-08-01 11:11:53.000000000 +0100
+@@ -21,6 +21,7 @@
+ If you really want to do it first unregister - then synchronize_kernel - then free.
+ */
+ int register_die_notifier(struct notifier_block *nb);
++int unregister_die_notifier(struct notifier_block *nb);
+ extern struct notifier_block *i386die_chain;
+
+
diff --git a/tools/debugger/pdb/linux-2.6-patches/makefile.patch b/tools/debugger/pdb/linux-2.6-patches/makefile.patch
new file mode 100644
index 0000000000..819f853d55
--- /dev/null
+++ b/tools/debugger/pdb/linux-2.6-patches/makefile.patch
@@ -0,0 +1,12 @@
+diff -Naur linux-2.6.12/Makefile linux-2.6.12-pdb/Makefile
+--- linux-2.6.12/Makefile 2005-08-01 01:21:21.000000000 +0100
++++ linux-2.6.12-pdb/Makefile 2005-08-01 10:28:10.000000000 +0100
+@@ -508,7 +508,7 @@
+ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+ CFLAGS += -Os
+ else
+-CFLAGS += -O2
++CFLAGS += -O
+ endif
+
+ #Add align options if CONFIG_CC_* is not equal to 0
diff --git a/tools/debugger/pdb/linux-2.6-patches/ptrace.patch b/tools/debugger/pdb/linux-2.6-patches/ptrace.patch
new file mode 100644
index 0000000000..98d76c495c
--- /dev/null
+++ b/tools/debugger/pdb/linux-2.6-patches/ptrace.patch
@@ -0,0 +1,11 @@
+diff -u linux-2.6.12/kernel/ptrace.c linux-2.6.12-pdb/kernel/ptrace.c
+--- linux-2.6.12/kernel/ptrace.c 2005-06-17 20:48:29.000000000 +0100
++++ linux-2.6.12-pdb/kernel/ptrace.c 2005-07-22 13:23:16.000000000 +0100
+@@ -239,6 +239,7 @@
+
+ return buf - old_buf;
+ }
++EXPORT_SYMBOL(access_process_vm);
+
+ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
+ {
diff --git a/tools/debugger/pdb/linux-2.6-patches/traps.patch b/tools/debugger/pdb/linux-2.6-patches/traps.patch
new file mode 100644
index 0000000000..54b2ddbcb3
--- /dev/null
+++ b/tools/debugger/pdb/linux-2.6-patches/traps.patch
@@ -0,0 +1,20 @@
+diff -u linux-2.6.12/arch/xen/i386/kernel/traps.c linux-2.6.12-pdb/arch/xen/i386/kernel/traps.c
+--- linux-2.6.12/arch/xen/i386/kernel/traps.c 2005-07-31 22:47:00.000000000 +0100
++++ linux-2.6.12-pdb/arch/xen/i386/kernel/traps.c 2005-07-31 22:47:32.000000000 +0100
+@@ -102,6 +102,16 @@
+ return err;
+ }
+
++int unregister_die_notifier(struct notifier_block *nb)
++{
++ int err = 0;
++ unsigned long flags;
++ spin_lock_irqsave(&die_notifier_lock, flags);
++ err = notifier_chain_unregister(&i386die_chain, nb);
++ spin_unlock_irqrestore(&die_notifier_lock, flags);
++ return err;
++}
++
+ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
+ {
+ return p > (void *)tinfo &&