Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Dec 1996 15:34:07 -0600 (CST)
From:      Lars Jonas Olsson <jonas@mcs.net>
To:        current@freebsd.org
Cc:        jonas@mcs.net
Subject:   remote gdb
Message-ID:  <199612112134.PAA04909@Mercury.mcs.net>

next in thread | raw e-mail | index | archive | help
I'm debugging dga related (mprotect) related panics in cuyrrent. I'm doing it
with remote gdb like:
Have options DDB in config file SMARTDEBUG
config -g SMARTDEBUG
make the kernel
cp kernel kernel.debug
strip -d kernel
install kernel on machine that panics.
install kernel.debug on remote machine
Boot machine to be debugged with -g

start gdb on other machine in directory with kernel.debug in it.

amcell1# gdb kernel.debug
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (i386-unknown-freebsd), 
Copyright 1994 Free Software Foundation, Inc...
(gdb) target remote /dev/cuaa1
Remote debugging using /dev/cuaa1
pmap_protect (pmap=0xf2357864, sva=135467008, eva=139661312, prot=1)
    at ../../i386/i386/pmap.c:1874
../../i386/i386/pmap.c:1874: No such file or directory.
(gdb) dir /amcell2/new/src/sys/compile/SMARTDEBUG
Source directories searched: /amcell2/new/src/sys/compile/SMARTDEBUG:$cdir:$cwd
(gdb) bt
#0  pmap_protect (pmap=0xf2357864, sva=135467008, eva=139661312, prot=1)
    at ../../i386/i386/pmap.c:1874
#1  0xf01a396e in vm_map_protect (map=0xf2357800, start=135467008, 
    end=139661312, new_prot=1 '\001', set_max=0) at ../../vm/vm_map.c:1201
#2  0xf01a566e in mprotect (p=0xf234a200, uap=0xefbfff94, retval=0xefbfff84)
    at ../../vm/vm_mmap.c:484
#3  0xf01bc72b in syscall (frame={tf_es = 39, tf_ds = 39, tf_edi = 24576, 
      tf_esi = 0, tf_ebp = -272640728, tf_isp = -272629788, tf_ebx = 0, 
      tf_edx = -272641536, tf_ecx = -272641536, tf_eax = 74, tf_trapno = 12, 
      tf_err = 7, tf_eip = 135115361, tf_cs = 31, tf_eflags = 642, 
      tf_esp = -272640756, tf_ss = 39}) at ../../i386/i386/trap.c:891
#4  0xf01b4155 in Xsyscall ()
#5  0x1e7a in ?? ()
#6  0x1095 in ?? ()
(gdb) list
1869				if (pbits & PG_RW) {
1870					if (pbits & PG_M) {
1871						vm_offset_t sva = i386_ptob(sindex);
1872						if (pmap_track_modified(sva)) {
1873							vm_page_t m = PHYS_TO_VM_PAGE(pbits);
1874							m->dirty = VM_PAGE_BITS_ALL;
1875						}
1876					}
1877					ptbase[sindex] = pbits & ~(PG_M|PG_RW);
1878					anychanged = 1;

 Now how do I shutdown the system nicely? (as nicely as possible?)

Jonas



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612112134.PAA04909>