From 2b490bc747e67a2b9cecb12321ed4719600d31e9 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Mon, 18 May 2015 22:27:46 +0000 Subject: [PATCH] ddb: stop boolean screaming. TRUE --> true FALSE--> false Hinted by: NetBSD --- sys/ddb/db_break.c | 8 ++++---- sys/ddb/db_command.c | 12 ++++++------ sys/ddb/db_examine.c | 26 +++++++++++++------------- sys/ddb/db_expr.c | 38 +++++++++++++++++++------------------- sys/ddb/db_input.c | 2 +- sys/ddb/db_main.c | 4 ++-- sys/ddb/db_ps.c | 12 ++++++------ sys/ddb/db_run.c | 42 +++++++++++++++++++++--------------------- sys/ddb/db_sym.c | 36 ++++++++++++++++++------------------ sys/ddb/db_textdump.c | 2 +- sys/ddb/db_watch.c | 14 +++++++------- sys/ddb/db_write_cmd.c | 6 +++--- 12 files changed, 101 insertions(+), 101 deletions(-) diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c index f4c27aa986c9..bd65fdd7e639 100644 --- a/sys/ddb/db_break.c +++ b/sys/ddb/db_break.c @@ -155,12 +155,12 @@ db_find_breakpoint_here(db_addr_t addr) return db_find_breakpoint(db_map_addr(addr), addr); } -static boolean_t db_breakpoints_inserted = TRUE; +static boolean_t db_breakpoints_inserted = true; #ifndef BKPT_WRITE #define BKPT_WRITE(addr, storage) \ do { \ - *storage = db_get_value(addr, BKPT_SIZE, FALSE); \ + *storage = db_get_value(addr, BKPT_SIZE, false); \ db_put_value(addr, BKPT_SIZE, BKPT_SET(*storage)); \ } while (0) #endif @@ -183,7 +183,7 @@ db_set_breakpoints(void) if (db_map_current(bkpt->map)) { BKPT_WRITE(bkpt->address, &bkpt->bkpt_inst); } - db_breakpoints_inserted = TRUE; + db_breakpoints_inserted = true; } } @@ -200,7 +200,7 @@ db_clear_breakpoints(void) if (db_map_current(bkpt->map)) { BKPT_CLEAR(bkpt->address, &bkpt->bkpt_inst); } - db_breakpoints_inserted = FALSE; + db_breakpoints_inserted = false; } } diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 7bed8ae27eea..fc1921baaa97 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -151,7 +151,7 @@ static struct command *db_last_command = 0; * and '+' points to next line. * Otherwise: 'dot' points to next item, '..' points to last. */ -static boolean_t db_ed_style = TRUE; +static boolean_t db_ed_style = true; /* * Utility routine - discard tokens through end-of-line. @@ -327,7 +327,7 @@ db_command(struct command **last_cmdp, struct command_table *cmd_table, int t; char modif[TOK_STRING_SIZE]; db_expr_t addr, count; - boolean_t have_addr = FALSE; + boolean_t have_addr = false; int result; t = db_read_token(); @@ -335,7 +335,7 @@ db_command(struct command **last_cmdp, struct command_table *cmd_table, /* empty line repeats last command, at 'next' */ cmd = *last_cmdp; addr = (db_expr_t)db_next; - have_addr = FALSE; + have_addr = false; count = 1; modif[0] = '\0'; } @@ -405,11 +405,11 @@ db_command(struct command **last_cmdp, struct command_table *cmd_table, if (db_expression(&addr)) { db_dot = (db_addr_t) addr; db_last_addr = db_dot; - have_addr = TRUE; + have_addr = true; } else { addr = (db_expr_t) db_dot; - have_addr = FALSE; + have_addr = false; } t = db_read_token(); if (t == tCOMMA) { @@ -530,7 +530,7 @@ db_dump(db_expr_t dummy, boolean_t dummy2, db_expr_t dummy3, char *dummy4) "run \"textdump unset\" first or \"textdump dump\" for a textdump.\n"); return; } - error = doadump(FALSE); + error = doadump(false); if (error) { db_printf("Cannot dump: "); switch (error) { diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c index f10df12928a5..6946be42b67b 100644 --- a/sys/ddb/db_examine.c +++ b/sys/ddb/db_examine.c @@ -110,37 +110,37 @@ db_examine(db_addr_t addr, char *fmt, int count) width = size * 4; switch (c) { case 'r': /* signed, current radix */ - value = db_get_value(addr, size, TRUE); + value = db_get_value(addr, size, true); addr += size; db_printf("%+-*lr", width, (long)value); break; case 'x': /* unsigned hex */ - value = db_get_value(addr, size, FALSE); + value = db_get_value(addr, size, false); addr += size; db_printf("%-*lx", width, (long)value); break; case 'z': /* signed hex */ - value = db_get_value(addr, size, TRUE); + value = db_get_value(addr, size, true); addr += size; db_printf("%-*ly", width, (long)value); break; case 'd': /* signed decimal */ - value = db_get_value(addr, size, TRUE); + value = db_get_value(addr, size, true); addr += size; db_printf("%-*ld", width, (long)value); break; case 'u': /* unsigned decimal */ - value = db_get_value(addr, size, FALSE); + value = db_get_value(addr, size, false); addr += size; db_printf("%-*lu", width, (long)value); break; case 'o': /* unsigned octal */ - value = db_get_value(addr, size, FALSE); + value = db_get_value(addr, size, false); addr += size; db_printf("%-*lo", width, (long)value); break; case 'c': /* character */ - value = db_get_value(addr, 1, FALSE); + value = db_get_value(addr, 1, false); addr += 1; if (value >= ' ' && value <= '~') db_printf("%c", (int)value); @@ -149,7 +149,7 @@ db_examine(db_addr_t addr, char *fmt, int count) break; case 's': /* null-terminated string */ for (;;) { - value = db_get_value(addr, 1, FALSE); + value = db_get_value(addr, 1, false); addr += 1; if (value == 0) break; @@ -161,15 +161,15 @@ db_examine(db_addr_t addr, char *fmt, int count) break; case 'S': /* symbol */ value = db_get_value(addr, sizeof(void *), - FALSE); + false); addr += sizeof(void *); db_printsym(value, DB_STGY_ANY); break; case 'i': /* instruction */ - addr = db_disasm(addr, FALSE); + addr = db_disasm(addr, false); break; case 'I': /* instruction, alternate form */ - addr = db_disasm(addr, TRUE); + addr = db_disasm(addr, true); break; default: break; @@ -236,7 +236,7 @@ db_print_loc_and_inst(db_addr_t loc) { db_printsym(loc, DB_STGY_PROC); db_printf(":\t"); - (void) db_disasm(loc, TRUE); + (void) db_disasm(loc, true); } /* @@ -314,7 +314,7 @@ db_search(db_addr_t addr, int size, db_expr_t value, db_expr_t mask, { while (count-- != 0) { db_prev = addr; - if ((db_get_value(addr, size, FALSE) & mask) == value) + if ((db_get_value(addr, size, false) & mask) == value) break; addr += size; } diff --git a/sys/ddb/db_expr.c b/sys/ddb/db_expr.c index 424384ce341a..bd80c68f5102 100644 --- a/sys/ddb/db_expr.c +++ b/sys/ddb/db_expr.c @@ -57,32 +57,32 @@ db_term(db_expr_t *valuep) db_error("Symbol not found\n"); /*NOTREACHED*/ } - return (TRUE); + return (true); } if (t == tNUMBER) { *valuep = (db_expr_t)db_tok_number; - return (TRUE); + return (true); } if (t == tDOT) { *valuep = (db_expr_t)db_dot; - return (TRUE); + return (true); } if (t == tDOTDOT) { *valuep = (db_expr_t)db_prev; - return (TRUE); + return (true); } if (t == tPLUS) { *valuep = (db_expr_t) db_next; - return (TRUE); + return (true); } if (t == tDITTO) { *valuep = (db_expr_t)db_last_addr; - return (TRUE); + return (true); } if (t == tDOLLAR) { if (!db_get_variable(valuep)) - return (FALSE); - return (TRUE); + return (false); + return (true); } if (t == tLPAREN) { if (!db_expression(valuep)) { @@ -94,10 +94,10 @@ db_term(db_expr_t *valuep) db_error("Syntax error\n"); /*NOTREACHED*/ } - return (TRUE); + return (true); } db_unread_token(t); - return (FALSE); + return (false); } static boolean_t @@ -112,7 +112,7 @@ db_unary(db_expr_t *valuep) /*NOTREACHED*/ } *valuep = -*valuep; - return (TRUE); + return (true); } if (t == tSTAR) { /* indirection */ @@ -120,8 +120,8 @@ db_unary(db_expr_t *valuep) db_error("Syntax error\n"); /*NOTREACHED*/ } - *valuep = db_get_value((db_addr_t)*valuep, sizeof(void *), FALSE); - return (TRUE); + *valuep = db_get_value((db_addr_t)*valuep, sizeof(void *), false); + return (true); } db_unread_token(t); return (db_term(valuep)); @@ -134,7 +134,7 @@ db_mult_expr(db_expr_t *valuep) int t; if (!db_unary(&lhs)) - return (FALSE); + return (false); t = db_read_token(); while (t == tSTAR || t == tSLASH || t == tPCT || t == tHASH) { @@ -160,7 +160,7 @@ db_mult_expr(db_expr_t *valuep) } db_unread_token(t); *valuep = lhs; - return (TRUE); + return (true); } static boolean_t @@ -170,7 +170,7 @@ db_add_expr(db_expr_t *valuep) int t; if (!db_mult_expr(&lhs)) - return (FALSE); + return (false); t = db_read_token(); while (t == tPLUS || t == tMINUS) { @@ -186,7 +186,7 @@ db_add_expr(db_expr_t *valuep) } db_unread_token(t); *valuep = lhs; - return (TRUE); + return (true); } static boolean_t @@ -196,7 +196,7 @@ db_shift_expr(db_expr_t *valuep) int t; if (!db_add_expr(&lhs)) - return (FALSE); + return (false); t = db_read_token(); while (t == tSHIFT_L || t == tSHIFT_R) { @@ -218,7 +218,7 @@ db_shift_expr(db_expr_t *valuep) } db_unread_token(t); *valuep = lhs; - return (TRUE); + return (true); } int diff --git a/sys/ddb/db_input.c b/sys/ddb/db_input.c index 327f4903cd89..7b677ee5ecfd 100644 --- a/sys/ddb/db_input.c +++ b/sys/ddb/db_input.c @@ -112,7 +112,7 @@ db_delete(n, bwd) db_le -= n; } -/* returns TRUE at end-of-line */ +/* returns true at end-of-line */ static int db_inputchar(c) int c; diff --git a/sys/ddb/db_main.c b/sys/ddb/db_main.c index bee321cc34ed..ffa210fa70d3 100644 --- a/sys/ddb/db_main.c +++ b/sys/ddb/db_main.c @@ -67,7 +67,7 @@ boolean_t X_db_line_at_pc(db_symtab_t *symtab, c_db_sym_t sym, char **file, int *line, db_expr_t off) { - return (FALSE); + return (false); } c_db_sym_t @@ -149,7 +149,7 @@ boolean_t X_db_sym_numargs(db_symtab_t *symtab, c_db_sym_t sym, int *nargp, char **argp) { - return (FALSE); + return (false); } void diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index d28a06099318..9d5d436ef478 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -303,7 +303,7 @@ DB_SHOW_COMMAND(thread, db_show_thread) /* Determine which thread to examine. */ if (have_addr) - td = db_lookup_thread(addr, FALSE); + td = db_lookup_thread(addr, false); else td = kdb_thread; lock = (struct lock_object *)td->td_lock; @@ -332,28 +332,28 @@ DB_SHOW_COMMAND(thread, db_show_thread) break; case TDS_INHIBITED: db_printf("INHIBITED: {"); - comma = FALSE; + comma = false; if (TD_IS_SLEEPING(td)) { db_printf("SLEEPING"); - comma = TRUE; + comma = true; } if (TD_IS_SUSPENDED(td)) { if (comma) db_printf(", "); db_printf("SUSPENDED"); - comma = TRUE; + comma = true; } if (TD_IS_SWAPPED(td)) { if (comma) db_printf(", "); db_printf("SWAPPED"); - comma = TRUE; + comma = true; } if (TD_ON_LOCK(td)) { if (comma) db_printf(", "); db_printf("LOCK"); - comma = TRUE; + comma = true; } if (TD_AWAITING_INTR(td)) { if (comma) diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c index 406b9ddd309c..424d4857bf31 100644 --- a/sys/ddb/db_run.c +++ b/sys/ddb/db_run.c @@ -87,7 +87,7 @@ db_stop_at_pc(boolean_t *is_breakpoint) #ifdef SOFTWARE_SSTEP if ((db_not_taken_bkpt != 0 && pc == db_not_taken_bkpt->address) || (db_taken_bkpt != 0 && pc == db_taken_bkpt->address)) - *is_breakpoint = FALSE; + *is_breakpoint = false; #endif db_clear_single_step(); @@ -112,8 +112,8 @@ db_stop_at_pc(boolean_t *is_breakpoint) if (bkpt) { if (--bkpt->count == 0) { bkpt->count = bkpt->init_count; - *is_breakpoint = TRUE; - return (TRUE); /* stop here */ + *is_breakpoint = true; + return (true); /* stop here */ } } else if (*is_breakpoint) { #ifdef BKPT_SKIP @@ -121,14 +121,14 @@ db_stop_at_pc(boolean_t *is_breakpoint) #endif } - *is_breakpoint = FALSE; + *is_breakpoint = false; if (db_run_mode == STEP_INVISIBLE) { db_run_mode = STEP_CONTINUE; - return (FALSE); /* continue */ + return (false); /* continue */ } if (db_run_mode == STEP_COUNT) { - return (FALSE); /* continue */ + return (false); /* continue */ } if (db_run_mode == STEP_ONCE) { if (--db_loop_count > 0) { @@ -137,14 +137,14 @@ db_stop_at_pc(boolean_t *is_breakpoint) db_print_loc_and_inst(pc); db_printf("\n"); } - return (FALSE); /* continue */ + return (false); /* continue */ } } if (db_run_mode == STEP_RETURN) { /* continue until matching return */ db_expr_t ins; - ins = db_get_value(pc, sizeof(int), FALSE); + ins = db_get_value(pc, sizeof(int), false); if (!inst_trap_return(ins) && (!inst_return(ins) || --db_call_depth != 0)) { if (db_sstep_print) { @@ -160,22 +160,22 @@ db_stop_at_pc(boolean_t *is_breakpoint) } if (inst_call(ins)) db_call_depth++; - return (FALSE); /* continue */ + return (false); /* continue */ } } if (db_run_mode == STEP_CALLT) { /* continue until call or return */ db_expr_t ins; - ins = db_get_value(pc, sizeof(int), FALSE); + ins = db_get_value(pc, sizeof(int), false); if (!inst_call(ins) && !inst_return(ins) && !inst_trap_return(ins)) { - return (FALSE); /* continue */ + return (false); /* continue */ } } db_run_mode = STEP_NONE; - return (TRUE); + return (true); } void @@ -193,7 +193,7 @@ db_restart_at_pc(boolean_t watchpt) #ifdef SOFTWARE_SSTEP db_expr_t ins = #endif - db_get_value(pc, sizeof(int), FALSE); + db_get_value(pc, sizeof(int), false); db_inst_count++; db_load_count += inst_load(ins); db_store_count += inst_store(ins); @@ -201,7 +201,7 @@ db_restart_at_pc(boolean_t watchpt) /* 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), false); db_inst_count++; db_load_count += inst_load(ins); db_store_count += inst_store(ins); @@ -266,7 +266,7 @@ db_set_single_step(void) * 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), false); if (inst_branch(inst) || inst_call(inst) || inst_return(inst)) { brpc = branch_taken(inst, pc); if (brpc != pc) { /* self-branches are hopeless */ @@ -305,13 +305,13 @@ db_single_step_cmd(addr, have_addr, count, modif) db_expr_t count; char * modif; { - boolean_t print = FALSE; + boolean_t print = false; if (count == -1) count = 1; if (modif[0] == 'p') - print = TRUE; + print = true; db_run_mode = STEP_ONCE; db_loop_count = count; @@ -329,10 +329,10 @@ void db_trace_until_call_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif) { - boolean_t print = FALSE; + boolean_t print = false; if (modif[0] == 'p') - print = TRUE; + print = true; db_run_mode = STEP_CALLT; db_sstep_print = print; @@ -348,10 +348,10 @@ void db_trace_until_matching_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif) { - boolean_t print = FALSE; + boolean_t print = false; if (modif[0] == 'p') - print = TRUE; + print = true; db_run_mode = STEP_RETURN; db_call_depth = 1; diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index ff6889edec9a..dad467a2304d 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -206,10 +206,10 @@ boolean_t db_eqname(const char *src, const char *dst, int c) { if (!strcmp(src, dst)) - return (TRUE); + return (true); if (src[0] == c) return (!strcmp(src+1,dst)); - return (FALSE); + return (false); } boolean_t @@ -219,9 +219,9 @@ db_value_of_name(const char *name, db_expr_t *valuep) sym = db_lookup(name); if (sym == C_DB_SYM_NULL) - return (FALSE); + return (false); db_symbol_values(sym, &name, valuep); - return (TRUE); + return (true); } boolean_t @@ -239,12 +239,12 @@ db_value_of_name_pcpu(const char *name, db_expr_t *valuep) snprintf(tmp, sizeof(tmp), "pcpu_entry_%s", name); sym = db_lookup(tmp); if (sym == C_DB_SYM_NULL) - return (FALSE); + return (false); db_symbol_values(sym, &name, &value); if (value < DPCPU_START || value >= DPCPU_STOP) - return (FALSE); + return (false); *valuep = (db_expr_t)((uintptr_t)value + dpcpu_off[cpu]); - return (TRUE); + return (true); } boolean_t @@ -263,14 +263,14 @@ db_value_of_name_vnet(const char *name, db_expr_t *valuep) snprintf(tmp, sizeof(tmp), "vnet_entry_%s", name); sym = db_lookup(tmp); if (sym == C_DB_SYM_NULL) - return (FALSE); + return (false); db_symbol_values(sym, &name, &value); if (value < VNET_START || value >= VNET_STOP) - return (FALSE); + return (false); *valuep = (db_expr_t)((uintptr_t)value + vnet->vnet_data_base); - return (TRUE); + return (true); #else - return (FALSE); + return (false); #endif } @@ -328,10 +328,10 @@ db_lookup(const char *symstr) } /* - * If TRUE, check across symbol tables for multiple occurrences + * If true, check across symbol tables for multiple occurrences * of a name. Might slow things down quite a bit. */ -static volatile boolean_t db_qualify_ambiguous_names = FALSE; +static volatile boolean_t db_qualify_ambiguous_names = false; /* * Does this symbol name appear in more than one symbol table? @@ -343,20 +343,20 @@ db_symbol_is_ambiguous(c_db_sym_t sym) const char *sym_name; register int i; register - boolean_t found_once = FALSE; + boolean_t found_once = false; if (!db_qualify_ambiguous_names) - return FALSE; + return (false); db_symbol_values(sym, &sym_name, 0); for (i = 0; i < db_nsymtab; i++) { if (X_db_lookup(&db_symtabs[i], sym_name)) { if (found_once) - return TRUE; - found_once = TRUE; + return true; + found_once = true; } } - return FALSE; + return (false); } /* diff --git a/sys/ddb/db_textdump.c b/sys/ddb/db_textdump.c index b4b040b87509..adf94d49a99a 100644 --- a/sys/ddb/db_textdump.c +++ b/sys/ddb/db_textdump.c @@ -543,7 +543,7 @@ db_textdump_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, db_printf("textdump unset\n"); } else if (strcmp(db_tok_string, "dump") == 0) { textdump_pending = 1; - doadump(TRUE); + doadump(true); } else { db_textdump_usage(); } diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c index 8debdb797be6..7dee3e3ee3c9 100644 --- a/sys/ddb/db_watch.c +++ b/sys/ddb/db_watch.c @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); * Watchpoints. */ -static boolean_t db_watchpoints_inserted = TRUE; +static boolean_t db_watchpoints_inserted = true; #define NWATCHPOINTS 100 static struct db_watchpoint db_watch_table[NWATCHPOINTS]; @@ -129,7 +129,7 @@ db_set_watchpoint(vm_map_t map, db_addr_t addr, vm_size_t size) watch->link = db_watchpoint_list; db_watchpoint_list = watch; - db_watchpoints_inserted = FALSE; + db_watchpoints_inserted = false; } static void @@ -231,14 +231,14 @@ db_set_watchpoints(void) round_page(watch->hiaddr), VM_PROT_READ); - db_watchpoints_inserted = TRUE; + db_watchpoints_inserted = true; } } void db_clear_watchpoints(void) { - db_watchpoints_inserted = FALSE; + db_watchpoints_inserted = false; } #ifdef notused @@ -254,7 +254,7 @@ db_find_watchpoint(vm_map_t map, db_addr_t addr, db_regs_t regs) if (db_map_equal(watch->map, map)) { if ((watch->loaddr <= addr) && (addr < watch->hiaddr)) - return (TRUE); + return (true); else if ((trunc_page(watch->loaddr) <= addr) && (addr < round_page(watch->hiaddr))) found = watch; @@ -267,11 +267,11 @@ db_find_watchpoint(vm_map_t map, db_addr_t addr, db_regs_t regs) */ if (found) { - db_watchpoints_inserted = FALSE; + db_watchpoints_inserted = false; db_single_step(regs); } - return (FALSE); + return (false); } #endif diff --git a/sys/ddb/db_write_cmd.c b/sys/ddb/db_write_cmd.c index 5cd5c9522948..1423b9f44d40 100644 --- a/sys/ddb/db_write_cmd.c +++ b/sys/ddb/db_write_cmd.c @@ -52,7 +52,7 @@ db_write_cmd(db_expr_t address, boolean_t have_addr, db_expr_t count, db_expr_t old_value; db_expr_t new_value; register int size; - boolean_t wrote_one = FALSE; + boolean_t wrote_one = false; addr = (db_addr_t) address; @@ -73,13 +73,13 @@ 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, false); db_printsym(addr, DB_STGY_ANY); db_printf("\t\t%#8lr\t=\t%#8lr\n", (long)old_value,(long)new_value); db_put_value(addr, size, new_value); addr += size; - wrote_one = TRUE; + wrote_one = true; } if (!wrote_one)