| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: db_output.c,v 1.35 2019/09/12 18:43:02 uwe Exp $ */ | | 1 | /* $NetBSD: db_output.c,v 1.36 2020/01/26 01:42:55 uwe Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Mach Operating System | | 4 | * Mach Operating System |
5 | * Copyright (c) 1991,1990 Carnegie Mellon University | | 5 | * Copyright (c) 1991,1990 Carnegie Mellon University |
6 | * All Rights Reserved. | | 6 | * All Rights Reserved. |
7 | * | | 7 | * |
8 | * Permission to use, copy, modify and distribute this software and its | | 8 | * Permission to use, copy, modify and distribute this software and its |
9 | * documentation is hereby granted, provided that both the copyright | | 9 | * documentation is hereby granted, provided that both the copyright |
10 | * notice and this permission notice appear in all copies of the | | 10 | * notice and this permission notice appear in all copies of the |
11 | * software, derivative works or modified versions, and any portions | | 11 | * software, derivative works or modified versions, and any portions |
12 | * thereof, and that both notices appear in supporting documentation. | | 12 | * thereof, and that both notices appear in supporting documentation. |
13 | * | | 13 | * |
14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | | 14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" |
| @@ -25,27 +25,27 @@ | | | @@ -25,27 +25,27 @@ |
25 | * any improvements or extensions that they make and grant Carnegie the | | 25 | * any improvements or extensions that they make and grant Carnegie the |
26 | * rights to redistribute these changes. | | 26 | * rights to redistribute these changes. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | /* | | 29 | /* |
30 | * Printf and character output for debugger. | | 30 | * Printf and character output for debugger. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #ifdef _KERNEL_OPT | | 33 | #ifdef _KERNEL_OPT |
34 | #include "opt_ddbparam.h" | | 34 | #include "opt_ddbparam.h" |
35 | #endif | | 35 | #endif |
36 | | | 36 | |
37 | #include <sys/cdefs.h> | | 37 | #include <sys/cdefs.h> |
38 | __KERNEL_RCSID(0, "$NetBSD: db_output.c,v 1.35 2019/09/12 18:43:02 uwe Exp $"); | | 38 | __KERNEL_RCSID(0, "$NetBSD: db_output.c,v 1.36 2020/01/26 01:42:55 uwe Exp $"); |
39 | | | 39 | |
40 | #include <sys/param.h> | | 40 | #include <sys/param.h> |
41 | #include <sys/systm.h> | | 41 | #include <sys/systm.h> |
42 | #include <sys/stdarg.h> | | 42 | #include <sys/stdarg.h> |
43 | | | 43 | |
44 | #include <dev/cons.h> | | 44 | #include <dev/cons.h> |
45 | | | 45 | |
46 | #include <ddb/ddb.h> | | 46 | #include <ddb/ddb.h> |
47 | | | 47 | |
48 | /* | | 48 | /* |
49 | * Character output - tracks position in line. | | 49 | * Character output - tracks position in line. |
50 | * To do this correctly, we should know how wide | | 50 | * To do this correctly, we should know how wide |
51 | * the output device is - then we could zero | | 51 | * the output device is - then we could zero |
| @@ -95,27 +95,27 @@ db_force_whitespace(void) | | | @@ -95,27 +95,27 @@ db_force_whitespace(void) |
95 | cnputc(' '); | | 95 | cnputc(' '); |
96 | last_print++; | | 96 | last_print++; |
97 | } | | 97 | } |
98 | } else { | | 98 | } else { |
99 | cnputc(' '); | | 99 | cnputc(' '); |
100 | last_print++; | | 100 | last_print++; |
101 | } | | 101 | } |
102 | } | | 102 | } |
103 | db_last_non_space = db_output_position; | | 103 | db_last_non_space = db_output_position; |
104 | } | | 104 | } |
105 | | | 105 | |
106 | | | 106 | |
107 | /* | | 107 | /* |
108 | * End the current line if we it exceeds $maxwidth | | 108 | * End the current line if it exceeds $maxwidth |
109 | */ | | 109 | */ |
110 | static void | | 110 | static void |
111 | db_check_wrap(void) | | 111 | db_check_wrap(void) |
112 | { | | 112 | { |
113 | | | 113 | |
114 | if (db_max_width >= DB_MIN_MAX_WIDTH | | 114 | if (db_max_width >= DB_MIN_MAX_WIDTH |
115 | && db_output_position >= db_max_width) { | | 115 | && db_output_position >= db_max_width) { |
116 | cnputc('\n'); | | 116 | cnputc('\n'); |
117 | db_output_position = 0; | | 117 | db_output_position = 0; |
118 | db_last_non_space = 0; | | 118 | db_last_non_space = 0; |
119 | db_output_line++; | | 119 | db_output_line++; |
120 | } | | 120 | } |
121 | } | | 121 | } |