db_print.c revision 36747
133965Sjdp/* 278828Sobrien * Mach Operating System 3218822Sdim * Copyright (c) 1991,1990 Carnegie Mellon University 433965Sjdp * All Rights Reserved. 533965Sjdp * 633965Sjdp * Permission to use, copy, modify and distribute this software and its 733965Sjdp * documentation is hereby granted, provided that both the copyright 891041Sobrien * notice and this permission notice appear in all copies of the 933965Sjdp * software, derivative works or modified versions, and any portions 1091041Sobrien * thereof, and that both notices appear in supporting documentation. 1191041Sobrien * 1291041Sobrien * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS 1391041Sobrien * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 1433965Sjdp * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 1591041Sobrien * 1691041Sobrien * Carnegie Mellon requests users of this software to return to 1791041Sobrien * 1891041Sobrien * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 1933965Sjdp * School of Computer Science 2091041Sobrien * Carnegie Mellon University 2191041Sobrien * Pittsburgh PA 15213-3890 22218822Sdim * 2333965Sjdp * any improvements or extensions that they make and grant Carnegie the 2433965Sjdp * rights to redistribute these changes. 2533965Sjdp * 2633965Sjdp * $Id: db_print.c,v 1.18 1998/06/07 17:09:37 dfr Exp $ 2733965Sjdp */ 2833965Sjdp 2933965Sjdp/* 30218822Sdim * Author: David B. Golub, Carnegie Mellon University 3133965Sjdp * Date: 7/90 3233965Sjdp */ 3333965Sjdp 3433965Sjdp/* 3589857Sobrien * Miscellaneous printing. 3633965Sjdp */ 3789857Sobrien#include <sys/param.h> 3889857Sobrien 3989857Sobrien#include <ddb/ddb.h> 4089857Sobrien#include <ddb/db_variables.h> 4189857Sobrien#include <ddb/db_sym.h> 4260484Sobrien 43218822Sdimvoid 44218822Sdimdb_show_regs(dummy1, dummy2, dummy3, dummy4) 45218822Sdim db_expr_t dummy1; 46218822Sdim boolean_t dummy2; 47218822Sdim db_expr_t dummy3; 48218822Sdim char * dummy4; 49218822Sdim{ 50218822Sdim register struct db_variable *regp; 51218822Sdim db_expr_t value, offset; 5233965Sjdp char * name; 53218822Sdim 54218822Sdim for (regp = db_regs; regp < db_eregs; regp++) { 55218822Sdim db_read_variable(regp, &value); 5633965Sjdp db_printf("%-12s%#10n", regp->name, value); 57218822Sdim db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset); 5833965Sjdp if (name != 0 && offset <= db_maxoff && offset != value) { 59130561Sobrien db_printf("\t%s", name); 60218822Sdim if (offset != 0) 6133965Sjdp db_printf("+%+#n", offset); 6233965Sjdp } 6333965Sjdp db_printf("\n"); 6433965Sjdp } 65218822Sdim db_print_loc_and_inst(PC_REGS(DDB_REGS)); 66130561Sobrien} 67130561Sobrien 6833965Sjdp