aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1997-01-16 11:27:11 +0000
committerBruce Evans <bde@FreeBSD.org>1997-01-16 11:27:11 +0000
commit7d350e72562682a00d90dc5ccf334fed22717839 (patch)
tree76d7df39d7e6b4353f2f4beec302cf6417b8bf8e
parentb449e9a83efd4dc7c9b38254980e731e595926b0 (diff)
Notes
-rw-r--r--sys/amd64/include/db_machdep.h15
-rw-r--r--sys/ddb/db_sym.c10
-rw-r--r--sys/i386/include/db_machdep.h15
3 files changed, 38 insertions, 2 deletions
diff --git a/sys/amd64/include/db_machdep.h b/sys/amd64/include/db_machdep.h
index dae26d79371d8..633f4f3e3bb11 100644
--- a/sys/amd64/include/db_machdep.h
+++ b/sys/amd64/include/db_machdep.h
@@ -73,4 +73,19 @@ extern db_regs_t ddb_regs; /* register state */
#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/ddb/db_sym.c b/sys/ddb/db_sym.c
index 0afa48abe783f..7974825758a27 100644
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -274,7 +274,7 @@ db_symbol_values(sym, namep, valuep)
* then we just print the value in hex. Small values might get
* bogus symbol associations, e.g. 3 might get some absolute
* value like _INCLUDE_VERSION or something, therefore we do
- * not accept symbols whose value is zero (and use plain hex).
+ * not accept symbols whose value is "small" (and use plain hex).
*/
unsigned int db_maxoff = 0x10000;
@@ -293,7 +293,13 @@ db_printsym(off, strategy)
cursym = db_search_symbol(off, strategy, &d);
db_symbol_values(cursym, &name, &value);
- if (name == 0 || d >= db_maxoff || value == 0) {
+ if (name == 0)
+ value = off;
+ if (value >= DB_SMALL_VALUE_MIN && value <= DB_SMALL_VALUE_MAX) {
+ db_printf("%+#n", off);
+ return;
+ }
+ if (name == 0 || d >= db_maxoff) {
db_printf("%#n", off);
return;
}
diff --git a/sys/i386/include/db_machdep.h b/sys/i386/include/db_machdep.h
index dae26d79371d8..633f4f3e3bb11 100644
--- a/sys/i386/include/db_machdep.h
+++ b/sys/i386/include/db_machdep.h
@@ -73,4 +73,19 @@ extern db_regs_t ddb_regs; /* register state */
#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_ */