git: ba675bb94870 - main - riscv: Don't print zero offsets for register addresses
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 05 Sep 2023 16:12:51 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=ba675bb94870fcb1a07018920433e9468003364c
commit ba675bb94870fcb1a07018920433e9468003364c
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-09-05 16:12:27 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-09-05 16:12:27 +0000
riscv: Don't print zero offsets for register addresses
This matches the behavior of db_printsym.
Reviewed by: mhorne, markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D41702
---
sys/riscv/riscv/trap.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c
index e454beeb5245..bde402c1cc16 100644
--- a/sys/riscv/riscv/trap.c
+++ b/sys/riscv/riscv/trap.c
@@ -149,7 +149,10 @@ print_with_symbol(const char *name, uint64_t value)
sym = db_search_symbol(value, DB_STGY_ANY, &offset);
if (sym != C_DB_SYM_NULL) {
db_symbol_values(sym, &sym_name, &sym_value);
- printf(" (%s + 0x%lx)", sym_name, offset);
+ if (offset != 0)
+ printf(" (%s + 0x%lx)", sym_name, offset);
+ else
+ printf(" (%s)", sym_name);
}
}
#endif