ddb: when a new wsdisplay console attaches, resize ddb cols/rows to it

ok visa
This commit is contained in:
jcs 2021-02-09 14:37:13 +00:00
parent 7de43a13b6
commit e63dfe6607
3 changed files with 19 additions and 3 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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
}
/*