diff options
author | Joshua Stein <jcs@cvs.openbsd.org> | 2021-02-09 14:37:14 +0000 |
---|---|---|
committer | Joshua Stein <jcs@cvs.openbsd.org> | 2021-02-09 14:37:14 +0000 |
commit | c58f97708399479f2462629e72f62d8fae853a72 (patch) | |
tree | c8441c275d9e54a1de24f2e341df993f94a414d4 /sys | |
parent | f327ead42968d26efa9c8ff11068d76c07e1a8a4 (diff) |
ddb: when a new wsdisplay console attaches, resize ddb cols/rows to it
ok visa
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ddb/db_output.c | 9 | ||||
-rw-r--r-- | sys/ddb/db_output.h | 3 | ||||
-rw-r--r-- | sys/dev/wscons/wsdisplay.c | 10 |
3 files changed, 19 insertions, 3 deletions
diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index 77fd0e34944..3aa2c6a8657 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_output.c,v 1.35 2020/10/15 03:14:00 deraadt Exp $ */ +/* $OpenBSD: db_output.c,v 1.36 2021/02/09 14:37:13 jcs Exp $ */ /* $NetBSD: db_output.c,v 1.13 1996/04/01 17:27:14 christos Exp $ */ /* @@ -252,3 +252,10 @@ stacktrace_print(struct stacktrace *st, int (*pr)(const char *, ...)) if (st->st_count == 0) (*pr)("<empty stack trace>\n"); } + +void +db_resize(int cols, int rows) +{ + db_max_width = cols; + db_max_line = rows; +} diff --git a/sys/ddb/db_output.h b/sys/ddb/db_output.h index 86ca761acaa..2abbfbba616 100644 --- a/sys/ddb/db_output.h +++ b/sys/ddb/db_output.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_output.h,v 1.16 2013/12/12 21:00:09 guenther Exp $ */ +/* $OpenBSD: db_output.h,v 1.17 2021/02/09 14:37:13 jcs Exp $ */ /* $NetBSD: db_output.h,v 1.9 1996/04/04 05:13:50 cgd Exp $ */ /* @@ -41,6 +41,7 @@ int db_printf(const char *, ...) int db_vprintf(const char *, va_list) __attribute__((__format__(__kprintf__,1,0))); void db_end_line(int); +void db_resize(int, int); /* * This is a replacement for the non-standard %z, %n and %r printf formats diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index 82daa85dda3..b1fa71b5b15 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.142 2020/08/05 13:50:25 fcambus Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.143 2021/02/09 14:37:13 jcs Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -65,6 +65,10 @@ #include <dev/wscons/wsmuxvar.h> #endif +#ifdef DDB +#include <ddb/db_output.h> +#endif + #include "wsmoused.h" struct wsscreen_internal { @@ -836,6 +840,10 @@ wsdisplay_cnattach(const struct wsscreen_descr *type, void *cookie, int ccol, cn_tab = &wsdisplay_cons; wsdisplay_console_initted = 1; + +#ifdef DDB + db_resize(type->ncols, type->nrows); +#endif } /* |