diff options
author | bde <bde@FreeBSD.org> | 1998-02-13 02:45:26 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-02-13 02:45:26 +0000 |
commit | 7fdb812e6b3d9404ee46bbc059c4580fa103e0cd (patch) | |
tree | cc522515d5b2bd1f933f379c839f3f9c443cac1f /gnu/usr.bin/gdb | |
parent | e159c8ff9735b3dbd503e2695d5b6f040140ce03 (diff) | |
download | FreeBSD-src-7fdb812e6b3d9404ee46bbc059c4580fa103e0cd.zip FreeBSD-src-7fdb812e6b3d9404ee46bbc059c4580fa103e0cd.tar.gz |
Fixed printing of %fs and %gs for live kernels.
Only print the current pcb on startup. Printing it every time a utility
routine was called messed up the register dump for live kernels.
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r-- | gnu/usr.bin/gdb/gdb/kvm-fbsd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c index 3c869f2..1f75dbe 100644 --- a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c +++ b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c @@ -482,6 +482,7 @@ kvm_open (efile, cfile, sfile, perm, errout) { struct stat stb; int cfd; + CORE_ADDR paddr; if ((cfd = open (cfile, perm, 0)) < 0) return (cfd); @@ -501,9 +502,11 @@ kvm_open (efile, cfile, sfile, perm, errout) found_pcb = 1; /* for vtophys */ if (!devmem) - read_pcb (cfd, ksym_lookup ("dumppcb") - KERNOFF); + paddr = ksym_lookup ("dumppcb") - KERNOFF; else - read_pcb (cfd, kvtophys (cfd, curpcb)); + paddr = kvtophys (cfd, curpcb); + read_pcb (cfd, paddr); + printf ("initial pcb at %x\n", paddr); return (cfd); } @@ -812,7 +815,6 @@ read_pcb (fd, uaddr) error ("cannot read pcb at %x\n", uaddr); return (-1); } - printf ("current pcb at %x\n", uaddr); /* * get the register values out of the sys pcb and @@ -833,10 +835,10 @@ read_pcb (fd, uaddr) supply_register (6, (char *)&pcb.pcb_esi); supply_register (7, (char *)&pcb.pcb_edi); supply_register (PC_REGNUM, (char *)&pcb.pcb_eip); - for (i = 9; i < 14; ++i) /* eflags, cs, ss, ds, es */ + for (i = 9; i < 13; ++i) /* eflags, cs, ss, ds, es */ supply_register (i, (char *)&noreg); - supply_register (15, (char *)&pcb.pcb_fs); - supply_register (16, (char *)&pcb.pcb_gs); + supply_register (14, (char *)&pcb.pcb_fs); + supply_register (15, (char *)&pcb.pcb_gs); /* XXX 80387 registers? */ } |