From 40314588fdac7b80fa6600cd653032493c4503a3 Mon Sep 17 00:00:00 2001 From: bde Date: Thu, 20 Nov 1997 18:24:52 +0000 Subject: Fixed wrong limits for the kernel text in db_numargs(). The interval [VM_MIN_KERNEL_ADDRESS, etext] was used instead of [btext, etext). Added a comment about this being completely wrong for LKMs. This only affects interpreting the instructions after the return to attempt decide the number of args. The attempt usually fails anyway. --- sys/i386/i386/db_trace.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/i386') diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c index d4aaaec..7dec82b 100644 --- a/sys/i386/i386/db_trace.c +++ b/sys/i386/i386/db_trace.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_trace.c,v 1.25 1997/08/21 06:32:37 charnier Exp $ + * $Id: db_trace.c,v 1.26 1997/10/27 17:23:18 bde Exp $ */ #include @@ -97,8 +97,12 @@ db_numargs(fp) int args; argp = (int *)db_get_value((int)&fp->f_retaddr, 4, FALSE); - if (argp < (int *)VM_MIN_KERNEL_ADDRESS || - argp > (int *)etext) { + /* + * XXX etext is wrong for LKMs. We should attempt to interpret + * the instruction at the return address in all cases. This + * may require better fault handling. + */ + if (argp < (int *)btext || argp >= (int *)etext) { args = 5; } else { inst = db_get_value((int)argp, 4, FALSE); -- cgit v1.1