diff --git a/sys/amd64/include/db_machdep.h b/sys/amd64/include/db_machdep.h index dbba94773ab..ed49c261299 100644 --- a/sys/amd64/include/db_machdep.h +++ b/sys/amd64/include/db_machdep.h @@ -81,19 +81,4 @@ do { \ #define inst_load(ins) 0 #define inst_store(ins) 0 -/* - * There no interesting addresses below _kstack = 0xefbfe000. There - * are small absolute values for GUPROF, but we don't want to see them. - * Treat "negative" addresses below _kstack as non-small to allow for - * future reductions of _kstack and to avoid sign extension problems. - * - * There is one interesting symbol above -db_maxoff = 0xffff0000, - * namely _APTD = 0xfffff000. Accepting this would mess up the - * printing of small negative offsets. The next largest symbol is - * _APTmap = 0xffc00000. Accepting this is OK (unless db_maxoff is - * set to >= 0x400000 - (max stack offset)). - */ -#define DB_SMALL_VALUE_MAX 0x7fffffff -#define DB_SMALL_VALUE_MIN (-0x400001) - #endif /* !_MACHINE_DB_MACHDEP_H_ */ diff --git a/sys/arm/include/db_machdep.h b/sys/arm/include/db_machdep.h index e741ce055bc..19e3ee0a905 100644 --- a/sys/arm/include/db_machdep.h +++ b/sys/arm/include/db_machdep.h @@ -89,9 +89,6 @@ typedef int db_expr_t; #define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + INSN_SIZE)) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 32 int db_validate_address(vm_offset_t); diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h index b2492560b53..45d548c750b 100644 --- a/sys/arm64/include/db_machdep.h +++ b/sys/arm64/include/db_machdep.h @@ -118,9 +118,6 @@ typedef long db_expr_t; #define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + 4)) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 64 #endif /* !_MACHINE_DB_MACHDEP_H_ */ diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index 12e98b112db..c21445c520b 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -432,19 +432,16 @@ db_printsym(db_expr_t off, db_strategy_t strategy) db_expr_t d; char *filename; const char *name; - db_expr_t value; int linenum; c_db_sym_t cursym; - cursym = db_search_symbol(off, strategy, &d); - db_symbol_values(cursym, &name, &value); - if (name == NULL) - value = off; - if (value >= DB_SMALL_VALUE_MIN && value <= DB_SMALL_VALUE_MAX) { + if (off < 0 && off >= -db_maxoff) { db_printf("%+#lr", (long)off); return; } - if (name == NULL || d >= (unsigned long)db_maxoff) { + cursym = db_search_symbol(off, strategy, &d); + db_symbol_values(cursym, &name, NULL); + if (name == NULL || d >= (db_addr_t)db_maxoff) { db_printf("%#lr", (unsigned long)off); return; } diff --git a/sys/i386/include/db_machdep.h b/sys/i386/include/db_machdep.h index e8d1d8eab95..76c0cdce875 100644 --- a/sys/i386/include/db_machdep.h +++ b/sys/i386/include/db_machdep.h @@ -83,21 +83,6 @@ do { \ #define inst_load(ins) 0 #define inst_store(ins) 0 -/* - * There no interesting addresses below _kstack = 0xefbfe000. There - * are small absolute values for GUPROF, but we don't want to see them. - * Treat "negative" addresses below _kstack as non-small to allow for - * future reductions of _kstack and to avoid sign extension problems. - * - * There is one interesting symbol above -db_maxoff = 0xffff0000, - * namely _APTD = 0xfffff000. Accepting this would mess up the - * printing of small negative offsets. The next largest symbol is - * _APTmap = 0xffc00000. Accepting this is OK (unless db_maxoff is - * set to >= 0x400000 - (max stack offset)). - */ -#define DB_SMALL_VALUE_MAX 0x7fffffff -#define DB_SMALL_VALUE_MIN (-0x400001) - int db_segsize(struct trapframe *tfp); #endif /* !_MACHINE_DB_MACHDEP_H_ */ diff --git a/sys/mips/include/db_machdep.h b/sys/mips/include/db_machdep.h index e6e6b50ce16..755dfc61ae1 100644 --- a/sys/mips/include/db_machdep.h +++ b/sys/mips/include/db_machdep.h @@ -87,9 +87,6 @@ db_addr_t next_instr_address(db_addr_t, boolean_t); #define inst_load(i) (db_inst_type(i) == IT_LOAD) #define inst_store(i) (db_inst_type(i) == IT_STORE) -#define DB_SMALL_VALUE_MAX 0x7fffffff -#define DB_SMALL_VALUE_MIN (-0x400001) - int db_inst_type(int); db_addr_t branch_taken(int inst, db_addr_t pc); int32_t kdbpeek(int *); diff --git a/sys/powerpc/include/db_machdep.h b/sys/powerpc/include/db_machdep.h index 6d6638a28f5..29999b53020 100644 --- a/sys/powerpc/include/db_machdep.h +++ b/sys/powerpc/include/db_machdep.h @@ -87,7 +87,4 @@ typedef intptr_t db_expr_t; /* expression - signed */ #define inst_load(ins) 0 #define inst_store(ins) 0 -#define DB_SMALL_VALUE_MAX (KERNBASE-1) -#define DB_SMALL_VALUE_MIN (-0x40001) - #endif /* _POWERPC_DB_MACHDEP_H_ */ diff --git a/sys/riscv/include/db_machdep.h b/sys/riscv/include/db_machdep.h index 21550e4d574..acbfa676c29 100644 --- a/sys/riscv/include/db_machdep.h +++ b/sys/riscv/include/db_machdep.h @@ -83,9 +83,6 @@ typedef long db_expr_t; #define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + 4)) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 64 #endif /* !_MACHINE_DB_MACHDEP_H_ */ diff --git a/sys/sparc64/include/db_machdep.h b/sys/sparc64/include/db_machdep.h index 439df3699df..d8f22c15b78 100644 --- a/sys/sparc64/include/db_machdep.h +++ b/sys/sparc64/include/db_machdep.h @@ -61,9 +61,6 @@ typedef long db_expr_t; #define inst_load(ins) (0) #define inst_store(ins) (0) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 64 #endif /* !_MACHINE_DB_MACHDEP_H_ */