Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86_64/x86_64 No sense in trying to print arguments...



details:   https://anonhg.NetBSD.org/src/rev/3cbfd81fe728
branches:  trunk
changeset: 539947:3cbfd81fe728
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Fri Nov 29 22:46:26 2002 +0000

description:
No sense in trying to print arguments to functions, we can't reliably
determine them as they're passed in registers. The first 6, anyway,
but only printing arguments 7 and up (if present) makes no sense.

diffstat:

 sys/arch/x86_64/x86_64/db_trace.c |  26 ++++++--------------------
 1 files changed, 6 insertions(+), 20 deletions(-)

diffs (52 lines):

diff -r 9c592081b9b8 -r 3cbfd81fe728 sys/arch/x86_64/x86_64/db_trace.c
--- a/sys/arch/x86_64/x86_64/db_trace.c Fri Nov 29 22:17:12 2002 +0000
+++ b/sys/arch/x86_64/x86_64/db_trace.c Fri Nov 29 22:46:26 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_trace.c,v 1.1 2002/11/29 22:17:17 fvdl Exp $        */
+/*     $NetBSD: db_trace.c,v 1.2 2002/11/29 22:46:26 fvdl Exp $        */
 
 /* 
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.1 2002/11/29 22:17:17 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.2 2002/11/29 22:46:26 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -115,29 +115,15 @@
 
 /*
  * Figure out how many arguments were passed into the frame at "fp".
+ * We can probably figure out how many arguments where passed above
+ * the first 6 (which are in registers), but since we can't
+ * reliably determine the values currently, just return 0.
  */
 int
 db_numargs(fp)
        struct x86_64_frame *fp;
 {
-       long    *argp;
-       int     inst;
-       int     args;
-       extern char     etext[];
-
-       argp = (long *)db_get_value((db_addr_t)&fp->f_retaddr, 8, FALSE);
-       if (argp < (long *)VM_MIN_KERNEL_ADDRESS || argp > (long *)etext) {
-               args = 5;
-       } else {
-               inst = db_get_value((db_addr_t)argp, 4, FALSE);
-               if ((inst & 0xff) == 0x59)      /* popl %ecx */
-                       args = 1;
-               else if ((inst & 0xffff) == 0xc483)     /* addl %n, %esp */
-                       args = ((inst >> 16) & 0xff) / 8;
-               else
-                       args = 5;
-       }
-       return (args);
+       return 0;
 }
 
 /* 



Home | Main Index | Thread Index | Old Index