Changeset 6420 for branches/x8664-call


Ignore:
Timestamp:
May 4, 2007, 2:22:49 PM (13 years ago)
Author:
gb
Message:

No more (distinct) ra0.
Get the FPU printer working on darwin-x8664.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/x8664-call/ccl/lisp-kernel/lisp-debug.c

    r6271 r6420  
    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
    587593  float *sp;
    588594
    589   dp = (double *) sp;
    590   np = (int *) sp;
    591595
    592596  for (i = 0; i < 16; i++, xmmp++) {
     
    594598    dp = (double *) xmmp;
    595599    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
     600    fprintf(stderr, "f%02d: 0x%08x (%e), 0x%08x%08x (%e)\n", i, *np, (double)(*sp), np[1], np[0], *dp);
     601  }
     602  fprintf(stderr, "mxcsr = 0x%08x\n",
     603#ifdef LINUX
     604          xp->uc_mcontext.fpregs->mxcsr
     605#endif
     606#ifdef DARWIN
     607          xp->uc_mcontext->__fs.__fpu_mxcsr
     608#endif
     609          );
     610#endif 
    602611  return debug_continue;
    603612}
Note: See TracChangeset for help on using the changeset viewer.