Changeset 11604


Ignore:
Timestamp:
Jan 9, 2009, 8:40:29 AM (11 years ago)
Author:
gb
Message:

Show x86(32) segment register values in debug_show_registers(). TODO:
do this for 64-bit code, too.

File:
1 edited

Legend:

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

    r11596 r11604  
    725725
    726726#ifdef X8632
     727  unsigned short rcs,rds,res,rfs,rgs,rss;
     728#ifdef DARWIN
     729  rcs = xp->uc_mcontext->__ss.__cs;
     730  rds = xp->uc_mcontext->__ss.__ds;
     731  res = xp->uc_mcontext->__ss.__es;
     732  rfs = xp->uc_mcontext->__ss.__fs;
     733  rgs = xp->uc_mcontext->__ss.__gs;
     734  rss = xp->uc_mcontext->__ss.__ss;
     735#define DEBUG_SHOW_X86_SEGMENT_REGISTERS
     736#endif
     737#ifdef LINUX
     738  rcs = xp->uc_mcontext.gregs[REG_CS];
     739  rds = xp->uc_mcontext.gregs[REG_DS];
     740  res = xp->uc_mcontext.gregs[REG_ES];
     741  rfs = xp->uc_mcontext.gregs[REG_FS];
     742  rgs = xp->uc_mcontext.gregs[REG_GS];
     743  rss = xp->uc_mcontext.gregs[REG_SS];
     744#define DEBUG_SHOW_X86_SEGMENT_REGISTERS
     745#endif
     746#ifdef FREEBSD
     747  rcs = xp->uc_mcontext.mc_cs;
     748  rds = xp->uc_mcontext.mc_ds;
     749  res = xp->uc_mcontext.mc_es;
     750  rfs = xp->uc_mcontext.mc_fs;
     751  rgs = xp->uc_mcontext.mc_gs;
     752  rss = xp->uc_mcontext.mc_ss;
     753#define DEBUG_SHOW_X86_SEGMENT_REGISTERS
     754#endif
     755#ifdef SOLARIS
     756  rcs = xp->uc_mcontext.gregs[CS];
     757  rds = xp->uc_mcontext.gregs[DS];
     758  res = xp->uc_mcontext.gregs[ES];
     759  rfs = xp->uc_mcontext.gregs[FS];
     760  rgs = xp->uc_mcontext.gregs[GS];
     761  rss = xp->uc_mcontext.gregs[SS];
     762#define DEBUG_SHOW_X86_SEGMENT_REGISTERS
     763#endif
     764#ifdef WINDOWS
     765  rcs = xp->SegCs;
     766  rds = xp->SegDs;
     767  res = xp->SegEs;
     768  rfs = xp->SegFs;
     769  rgs = xp->SegGs;
     770  rss = xp->SegSs;
     771#define DEBUG_SHOW_X86_SEGMENT_REGISTERS
     772#endif
     773
     774
     775
    727776  fprintf(stderr, "%%eax = 0x" ZLISP "\n", xpGPR(xp, REG_EAX));
    728777  fprintf(stderr, "%%ecx = 0x" ZLISP "\n", xpGPR(xp, REG_ECX));
     
    735784  fprintf(stderr, "%%eip = 0x" ZLISP "\n", xpGPR(xp, REG_EIP));
    736785  fprintf(stderr, "%%eflags = 0x" ZLISP "\n", xpGPR(xp, REG_EFL));
     786#ifdef DEBUG_SHOW_X86_SEGMENT_REGISTERS
     787  fprintf(stderr,"\n");
     788  fprintf(stderr, "%%cs = 0x%04x\n", rcs);
     789  fprintf(stderr, "%%ds = 0x%04x\n", rds);
     790  fprintf(stderr, "%%ss = 0x%04x\n", rss);
     791  fprintf(stderr, "%%es = 0x%04x\n", res);
     792  fprintf(stderr, "%%fs = 0x%04x\n", rfs);
     793  fprintf(stderr, "%%gs = 0x%04x\n", rgs);
     794
     795#endif
     796
    737797#endif
    738798
Note: See TracChangeset for help on using the changeset viewer.