summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-11-06 07:30:09 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-11-06 07:30:09 +0000
commit2d9e6e918a7ecc4d5babbf6299591bd84ac8ed88 (patch)
tree9494be2f25fc9bc754cc40abdbf9f608294ab13b
parentb07687956ccb9ecbb065cb28f8ea9f12aa80423c (diff)
Substitute boolean_t/TRUE/FALSE by int/1/0.
ok dlg@, jasper@, anton@
-rw-r--r--sys/ddb/db_command.c75
-rw-r--r--sys/ddb/db_examine.c31
-rw-r--r--sys/ddb/db_expr.c58
-rw-r--r--sys/ddb/db_extern.h4
-rw-r--r--sys/ddb/db_input.c10
-rw-r--r--sys/ddb/db_interface.h4
-rw-r--r--sys/ddb/db_output.c4
-rw-r--r--sys/ddb/db_run.c52
-rw-r--r--sys/ddb/db_run.h6
-rw-r--r--sys/ddb/db_trap.c6
10 files changed, 122 insertions, 128 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 2fb7b2e6b7b..98602541be3 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.c,v 1.86 2019/04/01 09:28:24 tedu Exp $ */
+/* $OpenBSD: db_command.c,v 1.87 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
@@ -69,7 +69,7 @@ label_t *db_recover;
* and '+' points to next line.
* Otherwise: 'dot' points to next item, '..' points to last.
*/
-boolean_t db_ed_style = TRUE;
+int db_ed_style = 1;
db_addr_t db_dot; /* current location */
db_addr_t db_last_addr; /* last explicit address typed */
@@ -112,8 +112,8 @@ void db_show_panic_cmd(db_expr_t, int, db_expr_t, char *);
void db_bcstats_print_cmd(db_expr_t, int, db_expr_t, char *);
void db_struct_offset_cmd(db_expr_t, int, db_expr_t, char *);
void db_ctf_show_struct(db_expr_t, int, db_expr_t, char *);
-void db_show_regs(db_expr_t, boolean_t, db_expr_t, char *);
-void db_write_cmd(db_expr_t, boolean_t, db_expr_t, char *);
+void db_show_regs(db_expr_t, int, db_expr_t, char *);
+void db_write_cmd(db_expr_t, int, db_expr_t, char *);
void db_witness_display(db_expr_t, int, db_expr_t, char *);
void db_witness_list(db_expr_t, int, db_expr_t, char *);
void db_witness_list_all(db_expr_t, int, db_expr_t, char *);
@@ -196,18 +196,16 @@ void
db_command(struct db_command **last_cmdp, struct db_command *cmd_table)
{
struct db_command *cmd;
- int t;
char modif[TOK_STRING_SIZE];
db_expr_t addr, count;
- boolean_t have_addr = FALSE;
- int result;
+ int t, result, have_addr = 0;
t = db_read_token();
if (t == tEOL) {
/* empty line repeats last command, at 'next' */
cmd = *last_cmdp;
addr = (db_expr_t)db_next;
- have_addr = FALSE;
+ have_addr = 0;
count = 1;
modif[0] = '\0';
}
@@ -273,11 +271,11 @@ db_command(struct db_command **last_cmdp, struct db_command *cmd_table)
if (db_expression(&addr)) {
db_dot = (db_addr_t) addr;
db_last_addr = db_dot;
- have_addr = TRUE;
+ have_addr = 1;
}
else {
addr = (db_expr_t) db_dot;
- have_addr = FALSE;
+ have_addr = 0;
}
t = db_read_token();
if (t == tCOMMA) {
@@ -329,10 +327,10 @@ db_command(struct db_command **last_cmdp, struct db_command *cmd_table)
void
db_buf_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
vfs_buf_print((void *) addr, full, db_printf);
}
@@ -341,10 +339,10 @@ db_buf_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
void
db_map_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
uvm_map_printit((struct vm_map *) addr, full, db_printf);
}
@@ -374,10 +372,10 @@ db_socket_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
void
db_mount_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
vfs_mount_print((struct mount *) addr, full, db_printf);
}
@@ -385,11 +383,11 @@ db_mount_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
void
db_show_all_mounts(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
struct mount *mp;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
TAILQ_FOREACH(mp, &mountlist, mnt_list) {
db_printf("mountpoint %p\n", mp);
@@ -401,10 +399,10 @@ extern struct pool vnode_pool;
void
db_show_all_vnodes(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
pool_walk(&vnode_pool, full, db_printf, vfs_vnode_print);
}
@@ -413,10 +411,10 @@ extern struct pool bufpool;
void
db_show_all_bufs(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
pool_walk(&bufpool, full, db_printf, vfs_buf_print);
}
@@ -425,10 +423,10 @@ db_show_all_bufs(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
void
db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
uvm_object_printit((struct uvm_object *) addr, full, db_printf);
}
@@ -437,10 +435,10 @@ db_object_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
void
db_page_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
uvm_page_printit((struct vm_page *) addr, full, db_printf);
}
@@ -449,10 +447,10 @@ db_page_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
void
db_vnode_print_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
vfs_vnode_print((void *)addr, full, db_printf);
}
@@ -463,10 +461,10 @@ void
db_nfsreq_print_cmd(db_expr_t addr, int have_addr, db_expr_t count,
char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
nfs_request_print((void *)addr, full, db_printf);
}
@@ -476,10 +474,10 @@ void
db_nfsnode_print_cmd(db_expr_t addr, int have_addr, db_expr_t count,
char *modif)
{
- boolean_t full = FALSE;
+ int full = 0;
if (modif[0] == 'f')
- full = TRUE;
+ full = 1;
nfs_node_print((void *)addr, full, db_printf);
}
@@ -843,8 +841,7 @@ db_dmesg_cmd(db_expr_t addr, int haddr, db_expr_t count, char *modif)
}
void
-db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
- char *modif)
+db_stack_trace_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
db_stack_trace_print(addr, have_addr, count, modif, db_printf);
}
@@ -878,14 +875,12 @@ db_show_regs(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
*/
/*ARGSUSED*/
void
-db_write_cmd(db_expr_t address, boolean_t have_addr, db_expr_t count,
- char *modif)
+db_write_cmd(db_expr_t address, int have_addr, db_expr_t count, char *modif)
{
db_addr_t addr;
db_expr_t old_value;
db_expr_t new_value;
- int size;
- boolean_t wrote_one = FALSE;
+ int size, wrote_one = 0;
char tmpfmt[28];
addr = (db_addr_t) address;
@@ -913,7 +908,7 @@ db_write_cmd(db_expr_t address, boolean_t have_addr, db_expr_t count,
}
while (db_expression(&new_value)) {
- old_value = db_get_value(addr, size, FALSE);
+ old_value = db_get_value(addr, size, 0);
db_printsym(addr, DB_STGY_ANY, db_printf);
db_printf("\t\t%s\t", db_format(tmpfmt, sizeof tmpfmt,
old_value, DB_FORMAT_N, 0, 8));
@@ -922,7 +917,7 @@ db_write_cmd(db_expr_t address, boolean_t have_addr, db_expr_t count,
db_put_value(addr, size, new_value);
addr += size;
- wrote_one = TRUE;
+ wrote_one = 1;
}
if (!wrote_one) {
diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c
index 2045d849ee2..62e3843d637 100644
--- a/sys/ddb/db_examine.c
+++ b/sys/ddb/db_examine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_examine.c,v 1.24 2019/01/09 18:11:22 bluhm Exp $ */
+/* $OpenBSD: db_examine.c,v 1.25 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_examine.c,v 1.11 1996/03/30 22:30:07 christos Exp $ */
/*
@@ -123,13 +123,13 @@ db_examine(db_addr_t addr, char *fmt, int count)
incr = 0;
break;
case 'r': /* signed, current radix */
- value = db_get_value(addr, size, TRUE);
+ value = db_get_value(addr, size, 1);
db_format(tmpfmt, sizeof tmpfmt,
(long)value, DB_FORMAT_R, 0, width);
db_printf("%-*s", width, tmpfmt);
break;
case 'x': /* unsigned hex */
- value = db_get_value(addr, size, FALSE);
+ value = db_get_value(addr, size, 0);
db_printf("%*lx", width, (long)value);
break;
case 'm': /* hex dump */
@@ -145,7 +145,7 @@ db_examine(db_addr_t addr, char *fmt, int count)
for (i = 0; i < size; i++) {
value =
db_get_value(addr+bytes, 1,
- FALSE);
+ 0);
db_printf("%02lx",
(long)value);
bytes++;
@@ -158,8 +158,7 @@ db_examine(db_addr_t addr, char *fmt, int count)
(16-bytes)*2 + (4 - bytes/4) + 1, " ");
/* Print chars, use . for non-printables */
while (bytes--) {
- value = db_get_value(addr + incr, 1,
- FALSE);
+ value = db_get_value(addr + incr, 1, 0);
incr++;
if (value >= ' ' && value <= '~')
db_printf("%c", (int)value);
@@ -169,25 +168,25 @@ db_examine(db_addr_t addr, char *fmt, int count)
db_printf("\n");
break;
case 'z': /* signed hex */
- value = db_get_value(addr, size, TRUE);
+ value = db_get_value(addr, size, 1);
db_format(tmpfmt, sizeof tmpfmt,
(long)value, DB_FORMAT_Z, 0, width);
db_printf("%-*s", width, tmpfmt);
break;
case 'd': /* signed decimal */
- value = db_get_value(addr, size, TRUE);
+ value = db_get_value(addr, size, 1);
db_printf("%-*ld", width, (long)value);
break;
case 'u': /* unsigned decimal */
- value = db_get_value(addr, size, FALSE);
+ value = db_get_value(addr, size, 0);
db_printf("%-*lu", width, (long)value);
break;
case 'o': /* unsigned octal */
- value = db_get_value(addr, size, FALSE);
+ value = db_get_value(addr, size, 0);
db_printf("%-*lo", width, value);
break;
case 'c': /* character */
- value = db_get_value(addr, 1, FALSE);
+ value = db_get_value(addr, 1, 0);
incr = 1;
if (value >= ' ' && value <= '~')
db_printf("%c", (int)value);
@@ -198,7 +197,7 @@ db_examine(db_addr_t addr, char *fmt, int count)
incr = 0;
for (;;) {
value = db_get_value(addr + incr, 1,
- FALSE);
+ 0);
incr++;
if (value == 0)
break;
@@ -220,10 +219,10 @@ db_examine(db_addr_t addr, char *fmt, int count)
/* if we had a disassembly modifier, do it last */
switch (dis) {
case 'i': /* instruction */
- addr = db_disasm(addr, FALSE);
+ addr = db_disasm(addr, 0);
break;
case 'I': /* instruction, alternate form */
- addr = db_disasm(addr, TRUE);
+ addr = db_disasm(addr, 1);
break;
default:
addr += incr;
@@ -290,7 +289,7 @@ db_print_loc_and_inst(db_addr_t loc)
{
db_printsym(loc, DB_STGY_PROC, db_printf);
db_printf(":\t");
- (void) db_disasm(loc, FALSE);
+ (void) db_disasm(loc, 0);
}
/* local copy is needed here so that we can trace strlcpy() in libkern */
@@ -397,7 +396,7 @@ db_search(db_addr_t addr, int size, db_expr_t value, db_expr_t mask,
/* Negative counts means forever. */
while (count < 0 || count-- != 0) {
db_prev = addr;
- if ((db_get_value(addr, size, FALSE) & mask) == value)
+ if ((db_get_value(addr, size, 0) & mask) == value)
break;
addr += size;
}
diff --git a/sys/ddb/db_expr.c b/sys/ddb/db_expr.c
index 7c68b1ca1dd..528a9a3706f 100644
--- a/sys/ddb/db_expr.c
+++ b/sys/ddb/db_expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_expr.c,v 1.14 2017/08/10 19:39:38 mpi Exp $ */
+/* $OpenBSD: db_expr.c,v 1.15 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_expr.c,v 1.5 1996/02/05 01:56:58 christos Exp $ */
/*
@@ -41,13 +41,13 @@
#include <ddb/db_extern.h>
#include <ddb/db_variables.h>
-boolean_t db_term(db_expr_t *);
-boolean_t db_unary(db_expr_t *);
-boolean_t db_mult_expr(db_expr_t *);
-boolean_t db_add_expr(db_expr_t *);
-boolean_t db_shift_expr(db_expr_t *);
+int db_term(db_expr_t *);
+int db_unary(db_expr_t *);
+int db_mult_expr(db_expr_t *);
+int db_add_expr(db_expr_t *);
+int db_shift_expr(db_expr_t *);
-boolean_t
+int
db_term(db_expr_t *valuep)
{
int t;
@@ -58,32 +58,32 @@ db_term(db_expr_t *valuep)
db_error("Symbol not found\n");
/*NOTREACHED*/
}
- return (TRUE);
+ return 1;
}
if (t == tNUMBER) {
*valuep = db_tok_number;
- return (TRUE);
+ return 1;
}
if (t == tDOT) {
*valuep = (db_expr_t)db_dot;
- return (TRUE);
+ return 1;
}
if (t == tDOTDOT) {
*valuep = (db_expr_t)db_prev;
- return (TRUE);
+ return 1;
}
if (t == tPLUS) {
*valuep = (db_expr_t) db_next;
- return (TRUE);
+ return 1;
}
if (t == tDITTO) {
*valuep = (db_expr_t)db_last_addr;
- return (TRUE);
+ return 1;
}
if (t == tDOLLAR) {
if (!db_get_variable(valuep))
- return (FALSE);
- return (TRUE);
+ return 0;
+ return 1;
}
if (t == tLPAREN) {
if (!db_expression(valuep)) {
@@ -95,13 +95,13 @@ db_term(db_expr_t *valuep)
db_error("Syntax error\n");
/*NOTREACHED*/
}
- return (TRUE);
+ return 1;
}
db_unread_token(t);
- return (FALSE);
+ return 0;
}
-boolean_t
+int
db_unary(db_expr_t *valuep)
{
int t;
@@ -113,7 +113,7 @@ db_unary(db_expr_t *valuep)
/*NOTREACHED*/
}
*valuep = -*valuep;
- return (TRUE);
+ return 1;
}
if (t == tSTAR) {
/* indirection */
@@ -122,20 +122,20 @@ db_unary(db_expr_t *valuep)
/*NOTREACHED*/
}
*valuep = db_get_value((db_addr_t)*valuep, sizeof(db_addr_t), FALSE);
- return (TRUE);
+ return 1;
}
db_unread_token(t);
return (db_term(valuep));
}
-boolean_t
+int
db_mult_expr(db_expr_t *valuep)
{
db_expr_t lhs, rhs;
int t;
if (!db_unary(&lhs))
- return (FALSE);
+ return 0;
t = db_read_token();
while (t == tSTAR || t == tSLASH || t == tPCT || t == tHASH) {
@@ -161,17 +161,17 @@ db_mult_expr(db_expr_t *valuep)
}
db_unread_token(t);
*valuep = lhs;
- return (TRUE);
+ return 1;
}
-boolean_t
+int
db_add_expr(db_expr_t *valuep)
{
db_expr_t lhs, rhs;
int t;
if (!db_mult_expr(&lhs))
- return (FALSE);
+ return 0;
t = db_read_token();
while (t == tPLUS || t == tMINUS) {
@@ -187,17 +187,17 @@ db_add_expr(db_expr_t *valuep)
}
db_unread_token(t);
*valuep = lhs;
- return (TRUE);
+ return 1;
}
-boolean_t
+int
db_shift_expr(db_expr_t *valuep)
{
db_expr_t lhs, rhs;
int t;
if (!db_add_expr(&lhs))
- return (FALSE);
+ return 0;
t = db_read_token();
while (t == tSHIFT_L || t == tSHIFT_R) {
@@ -219,7 +219,7 @@ db_shift_expr(db_expr_t *valuep)
}
db_unread_token(t);
*valuep = lhs;
- return (TRUE);
+ return 1;
}
int
diff --git a/sys/ddb/db_extern.h b/sys/ddb/db_extern.h
index 42f00ef8dc7..e31239de457 100644
--- a/sys/ddb/db_extern.h
+++ b/sys/ddb/db_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_extern.h,v 1.19 2017/05/29 06:14:10 mpi Exp $ */
+/* $OpenBSD: db_extern.h,v 1.20 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_extern.h,v 1.1 1996/02/05 01:57:00 christos Exp $ */
/*
@@ -38,7 +38,7 @@ void ddb_init(void);
/* db_examine.c */
void db_examine_cmd(db_expr_t, int, db_expr_t, char *);
void db_print_cmd(db_expr_t, int, db_expr_t, char *);
-void db_search_cmd(db_expr_t, boolean_t, db_expr_t, char *);
+void db_search_cmd(db_expr_t, int, db_expr_t, char *);
void db_print_loc_and_inst(db_addr_t);
size_t db_strlcpy(char *, const char *, size_t);
diff --git a/sys/ddb/db_input.c b/sys/ddb/db_input.c
index 2c180369fed..d68595a92c8 100644
--- a/sys/ddb/db_input.c
+++ b/sys/ddb/db_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_input.c,v 1.17 2019/04/02 10:50:20 yasuoka Exp $ */
+/* $OpenBSD: db_input.c,v 1.18 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_input.c,v 1.7 1996/02/05 01:57:02 christos Exp $ */
/*
@@ -137,7 +137,7 @@ db_delete_line(void)
} while (0)
#endif
-/* returns TRUE at end-of-line */
+/* returns `1' at end-of-line */
int
db_inputchar(int c)
{
@@ -289,7 +289,7 @@ db_inputchar(int c)
*/
db_history_curr = db_history_last;
*db_le++ = c;
- return TRUE;
+ return 1;
}
}
if (db_le != db_lbuf_start) {
@@ -308,7 +308,7 @@ db_inputchar(int c)
db_history_curr = db_history_last;
#endif
*db_le++ = c;
- return TRUE;
+ return 1;
default:
if (db_le == db_lbuf_end) {
cnputc('\007');
@@ -326,7 +326,7 @@ db_inputchar(int c)
}
break;
}
- return FALSE;
+ return 0;
}
int
diff --git a/sys/ddb/db_interface.h b/sys/ddb/db_interface.h
index 11d0409dd77..f4d935d8495 100644
--- a/sys/ddb/db_interface.h
+++ b/sys/ddb/db_interface.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.h,v 1.20 2017/09/29 09:36:04 mpi Exp $ */
+/* $OpenBSD: db_interface.h,v 1.21 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_interface.h,v 1.1 1996/02/05 01:57:03 christos Exp $ */
/*
@@ -37,7 +37,7 @@ void db_stack_trace_print(db_expr_t, int, db_expr_t, char *,
int (*)(const char *, ...));
/* arch/<arch>/<arch>/db_disasm.c */
-db_addr_t db_disasm(db_addr_t, boolean_t);
+db_addr_t db_disasm(db_addr_t, int);
/* kern/kern_proc.c */
void db_kill_cmd(db_expr_t, int, db_expr_t, char *);
diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c
index fce2f11f602..d0b9538b619 100644
--- a/sys/ddb/db_output.c
+++ b/sys/ddb/db_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_output.c,v 1.32 2018/05/07 15:52:47 visa Exp $ */
+/* $OpenBSD: db_output.c,v 1.33 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_output.c,v 1.13 1996/04/01 17:27:14 christos Exp $ */
/*
@@ -238,7 +238,7 @@ db_stack_dump(void)
intrace = 1;
printf("Starting stack trace...\n");
- db_stack_trace_print((db_expr_t)__builtin_frame_address(0), TRUE,
+ db_stack_trace_print((db_expr_t)__builtin_frame_address(0), 1,
256 /* low limit */, "", printf);
printf("End of stack trace.\n");
intrace = 0;
diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c
index d33146b367c..c53fb53ba81 100644
--- a/sys/ddb/db_run.c
+++ b/sys/ddb/db_run.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_run.c,v 1.27 2017/04/30 13:04:49 mpi Exp $ */
+/* $OpenBSD: db_run.c,v 1.28 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_run.c,v 1.8 1996/02/05 01:57:12 christos Exp $ */
/*
@@ -63,12 +63,12 @@ int db_run_mode;
#define STEP_INVISIBLE 5
#define STEP_COUNT 6
-boolean_t db_sstep_print;
+int db_sstep_print;
int db_loop_count;
int db_call_depth;
-boolean_t
-db_stop_at_pc(db_regs_t *regs, boolean_t *is_breakpoint)
+int
+db_stop_at_pc(db_regs_t *regs, int *is_breakpoint)
{
db_addr_t pc, old_pc;
db_breakpoint_t bkpt;
@@ -96,8 +96,8 @@ db_stop_at_pc(db_regs_t *regs, boolean_t *is_breakpoint)
if (--bkpt->count == 0) {
db_clear_single_step(regs);
bkpt->count = bkpt->init_count;
- *is_breakpoint = TRUE;
- return (TRUE); /* stop here */
+ *is_breakpoint = 1;
+ return 1; /* stop here */
}
} else if (*is_breakpoint
#ifdef SOFTWARE_SSTEP
@@ -117,14 +117,14 @@ db_stop_at_pc(db_regs_t *regs, boolean_t *is_breakpoint)
}
db_clear_single_step(regs);
- *is_breakpoint = FALSE;
+ *is_breakpoint = 0;
if (db_run_mode == STEP_INVISIBLE) {
db_run_mode = STEP_CONTINUE;
- return (FALSE); /* continue */
+ return 0; /* continue */
}
if (db_run_mode == STEP_COUNT) {
- return (FALSE); /* continue */
+ return 0; /* continue */
}
if (db_run_mode == STEP_ONCE) {
if (--db_loop_count > 0) {
@@ -133,11 +133,11 @@ db_stop_at_pc(db_regs_t *regs, boolean_t *is_breakpoint)
db_print_loc_and_inst(pc);
db_printf("\n");
}
- return (FALSE); /* continue */
+ return 0; /* continue */
}
}
if (db_run_mode == STEP_RETURN) {
- db_expr_t ins = db_get_value(pc, sizeof(int), FALSE);
+ db_expr_t ins = db_get_value(pc, sizeof(int), 0);
/* continue until matching return */
@@ -156,25 +156,25 @@ db_stop_at_pc(db_regs_t *regs, boolean_t *is_breakpoint)
}
if (inst_call(ins))
db_call_depth++;
- return (FALSE); /* continue */
+ return 0; /* continue */
}
}
if (db_run_mode == STEP_CALLT) {
- db_expr_t ins = db_get_value(pc, sizeof(int), FALSE);
+ db_expr_t ins = db_get_value(pc, sizeof(int), 0);
/* continue until call or return */
if (!inst_call(ins) && !inst_return(ins) &&
!inst_trap_return(ins)) {
- return (FALSE); /* continue */
+ return 0; /* continue */
}
}
db_run_mode = STEP_NONE;
- return (TRUE);
+ return 1;
}
void
-db_restart_at_pc(db_regs_t *regs, boolean_t watchpt)
+db_restart_at_pc(db_regs_t *regs, int watchpt)
{
db_addr_t pc = PC_REGS(regs);
@@ -186,13 +186,13 @@ db_restart_at_pc(db_regs_t *regs, boolean_t watchpt)
* We are about to execute this instruction,
* so count it now.
*/
- ins = db_get_value(pc, sizeof(int), FALSE);
+ ins = db_get_value(pc, sizeof(int), 0);
db_inst_count++;
#ifdef SOFTWARE_SSTEP
/* XXX works on mips, but... */
if (inst_branch(ins) || inst_call(ins)) {
ins = db_get_value(next_instr_address(pc, 1),
- sizeof(int), FALSE);
+ sizeof(int), 0);
db_inst_count++;
}
#endif /* SOFTWARE_SSTEP */
@@ -228,13 +228,13 @@ db_single_step(db_regs_t *regs)
void
db_single_step_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
- boolean_t print = FALSE;
+ int print = 0;
if (count == -1)
count = 1;
if (modif[0] == 'p')
- print = TRUE;
+ print = 1;
db_run_mode = STEP_ONCE;
db_loop_count = count;
@@ -250,10 +250,10 @@ void
db_trace_until_call_cmd(db_expr_t addr, int have_addr, db_expr_t count,
char *modif)
{
- boolean_t print = FALSE;
+ int print = 0;
if (modif[0] == 'p')
- print = TRUE;
+ print = 1;
db_run_mode = STEP_CALLT;
db_sstep_print = print;
@@ -267,10 +267,10 @@ void
db_trace_until_matching_cmd(db_expr_t addr, int have_addr, db_expr_t count,
char *modif)
{
- boolean_t print = FALSE;
+ int print = 0;
if (modif[0] == 'p')
- print = TRUE;
+ print = 1;
db_run_mode = STEP_RETURN;
db_call_depth = 1;
@@ -303,7 +303,7 @@ db_continue_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
* Just define the above conditional and provide
* the functions/macros defined below.
*
- * extern boolean_t
+ * extern int
* inst_branch(ins), returns true if the instruction might branch
* extern unsigned
* branch_taken(ins, pc, getreg_val, regs),
@@ -338,7 +338,7 @@ db_set_single_step(db_regs_t *regs)
* User was stopped at pc, e.g. the instruction
* at pc was not executed.
*/
- inst = db_get_value(pc, sizeof(int), FALSE);
+ inst = db_get_value(pc, sizeof(int), 0);
if (inst_branch(inst) || inst_call(inst) || inst_return(inst)) {
brpc = branch_taken(inst, pc, getreg_val, regs);
if (brpc != pc) { /* self-branches are hopeless */
diff --git a/sys/ddb/db_run.h b/sys/ddb/db_run.h
index 35351cdd151..e3f50336bff 100644
--- a/sys/ddb/db_run.h
+++ b/sys/ddb/db_run.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_run.h,v 1.11 2016/01/25 14:30:30 mpi Exp $ */
+/* $OpenBSD: db_run.h,v 1.12 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_run.h,v 1.3 1996/02/05 01:57:14 christos Exp $ */
/*
@@ -39,8 +39,8 @@
extern int db_inst_count;
extern int db_cmd_loop_done;
-boolean_t db_stop_at_pc(db_regs_t *, boolean_t *);
-void db_restart_at_pc(db_regs_t *, boolean_t);
+int db_stop_at_pc(db_regs_t *, int *);
+void db_restart_at_pc(db_regs_t *, int);
void db_single_step(db_regs_t *);
#ifndef db_set_single_step
void db_set_single_step(db_regs_t *);
diff --git a/sys/ddb/db_trap.c b/sys/ddb/db_trap.c
index f4109a1a6e4..24a4dd9a169 100644
--- a/sys/ddb/db_trap.c
+++ b/sys/ddb/db_trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trap.c,v 1.29 2019/07/20 23:06:51 mpi Exp $ */
+/* $OpenBSD: db_trap.c,v 1.30 2019/11/06 07:30:08 mpi Exp $ */
/* $NetBSD: db_trap.c,v 1.9 1996/02/05 01:57:18 christos Exp $ */
/*
@@ -49,8 +49,8 @@
void
db_trap(int type, int code)
{
- boolean_t bkpt;
- boolean_t watchpt;
+ int bkpt;
+ int watchpt;
bkpt = IS_BREAKPOINT_TRAP(type, code);
watchpt = IS_WATCHPOINT_TRAP(type, code);