PERFORCE change 207063 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Wed Feb 29 02:32:51 UTC 2012
http://p4web.freebsd.org/@@207063?ac=10
Change 207063 by gonzo at gonzo_thinkpad on 2012/02/29 02:32:40
- Remove output from backtrace function
- Let args/validargs be optional
Affected files ...
.. //depot/projects/dtrace-mips/sys/mips/mips/backtrace.c#3 edit
Differences ...
==== //depot/projects/dtrace-mips/sys/mips/mips/backtrace.c#3 (text+ko) ====
@@ -76,24 +76,25 @@
unsigned int frames = 0;
int more, stksize;
register_t ra = 0;
- int arg;
+ int arg, r;
/*
* Invalidate arguments values
*/
- valid_args[0] = 0;
- valid_args[1] = 0;
- valid_args[2] = 0;
- valid_args[3] = 0;
-/* Jump here after a nonstandard (interrupt handler) frame */
+ if (valid_args) {
+ for (r = 0; r < 8; r++)
+ valid_args[r] = 0;
+ }
+
+ /* Jump here after a nonstandard (interrupt handler) frame */
stksize = 0;
if (frames++ > 100) {
/* return breaks stackframe-size heuristics with gcc -O2 */
goto error; /* XXX */
}
+
/* check for bad SP: could foul up next frame */
if (!MIPS_IS_VALID_KERNELADDR(*sp)) {
- printf("SP 0x%jx: not in kernel\n", *sp);
goto error;
}
#define Between(x, y, z) \
@@ -103,9 +104,9 @@
/* check for bad PC */
if (!MIPS_IS_VALID_KERNELADDR(*pc)) {
- printf("PC 0x%jx: not in kernel\n", *pc);
goto error;
}
+
/*
* Find the beginning of the current subroutine by scanning
* backwards from the current PC for the end of the previous
@@ -231,8 +232,10 @@
case 11:/* a7 */
#endif
arg = i.IType.rt - 4;
- args[arg] = kdbpeekd((int *)(*sp + (short)i.IType.imm));
- valid_args[arg] = 1;
+ if (args)
+ args[arg] = kdbpeekd((int *)(*sp + (short)i.IType.imm));
+ if (valid_args)
+ valid_args[arg] = 1;
break;
case 31: /* ra */
More information about the p4-projects
mailing list