db_interface.c (75723) | db_interface.c (76078) |
---|---|
1/* 2 * Mach Operating System 3 * Copyright (c) 1991,1990 Carnegie Mellon University 4 * All Rights Reserved. 5 * 6 * Permission to use, copy, modify and distribute this software and its 7 * documentation is hereby granted, provided that both the copyright 8 * notice and this permission notice appear in all copies of the --- 9 unchanged lines hidden (view full) --- 18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 19 * School of Computer Science 20 * Carnegie Mellon University 21 * Pittsburgh PA 15213-3890 22 * 23 * any improvements or extensions that they make and grant Carnegie the 24 * rights to redistribute these changes. 25 * | 1/* 2 * Mach Operating System 3 * Copyright (c) 1991,1990 Carnegie Mellon University 4 * All Rights Reserved. 5 * 6 * Permission to use, copy, modify and distribute this software and its 7 * documentation is hereby granted, provided that both the copyright 8 * notice and this permission notice appear in all copies of the --- 9 unchanged lines hidden (view full) --- 18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 19 * School of Computer Science 20 * Carnegie Mellon University 21 * Pittsburgh PA 15213-3890 22 * 23 * any improvements or extensions that they make and grant Carnegie the 24 * rights to redistribute these changes. 25 * |
26 * $FreeBSD: head/sys/amd64/amd64/db_interface.c 75723 2001-04-20 01:08:27Z jhb $ | 26 * $FreeBSD: head/sys/amd64/amd64/db_interface.c 76078 2001-04-27 19:28:25Z jhb $ |
27 */ 28 29/* 30 * Interface to new debugger. 31 */ 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/reboot.h> 35#include <sys/cons.h> 36#include <sys/ktr.h> 37#include <sys/linker_set.h> 38#include <sys/lock.h> 39#include <sys/proc.h> | 27 */ 28 29/* 30 * Interface to new debugger. 31 */ 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/reboot.h> 35#include <sys/cons.h> 36#include <sys/ktr.h> 37#include <sys/linker_set.h> 38#include <sys/lock.h> 39#include <sys/proc.h> |
40#include <sys/smp.h> |
|
40 41#include <machine/cpu.h> 42#ifdef SMP | 41 42#include <machine/cpu.h> 43#ifdef SMP |
43#include <machine/smp.h> | |
44#include <machine/smptests.h> /** CPUSTOP_ON_DDBBREAK */ 45#endif 46 47#include <vm/vm.h> 48#include <vm/pmap.h> 49 50#include <ddb/ddb.h> 51#include <ddb/db_access.h> --- 277 unchanged lines hidden (view full) --- 329 critical_exit(savecrit); 330 atomic_store_rel_int(&in_Debugger, 0); 331 } 332} 333 334DB_SHOW_COMMAND(pcpu, db_show_pcpu) 335{ 336 struct globaldata *gd; | 44#include <machine/smptests.h> /** CPUSTOP_ON_DDBBREAK */ 45#endif 46 47#include <vm/vm.h> 48#include <vm/pmap.h> 49 50#include <ddb/ddb.h> 51#include <ddb/db_access.h> --- 277 unchanged lines hidden (view full) --- 329 critical_exit(savecrit); 330 atomic_store_rel_int(&in_Debugger, 0); 331 } 332} 333 334DB_SHOW_COMMAND(pcpu, db_show_pcpu) 335{ 336 struct globaldata *gd; |
337#ifdef SMP |
|
337 int id; 338 339 if (have_addr) 340 id = ((addr >> 4) % 16) * 10 + (addr % 16); 341 else 342 id = PCPU_GET(cpuid); | 338 int id; 339 340 if (have_addr) 341 id = ((addr >> 4) % 16) * 10 + (addr % 16); 342 else 343 id = PCPU_GET(cpuid); |
343 SLIST_FOREACH(gd, &cpuhead, gd_allcpu) { 344 if (gd->gd_cpuid == id) 345 break; 346 } 347 if (gd == NULL) | 344 gd = globaldata_find(id); 345 if (gd == NULL) { |
348 db_printf("CPU %d not found\n", id); | 346 db_printf("CPU %d not found\n", id); |
349 else { 350 db_printf("cpuid = %d\n", gd->gd_cpuid); 351 db_printf("curproc = "); 352 if (gd->gd_curproc != NULL) 353 db_printf("%p: pid %d \"%s\"\n", gd->gd_curproc, 354 gd->gd_curproc->p_pid, gd->gd_curproc->p_comm); 355 else 356 db_printf("none\n"); 357 db_printf("curpcb = %p\n", gd->gd_curpcb); 358 db_printf("npxproc = "); 359 if (gd->gd_npxproc != NULL) 360 db_printf("%p: pid %d \"%s\"\n", gd->gd_npxproc, 361 gd->gd_npxproc->p_pid, gd->gd_npxproc->p_comm); 362 else 363 db_printf("none\n"); 364 db_printf("idleproc = "); 365 if (gd->gd_idleproc != NULL) 366 db_printf("%p: pid %d \"%s\"\n", gd->gd_idleproc, 367 gd->gd_idleproc->p_pid, gd->gd_idleproc->p_comm); 368 else 369 db_printf("none\n"); | 347 return; 348 } 349#else 350 gd = GLOBALDATA; 351#endif 352 db_printf("cpuid = %d\n", gd->gd_cpuid); 353 db_printf("curproc = "); 354 if (gd->gd_curproc != NULL) 355 db_printf("%p: pid %d \"%s\"\n", gd->gd_curproc, 356 gd->gd_curproc->p_pid, gd->gd_curproc->p_comm); 357 else 358 db_printf("none\n"); 359 db_printf("curpcb = %p\n", gd->gd_curpcb); 360 db_printf("npxproc = "); 361 if (gd->gd_npxproc != NULL) 362 db_printf("%p: pid %d \"%s\"\n", gd->gd_npxproc, 363 gd->gd_npxproc->p_pid, gd->gd_npxproc->p_comm); 364 else 365 db_printf("none\n"); 366 db_printf("idleproc = "); 367 if (gd->gd_idleproc != NULL) 368 db_printf("%p: pid %d \"%s\"\n", gd->gd_idleproc, 369 gd->gd_idleproc->p_pid, gd->gd_idleproc->p_comm); 370 else 371 db_printf("none\n"); |
370 371#ifdef WITNESS | 372 373#ifdef WITNESS |
372 db_printf("spin locks held:\n"); 373 witness_list_locks(&gd->gd_spinlocks); | 374 db_printf("spin locks held:\n"); 375 witness_list_locks(&gd->gd_spinlocks); |
374#endif | 376#endif |
375 } | |
376} | 377} |