direct-io.hg

changeset 1801:a825d179881d

bitkeeper revision 1.1095 (40f67df01t5vX4nRXlk29L0xLlSunA)

use .gdbinit for setup
author ach61@labyrinth.cl.cam.ac.uk
date Thu Jul 15 12:52:00 2004 +0000 (2004-07-15)
parents 20b04731d29f
children 49364b76a968
files docs/HOWTOs/XenDebugger-HOWTO xen/arch/x86/pdb-stub.c xen/common/debug-linux.c
line diff
     1.1 --- a/docs/HOWTOs/XenDebugger-HOWTO	Thu Jul 15 09:28:40 2004 +0000
     1.2 +++ b/docs/HOWTOs/XenDebugger-HOWTO	Thu Jul 15 12:52:00 2004 +0000
     1.3 @@ -264,10 +264,41 @@ 5. Now we can read the same variable fro
     1.4     $4 = 27
     1.5  
     1.6  
     1.7 +Some Helpful .gdbinit Commands
     1.8 +------------------------------
     1.9 +
    1.10 +define setup
    1.11 +  file    .../install/boot/xen-syms
    1.12 +  add-sym .../install/boot/vmlinux-syms-2.4.26-xen0
    1.13 +  add-sym /homes/aho/a.out
    1.14 +end
    1.15 +document setup
    1.16 +  load symbols for xen, xenolinux (dom 0), and "a.out"
    1.17 +end
    1.18 +
    1.19 +define setup-linux
    1.20 +  set pdb_pidhash_addr = &pidhash
    1.21 +  set pdb_init_task_union_addr = &init_task_union
    1.22 +
    1.23 +  set task_struct_mm_offset           = (void *)&(init_task_union.task.mm) - (void *)&(init_task_union.task)
    1.24 +  set task_struct_next_task_offset    = (void *)&(init_task_union.task.next_task) - (void *)&(init_task_union.task)
    1.25 +  set task_struct_pid_offset          = (void *)&(init_task_union.task.pid) - (void *)&(init_task_union.task)
    1.26 +  set task_struct_pidhash_next_offset = (void *)&(init_task_union.task.pidhash_next) - (void *)&(init_task_union.task)
    1.27 +  set task_struct_comm_offset         = (void *)&(init_task_union.task.comm) - (void *)&(init_task_union.task)
    1.28 +  set task_struct_comm_length         = sizeof (init_task_union.task.comm)
    1.29 +
    1.30 +  set mm_struct_pgd_offset            = sizeof (struct vm_area_struct *) * 2 + sizeof (rb_root_t)
    1.31 +end
    1.32 +document setup-linux
    1.33 +  define various xenolinux specific offsets and sizes in pdb
    1.34 +end
    1.35 +
    1.36 +
    1.37  
    1.38  
    1.39  Changes
    1.40  -------
    1.41  
    1.42 +04.07.15 aho .gdbinit
    1.43  04.02.05 aho creation
    1.44  04.03.31 aho add description on debugging multiple domains
     2.1 --- a/xen/arch/x86/pdb-stub.c	Thu Jul 15 09:28:40 2004 +0000
     2.2 +++ b/xen/arch/x86/pdb-stub.c	Thu Jul 15 12:52:00 2004 +0000
     2.3 @@ -22,7 +22,7 @@
     2.4  #include <xen/serial.h>
     2.5  #include <xen/softirq.h>
     2.6  
     2.7 -#undef PDB_DEBUG_TRACE
     2.8 +#define PDB_DEBUG_TRACE
     2.9  #ifdef PDB_DEBUG_TRACE
    2.10  #define TRC(_x) _x
    2.11  #else
    2.12 @@ -971,9 +971,9 @@ int pdb_change_values(u_char *buffer, in
    2.13  int pdb_change_values_one_page(u_char *buffer, int length,
    2.14  			       unsigned long cr3, unsigned long addr, int rw)
    2.15  {
    2.16 -    l2_pgentry_t* l2_table = NULL;
    2.17 -    l1_pgentry_t* l1_table = NULL;
    2.18 -    u_char *page;
    2.19 +    l2_pgentry_t* l2_table = NULL;                         /* page directory */
    2.20 +    l1_pgentry_t* l1_table = NULL;                             /* page table */
    2.21 +    u_char *page;                                                 /* 4k page */
    2.22      int bytes = 0;
    2.23  
    2.24      l2_table = map_domain_mem(cr3); 
     3.1 --- a/xen/common/debug-linux.c	Thu Jul 15 09:28:40 2004 +0000
     3.2 +++ b/xen/common/debug-linux.c	Thu Jul 15 12:52:00 2004 +0000
     3.3 @@ -55,14 +55,15 @@ static inline unsigned long machine_to_p
     3.4  unsigned long pdb_pidhash_addr         = 0xc01971e0UL;
     3.5  unsigned long pdb_init_task_union_addr = 0xc0182000UL;
     3.6  
     3.7 -#define task_struct_mm_offset        0x2c
     3.8 -#define task_struct_next_task_offset 0x48
     3.9 -#define task_struct_pid_offset       0x7c
    3.10 -#define task_struct_pidhash_next_offset 0xb0
    3.11 -#define task_struct_comm_offset      0x23e
    3.12 -#define task_struct_comm_length      0x10
    3.13  
    3.14 -#define mm_struct_pgd_offset         0x0c
    3.15 +unsigned int task_struct_mm_offset           = 0x2c;
    3.16 +unsigned int task_struct_next_task_offset    = 0x48;
    3.17 +unsigned int task_struct_pid_offset          = 0x7c;
    3.18 +unsigned int task_struct_pidhash_next_offset = 0xb0;
    3.19 +unsigned int task_struct_comm_offset         = 0x23e;
    3.20 +unsigned int task_struct_comm_length         = 0x10;
    3.21 +
    3.22 +unsigned int mm_struct_pgd_offset            = 0x0c;
    3.23  
    3.24  /*
    3.25   * find the task structure of a process (pid)