Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146245324
D6907.id17836.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6907.id17836.diff
View Options
Index: sys/mips/mips/db_trace.c
===================================================================
--- sys/mips/mips/db_trace.c
+++ sys/mips/mips/db_trace.c
@@ -144,6 +144,7 @@
unsigned instr, mask;
unsigned int frames = 0;
int more, stksize, j;
+ register_t next_ra;
/* Jump here when done with a frame, to start a new one */
loop:
@@ -155,6 +156,7 @@
valid_args[1] = 0;
valid_args[2] = 0;
valid_args[3] = 0;
+ next_ra = 0;
/* Jump here after a nonstandard (interrupt handler) frame */
stksize = 0;
subr = 0;
@@ -288,9 +290,17 @@
/* look for saved registers on the stack */
if (i.IType.rs != 29)
break;
- /* only restore the first one */
- if (mask & (1 << i.IType.rt))
+ /*
+ * only restore the first one except RA for
+ * MipsKernGenException case
+ */
+ if (mask & (1 << i.IType.rt)) {
+ if(subr == (uintptr_t)MipsKernGenException &&
+ i.IType.rt == 31)
+ next_ra = kdbpeek((int *)(sp +
+ (short)i.IType.imm));
break;
+ }
mask |= (1 << i.IType.rt);
switch (i.IType.rt) {
case 4:/* a0 */
@@ -374,7 +384,10 @@
(*printfn)("?");
}
- (*printfn) (") ra %jx sp %jx sz %d\n", ra, sp, stksize);
+ (*printfn) (") ra %jx sp %jx sz %d\n",
+ (uintmax_t)(u_register_t) ra,
+ (uintmax_t)(u_register_t) sp,
+ stksize);
if (ra) {
if (pc == ra && stksize == 0)
@@ -382,7 +395,7 @@
else {
pc = ra;
sp += stksize;
- ra = 0;
+ ra = next_ra;
goto loop;
}
} else {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 2, 2:06 AM (9 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29135210
Default Alt Text
D6907.id17836.diff (1 KB)
Attached To
Mode
D6907: [MIPS/DDB] (fix) backtrace: incorrect MIPS32 reg values & truncated backtrace on MipsKernGenException inside short function
Attached
Detach File
Event Timeline
Log In to Comment