summaryrefslogtreecommitdiff
path: root/sys/ddb/db_output.h
blob: 86ca761acaa42b88d76bd8becf138d306512df92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*	$OpenBSD: db_output.h,v 1.16 2013/12/12 21:00:09 guenther Exp $ */
/*	$NetBSD: db_output.h,v 1.9 1996/04/04 05:13:50 cgd Exp $	*/

/* 
 * Mach Operating System
 * Copyright (c) 1993,1992,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.
 *
 * 	Author: David B. Golub, Carnegie Mellon University
 *	Date:	8/90
 */

/*
 * Printing routines for kernel debugger.
 */
void db_force_whitespace(void);
void db_putchar(int);
int db_print_position(void);
int db_printf(const char *, ...)
    __attribute__((__format__(__kprintf__,1,2)));
int db_vprintf(const char *, va_list)
    __attribute__((__format__(__kprintf__,1,0)));
void db_end_line(int);

/*
 * This is a replacement for the non-standard %z, %n and %r printf formats
 * in db_printf.
 *
 * db_format(buf, bufsize, val, format, alt, width)
 *
 * val is the value we want printed.
 * format is one of DB_FORMAT_[ZRN]
 * alt specifies if we should provide an "alternate" format (# in the printf
 *   format).
 * width is the field width. 0 is the same as no width specifier.
 */
#define DB_FORMAT_Z	1
#define DB_FORMAT_R	2
#define DB_FORMAT_N	3
#define DB_FORMAT_BUF_SIZE	64	/* should be plenty for all formats */
char *db_format(char *, size_t, long, int, int, int);

/* XXX - this is the wrong place, but we have no better. */
void db_stack_dump(void);