aboutsummaryrefslogtreecommitdiff
path: root/pk/console.c
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2015-11-12 17:18:48 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2015-11-12 17:48:48 -0800
commit9cc6732d806b4a7e4842528606fa1390e7ab0a90 (patch)
tree634de3e94b0c52f5822c3d96dabe4ff2443aa90c /pk/console.c
parentfa1b72958119abad2c6e1659ab6db914bf30059f (diff)
downloadriscv-pk-9cc6732d806b4a7e4842528606fa1390e7ab0a90.zip
riscv-pk-9cc6732d806b4a7e4842528606fa1390e7ab0a90.tar.gz
riscv-pk-9cc6732d806b4a7e4842528606fa1390e7ab0a90.tar.bz2
print PC of failed assertions
Diffstat (limited to 'pk/console.c')
-rw-r--r--pk/console.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pk/console.c b/pk/console.c
index 3920a51..5808d77 100644
--- a/pk/console.c
+++ b/pk/console.c
@@ -145,5 +145,6 @@ void do_panic(const char* s, ...)
void kassert_fail(const char* s)
{
- do_panic("assertion failed: %s\n", s);
+ register uintptr_t ra asm ("ra");
+ do_panic("assertion failed @ %p: %s\n", ra, s);
}