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 119 of file register-dump.h.

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

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


Function Documentation

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

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

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

  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\
fp0-3:   0000030%0000031% 0000032%0000033% 0000034%0000035% 0000036%0000037%\n\
fp4-7:   0000038%0000039% 000003a%000003b% 000003c%000003d% 000003e%000003f%\n\
fp8-11:  0000040%0000041% 0000042%0000043% 0000044%0000045% 0000046%0000047%\n\
fp12-15: 0000048%0000049% 000004a%000004b% 000004c%000004d% 000004e%000004f%\n\
fp16-19: 0000050%0000051% 0000052%0000053% 0000054%0000055% 0000056%0000057%\n\
fp20-23: 0000058%0000059% 000005a%000005b% 000005c%000005d% 000005e%000005f%\n\
fp24-27: 0000060%0000061% 0000062%0000063% 0000064%0000065% 0000066%0000067%\n\
fp28-31: 0000068%0000069% 000006a%000006b% 000006c%000006d% 000006e%000006f%\n\
r0 =0000002% sp =0000003% r2 =0000004% r3 =0000005%\n\
r4 =0000006% r5 =0000007% r6 =0000008% r7 =0000009%   sr0=0000000% sr1=0000001%\n\
r8 =000000a% r9 =000000b% r10=000000c% r11=000000d%    cr=0000022% xer=0000023%\n\
r12=000000e% r13=000000f% r14=0000010% r15=0000011%    lr=0000024% ctr=0000025%\n\
r16=0000012% r17=0000013% r18=0000014% r19=0000015%    mq=0000026% fcr=0000071%\n\
r20=0000016% r21=0000017% r22=0000018% r23=0000019%   dar=0000028% dsi=0000029%\n\
r24=000001a% r25=000001b% r26=000001c% r27=000001d%   exc=000002a%\n\
r28=000001e% r29=000001f% r30=0000020% r31=0000021%\n\
"

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