Changeset 6510


Ignore:
Timestamp:
May 9, 2007, 8:37:43 AM (15 years ago)
Author:
gb
Message:

lisp register display changes for x86-64.
Get FPU display working on x86-64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/lisp-debug.c

    r6271 r6510  
    383383  fprintf(stderr,"------\n");
    384384  show_lisp_register(xp, "fn", Ifn);
    385   show_lisp_register(xp, "ra0", Ira0);
    386385  fprintf(stderr,"------\n");
    387386  show_lisp_register(xp, "save0", Isave0);
     
    394393  show_lisp_register(xp, "temp2", Itemp2);
    395394  fprintf(stderr,"------\n");
    396   if (tag_of(xpGPR(xp,Itemp2)) == tag_fixnum) {
    397     fprintf(stderr,"%%cx (nargs) = %d (maybe)\n", unbox_fixnum(xpGPR(xp,Itemp2)&0xffff));
     395  if (tag_of(xpGPR(xp,Inargs)) == tag_fixnum) {
     396    fprintf(stderr,"%%cx (nargs) = %d (maybe)\n", unbox_fixnum(xpGPR(xp,Inargs)&0xffff));
    398397  }
    399398#endif
     
    459458}
    460459
    461 unsigned
    462 debug_get_u32_value(char *prompt)
     460natural
     461debug_get_natural_value(char *prompt)
    463462{
    464463  char s[32];
    465464  int n;
    466   unsigned val;
     465  natural val;
    467466
    468467  do {
     
    470469    fprintf(stderr, "\n  %s :", prompt);
    471470    fgets(s, 24, stdin);
    472     n = sscanf(s, "%i", &val);
     471    n = sscanf(s, "%lu", &val);
    473472  } while (n != 1);
    474473  return val;
     
    508507{
    509508  char buf[32];
    510   unsigned val;
     509  natural val;
    511510
    512511  sprintf(buf, "value for GPR %d", arg);
    513   val = debug_get_u32_value(buf);
     512  val = debug_get_natural_value(buf);
    514513  set_xpGPR(xp, arg, val);
    515514  return debug_continue;
     
    585584#ifdef LINUX
    586585  struct _libc_xmmreg * xmmp = &(xp->uc_mcontext.fpregs->_xmm[0]);
     586#endif
     587#ifdef DARWIN
     588  struct xmm {
     589    char fpdata[16];
     590  };
     591  struct xmm *xmmp = (struct xmm *)(xpFPRvector(xp));
     592#endif
     593#ifdef FREEBSD
     594  struct xmmacc *xmmp = xpXMMregs(xp);
     595#endif
    587596  float *sp;
    588597
    589   dp = (double *) sp;
    590   np = (int *) sp;
    591598
    592599  for (i = 0; i < 16; i++, xmmp++) {
     
    594601    dp = (double *) xmmp;
    595602    np = (int *) xmmp;
    596     fprintf(stderr, "f%02d: 0x%08x (%f), 0x%08x%08x (%f)\n", i, *np, (double)(*sp), np[1], np[0], *dp);
    597   }
    598   fprintf(stderr, "mxcsr = 0x%08x\n",xp->uc_mcontext.fpregs->mxcsr);
    599      
    600 #endif
    601 #endif
     603    fprintf(stderr, "f%02d: 0x%08x (%e), 0x%08x%08x (%e)\n", i, *np, (double)(*sp), np[1], np[0], *dp);
     604  }
     605  fprintf(stderr, "mxcsr = 0x%08x\n",
     606#ifdef LINUX
     607          xp->uc_mcontext.fpregs->mxcsr
     608#endif
     609#ifdef DARWIN
     610          xp->uc_mcontext->__fs.__fpu_mxcsr
     611#endif
     612#ifdef FREEBSD
     613          (((struct savefpu *)(&(xp)->uc_mcontext.mc_fpstate))->sv_env.en_mxcsr)
     614#endif
     615          );
     616#endif 
    602617  return debug_continue;
    603618}
Note: See TracChangeset for help on using the changeset viewer.