Back to index

glibc  2.9
Defines | Functions | Variables
register-dump.h File Reference
#include <sys/uio.h>
#include <stdio-common/_itoa.h>

Go to the source code of this file.

Defines

#define xtoi(x)   (x >= 'a' ? x + 10 - 'a' : x - '0')
#define REGISTER_DUMP   register_dump (fd, ctx)

Functions

static void register_dump (int fd, struct sigcontext *ctx)

Variables

static const char dumpform []

Define Documentation

#define REGISTER_DUMP   register_dump (fd, ctx)

Definition at line 124 of file register-dump.h.

#define xtoi (   x)    (x >= 'a' ? x + 10 - 'a' : x - '0')

Definition at line 99 of file register-dump.h.


Function Documentation

static void register_dump ( int  fd,
struct sigcontext ctx 
) [static]

Definition at line 102 of file register-dump.h.

{
  char buffer[sizeof(dumpform)];
  char *bufferpos;
  unsigned regno;
  unsigned long *regs = (unsigned long *)(ctx->regs);

  memcpy(buffer, dumpform, sizeof(dumpform));

  /* Generate the output.  */
  while ((bufferpos = memchr (buffer, '%', sizeof(dumpform))))
    {
      regno = xtoi (bufferpos[-1]) | xtoi (bufferpos[-2]) << 4;
      memset (bufferpos-2, '0', 3);
      _itoa_word (regs[regno], bufferpos+1, 16, 0);
    }

  /* Write the output.  */
  write (fd, buffer, sizeof(buffer) - 1);
}

Here is the call graph for this function:


Variable Documentation

const char dumpform[] [static]
Initial value:
"\
Register dump:\n\
sr0=000000000000020% sr1=000000000000021% dar=000000000000029% dsi=000002a%\n\
lr=000000000000024%  ctr=000000000000023% gr3*=000000000000022% trap=0000028%\n\
ccr=0000026%  xer=0000025%\n\
gr0-3:   000000000000000% 000000000000001% 000000000000002% 000000000000003%\n\
gr4-7:   000000000000004% 000000000000005% 000000000000006% 000000000000007%\n\
gr8-11:  000000000000008% 000000000000009% 00000000000000a% 00000000000000b%\n\
gr12-15: 00000000000000c% 00000000000000d% 00000000000000e% 00000000000000f%\n\
gr16-19: 000000000000010% 000000000000011% 000000000000012% 000000000000013%\n\
gr20-23: 000000000000014% 000000000000015% 000000000000016% 000000000000017%\n\
gr24-27: 000000000000018% 000000000000019% 00000000000001a% 00000000000001b%\n\
gr28-31: 00000000000001c% 00000000000001d% 00000000000001e% 00000000000001f%\n\
fscr=000000000000050%\n\
fp0-3:   000000000000030% 000000000000031% 000000000000032% 000000000000033%\n\
fp4-7:   000000000000034% 000000000000035% 000000000000036% 000000000000037%\n\
fp8-11:  000000000000038% 000000000000038% 00000000000003a% 00000000000003b%\n\
fp12-15: 00000000000003c% 00000000000003d% 00000000000003e% 00000000000003f%\n\
fp16-19: 000000000000040% 000000000000041% 000000000000042% 000000000000043%\n\
fp20-23: 000000000000044% 000000000000045% 000000000000046% 000000000000047%\n\
fp24-27: 000000000000048% 000000000000049% 00000000000004a% 00000000000004b%\n\
fp28-31: 00000000000004c% 00000000000004d% 00000000000004e% 00000000000004f%\n\
"

Definition at line 24 of file register-dump.h.