ia64/xen-unstable

changeset 5943:90f2b122fc43

PDB: convert ptrace.c and traps.c changes to local patches
author ach61@arcadians.cl.cam.ac.uk
date Mon Aug 01 10:43:16 2005 +0000 (2005-08-01)
parents f7abc6205e22
children 0db6a59abb95
files tools/debugger/pdb/Makefile tools/debugger/pdb/linux-2.6-module/module.c tools/debugger/pdb/linux-2.6-patches/Makefile tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch tools/debugger/pdb/linux-2.6-patches/kdebug.patch tools/debugger/pdb/linux-2.6-patches/makefile.patch tools/debugger/pdb/linux-2.6-patches/ptrace.patch tools/debugger/pdb/linux-2.6-patches/traps.patch
line diff
     1.1 --- a/tools/debugger/pdb/Makefile	Sun Jul 31 21:45:52 2005 +0000
     1.2 +++ b/tools/debugger/pdb/Makefile	Mon Aug 01 10:43:16 2005 +0000
     1.3 @@ -33,7 +33,7 @@ LIBDIRS    += ../libxendebug
     1.4  LIBS       += unix str
     1.5  
     1.6  # bc = byte-code, dc = debug byte-code
     1.7 -all : dc
     1.8 +all : patches dc
     1.9  
    1.10  SOURCES    += pdb_caml_xc.c 
    1.11  SOURCES    += pdb_caml_domain.c pdb_caml_process.c
    1.12 @@ -50,3 +50,6 @@ RESULT      = pdb
    1.13  
    1.14  include $(OCAMLMAKEFILE)
    1.15  
    1.16 +PATCHDIR    = ./linux-2.6-patches
    1.17 +patches :
    1.18 +	make -C $(PATCHDIR) patches
     2.1 --- a/tools/debugger/pdb/linux-2.6-module/module.c	Sun Jul 31 21:45:52 2005 +0000
     2.2 +++ b/tools/debugger/pdb/linux-2.6-module/module.c	Mon Aug 01 10:43:16 2005 +0000
     2.3 @@ -278,14 +278,10 @@ pdb_initialize (void)
     2.4      return err;
     2.5  }
     2.6  
     2.7 -extern struct notifier_block *i386die_chain;
     2.8 -extern spinlock_t die_notifier_lock;
     2.9 -
    2.10  static void __exit
    2.11  pdb_terminate(void)
    2.12  {
    2.13      int err = 0;
    2.14 -    unsigned long flags;
    2.15  
    2.16      printk("pdb cleanup\n");
    2.17  
    2.18 @@ -305,9 +301,8 @@ pdb_terminate(void)
    2.19  
    2.20      pdb_send_connection_status(PDB_CONNECTION_STATUS_DOWN, 0);
    2.21  
    2.22 -	spin_lock_irqsave(&die_notifier_lock, flags);
    2.23 -    err = notifier_chain_unregister(&i386die_chain, &pdb_exceptions_nb);
    2.24 -	spin_unlock_irqrestore(&die_notifier_lock, flags);
    2.25 +    /* handler for int1 & int3 */
    2.26 +    err = unregister_die_notifier(&pdb_exceptions_nb);
    2.27  
    2.28  	return;
    2.29  }
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/debugger/pdb/linux-2.6-patches/Makefile	Mon Aug 01 10:43:16 2005 +0000
     3.3 @@ -0,0 +1,10 @@
     3.4 +XEN_ROOT   = ../../../..
     3.5 +LINUX_DIR  = linux-2.6.12-xenU
     3.6 +KDIR       = $(XEN_ROOT)/$(LINUX_DIR)
     3.7 +PATCH_DIR  = $(CURDIR)
     3.8 +
     3.9 +patches : patches-done
    3.10 +
    3.11 +patches-done :
    3.12 +	( for i in *.patch ; do ( cd $(KDIR) ; patch -p1 < $(PATCH_DIR)/$$i || exit 1 ) ; done )
    3.13 +	touch $@
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch	Mon Aug 01 10:43:16 2005 +0000
     4.3 @@ -0,0 +1,11 @@
     4.4 +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
     4.5 +--- linux-2.6.12/arch/xen/i386/kernel/i386_ksyms.c	2005-07-31 22:36:50.000000000 +0100
     4.6 ++++ linux-2.6.12-pdb/arch/xen/i386/kernel/i386_ksyms.c	2005-08-01 10:57:31.000000000 +0100
     4.7 +@@ -172,6 +172,7 @@
     4.8 + EXPORT_SYMBOL_GPL(unset_nmi_callback);
     4.9 + 
    4.10 + EXPORT_SYMBOL(register_die_notifier);
    4.11 ++EXPORT_SYMBOL(unregister_die_notifier);
    4.12 + #ifdef CONFIG_HAVE_DEC_LOCK
    4.13 + EXPORT_SYMBOL(_atomic_dec_and_lock);
    4.14 + #endif
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/debugger/pdb/linux-2.6-patches/kdebug.patch	Mon Aug 01 10:43:16 2005 +0000
     5.3 @@ -0,0 +1,11 @@
     5.4 +diff -u linux-2.6.12/include/asm-i386/kdebug.h linux-2.6.12-pdb/include/asm-i386/kdebug.h
     5.5 +--- linux-2.6.12/include/asm-i386/kdebug.h	2005-06-17 20:48:29.000000000 +0100
     5.6 ++++ linux-2.6.12-pdb/include/asm-i386/kdebug.h	2005-08-01 11:11:53.000000000 +0100
     5.7 +@@ -21,6 +21,7 @@
     5.8 +    If you really want to do it first unregister - then synchronize_kernel - then free.
     5.9 +   */
    5.10 + int register_die_notifier(struct notifier_block *nb);
    5.11 ++int unregister_die_notifier(struct notifier_block *nb);
    5.12 + extern struct notifier_block *i386die_chain;
    5.13 + 
    5.14 + 
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tools/debugger/pdb/linux-2.6-patches/makefile.patch	Mon Aug 01 10:43:16 2005 +0000
     6.3 @@ -0,0 +1,12 @@
     6.4 +diff -Naur linux-2.6.12/Makefile linux-2.6.12-pdb/Makefile
     6.5 +--- linux-2.6.12/Makefile	2005-08-01 01:21:21.000000000 +0100
     6.6 ++++ linux-2.6.12-pdb/Makefile	2005-08-01 10:28:10.000000000 +0100
     6.7 +@@ -508,7 +508,7 @@
     6.8 + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
     6.9 + CFLAGS		+= -Os
    6.10 + else
    6.11 +-CFLAGS		+= -O2
    6.12 ++CFLAGS		+= -O
    6.13 + endif
    6.14 + 
    6.15 + #Add align options if CONFIG_CC_* is not equal to 0
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/tools/debugger/pdb/linux-2.6-patches/ptrace.patch	Mon Aug 01 10:43:16 2005 +0000
     7.3 @@ -0,0 +1,11 @@
     7.4 +diff -u linux-2.6.12/kernel/ptrace.c linux-2.6.12-pdb/kernel/ptrace.c
     7.5 +--- linux-2.6.12/kernel/ptrace.c       2005-06-17 20:48:29.000000000 +0100
     7.6 ++++ linux-2.6.12-pdb/kernel/ptrace.c   2005-07-22 13:23:16.000000000 +0100
     7.7 +@@ -239,6 +239,7 @@
     7.8 + 
     7.9 +        return buf - old_buf;
    7.10 + }
    7.11 ++EXPORT_SYMBOL(access_process_vm);
    7.12 + 
    7.13 + int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
    7.14 + {
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/tools/debugger/pdb/linux-2.6-patches/traps.patch	Mon Aug 01 10:43:16 2005 +0000
     8.3 @@ -0,0 +1,20 @@
     8.4 +diff -u linux-2.6.12/arch/xen/i386/kernel/traps.c linux-2.6.12-pdb/arch/xen/i386/kernel/traps.c
     8.5 +--- linux-2.6.12/arch/xen/i386/kernel/traps.c	2005-07-31 22:47:00.000000000 +0100
     8.6 ++++ linux-2.6.12-pdb/arch/xen/i386/kernel/traps.c	2005-07-31 22:47:32.000000000 +0100
     8.7 +@@ -102,6 +102,16 @@
     8.8 + 	return err;
     8.9 + }
    8.10 + 
    8.11 ++int unregister_die_notifier(struct notifier_block *nb)
    8.12 ++{
    8.13 ++	int err = 0;
    8.14 ++	unsigned long flags;
    8.15 ++	spin_lock_irqsave(&die_notifier_lock, flags);
    8.16 ++	err = notifier_chain_unregister(&i386die_chain, nb);
    8.17 ++	spin_unlock_irqrestore(&die_notifier_lock, flags);
    8.18 ++	return err;
    8.19 ++}
    8.20 ++
    8.21 + static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
    8.22 + {
    8.23 + 	return	p > (void *)tinfo &&