Date: Mon, 27 Feb 2012 02:36:53 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 206956 for review Message-ID: <201202270236.q1R2ar1Y058420@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@206956?ac=10 Change 206956 by gonzo@gonzo_thinkpad on 2012/02/27 02:36:02 Be less verbose, only complain if request register is not valid Affected files ... .. //depot/projects/dtrace-mips/sys/cddl/dev/dtrace/mips/dtrace_isa.c#2 edit Differences ... ==== //depot/projects/dtrace-mips/sys/cddl/dev/dtrace/mips/dtrace_isa.c#2 (text+ko) ==== @@ -92,11 +92,9 @@ int i; register_t sp, ra, pc; /* XXX: Fix this ugly code */ - uintptr_t args[4]; - int valid[4]; + uintptr_t args[8]; + int valid[8]; - printf("frames: %d, arg: %d\n", aframes, arg); - db_trace_self(); sp = (register_t)(intptr_t)__builtin_frame_address(0); ra = (register_t)(intptr_t)__builtin_return_address(0); @@ -110,16 +108,18 @@ : "r" (ra)); for (i = 0; i <= aframes + 1; i++) { - printf("#%d ---> %p\n", i, (void*)pc); if (next_frame(&pc, &sp, args, valid) < 0) { printf("%s: stack ends at frame #%d\n", __func__, i); return (0); } } - printf("#%d ---> %p\n", i, (void*)pc); - if (arg < 4) - return args[arg]; + if (arg < 8) { + if (valid[arg]) + return (args[arg]); + else + printf("%s: request arg%d is not valid\n", __func__, arg); + } return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202270236.q1R2ar1Y058420>