shithub: riscv

Download patch

ref: dbba80166456ce2797f776646595781d50f0145e
parent: 3504122012e3f7ee778efa048e462510619c13b4
author: Ori Bernstein <[email protected]>
date: Fri Sep 22 19:02:40 EDT 2023

libmach: set errstr if we can't find a SP for a PC

this makes acid errors when you jump off the deep end
a bit less confusing.

--- a/sys/src/libmach/8db.c
+++ b/sys/src/libmach/8db.c
@@ -127,6 +127,8 @@
 		if(++i > 1000)
 			break;
 	}
+	if(i == 0)
+		werrstr("no SP for PC %#llux", pc);
 	return i;
 }
 
--- a/sys/src/libmach/machdata.c
+++ b/sys/src/libmach/machdata.c
@@ -359,6 +359,8 @@
 		if(++i > 40)
 			break;
 	}
+	if(i == 0)
+		werrstr("no SP for PC %#llux", pc);
 	return i;
 }
 
@@ -395,6 +397,8 @@
 		if(++i > 40)
 			break;
 	}
+	if(i == 0)
+		werrstr("no SP for PC %#llux", pc);
 	return i;
 }