Fixed printing of small offsets. E.g., -4(%ebp) is now printed

as -0x4(%ebp) instead of as _APTD+0xffc(%ebp), and if GUPROF is
defined, 8(%ebp) is now printed as 0x8(%ebp) instead of as
GMON_PROF_HIRES+0x4(%ebp).
This commit is contained in:
Bruce Evans 1997-01-16 11:27:11 +00:00
parent b449e9a83e
commit 7d350e7256
3 changed files with 38 additions and 2 deletions

View file

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

View file

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

View file

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