kthr.c (163440) | kthr.c (166214) |
---|---|
1/* 2 * Copyright (c) 2004 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2004 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/kthr.c 163440 2006-10-16 20:07:23Z jhb $"); | 28__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/kthr.c 166214 2007-01-25 06:39:25Z rodrigc $"); |
29 30#include <sys/param.h> 31#include <sys/proc.h> 32#include <sys/types.h> 33#include <sys/signal.h> 34#include <err.h> 35#include <inttypes.h> 36#include <kvm.h> --- 62 unchanged lines hidden (view full) --- 99 if (addr != 0) 100 kvm_read(kvm, addr, &stopped_cpus, sizeof(stopped_cpus)); 101 else 102 stopped_cpus = 0; 103 104 stoppcbs = lookup("_stoppcbs"); 105 106 while (paddr != 0) { | 29 30#include <sys/param.h> 31#include <sys/proc.h> 32#include <sys/types.h> 33#include <sys/signal.h> 34#include <err.h> 35#include <inttypes.h> 36#include <kvm.h> --- 62 unchanged lines hidden (view full) --- 99 if (addr != 0) 100 kvm_read(kvm, addr, &stopped_cpus, sizeof(stopped_cpus)); 101 else 102 stopped_cpus = 0; 103 104 stoppcbs = lookup("_stoppcbs"); 105 106 while (paddr != 0) { |
107 if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) | 107 if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) { |
108 warnx("kvm_read: %s", kvm_geterr(kvm)); | 108 warnx("kvm_read: %s", kvm_geterr(kvm)); |
109 break; 110 } |
|
109 addr = (uintptr_t)TAILQ_FIRST(&p.p_threads); 110 while (addr != 0) { | 111 addr = (uintptr_t)TAILQ_FIRST(&p.p_threads); 112 while (addr != 0) { |
111 if (kvm_read(kvm, addr, &td, sizeof(td)) != sizeof(td)) | 113 if (kvm_read(kvm, addr, &td, sizeof(td)) != 114 sizeof(td)) { |
112 warnx("kvm_read: %s", kvm_geterr(kvm)); | 115 warnx("kvm_read: %s", kvm_geterr(kvm)); |
116 break; 117 } |
|
113 kt = malloc(sizeof(*kt)); 114 kt->next = first; 115 kt->kaddr = addr; 116 if (td.td_tid == dumptid) 117 kt->pcb = dumppcb; 118 else if (td.td_state == TDS_RUNNING && ((1 << td.td_oncpu) & stopped_cpus) 119 && stoppcbs != 0) 120 kt->pcb = (uintptr_t) stoppcbs + sizeof(struct pcb) * td.td_oncpu; --- 94 unchanged lines hidden --- | 118 kt = malloc(sizeof(*kt)); 119 kt->next = first; 120 kt->kaddr = addr; 121 if (td.td_tid == dumptid) 122 kt->pcb = dumppcb; 123 else if (td.td_state == TDS_RUNNING && ((1 << td.td_oncpu) & stopped_cpus) 124 && stoppcbs != 0) 125 kt->pcb = (uintptr_t) stoppcbs + sizeof(struct pcb) * td.td_oncpu; --- 94 unchanged lines hidden --- |