--- Gnu-Mach/ddb/db_output.c 2020/09/02 04:36:57 1.1.1.1 +++ Gnu-Mach/ddb/db_output.c 2020/09/02 04:48:17 1.1.1.4 @@ -1,25 +1,25 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -28,18 +28,21 @@ * Date: 7/90 */ -#include "mach_kdb.h" #if MACH_KDB /* * Printf and character output for debugger. */ +#include +#include #include -#include #include +#include +#include #include #include +#include /* * Character output - tracks position in line. @@ -57,7 +60,7 @@ #ifndef DB_MAX_LINE #define DB_MAX_LINE 24 /* maximum line */ #define DB_MAX_WIDTH 80 /* maximum width */ -#endif DB_MAX_LINE +#endif /* DB_MAX_LINE */ #define DB_MIN_MAX_WIDTH 20 /* minimum max width */ #define DB_MIN_MAX_LINE 3 /* minimum max line */ @@ -72,15 +75,13 @@ int db_tab_stop_width = 8; /* how wide int db_max_line = DB_MAX_LINE; /* output max lines */ int db_max_width = DB_MAX_WIDTH; /* output line width */ -extern void db_check_interrupt(); - /* * Force pending whitespace. */ void -db_force_whitespace() +db_force_whitespace(void) { - register int last_print, next_tab; + int last_print, next_tab; last_print = db_last_non_space; while (last_print < db_output_position) { @@ -98,9 +99,9 @@ db_force_whitespace() } static void -db_more() +db_more(void) { - register char *p; + char *p; boolean_t quit_output = FALSE; for (p = "--db_more--"; *p; p++) @@ -131,8 +132,7 @@ db_more() * Output character. Buffer whitespace. */ void -db_putchar(c) - int c; /* character to output */ +db_putchar(int c) /* character to output */ { if (db_max_line >= DB_MIN_MAX_LINE && db_output_line >= db_max_line-1) db_more(); @@ -187,8 +187,8 @@ db_id_putc(char c, vm_offset_t dummy) /* * Return output position */ -int -db_print_position() +int __attribute__ ((pure)) +db_print_position(void) { return (db_output_position); } @@ -196,45 +196,21 @@ db_print_position() /* * End line if too long. */ -void db_end_line() +void db_end_line(void) { if (db_output_position >= db_max_width-1) db_printf("\n"); } -/* - * Printing - */ -extern void _doprnt(); - /*VARARGS1*/ void -db_printf( fmt, va_alist) - char * fmt; - va_dcl +db_printf(const char *fmt, ...) { va_list listp; -#ifdef db_printf_enter - db_printf_enter(); /* optional multiP serialization */ -#endif - va_start(listp); - _doprnt(fmt, &listp, db_id_putc, db_radix, 0); - va_end(listp); -} - -/* alternate name */ - -/*VARARGS1*/ -void -kdbprintf(fmt, va_alist) - char * fmt; - va_dcl -{ - va_list listp; - va_start(listp); - _doprnt(fmt, &listp, db_id_putc, db_radix, 0); + va_start(listp, fmt); + _doprnt(fmt, listp, db_id_putc, db_radix, 0); va_end(listp); } -#endif MACH_KDB +#endif /* MACH_KDB */