Hallo Pete:

I don't know much about gdbserver, but I thought I'd just build it anyway. Some constants are missing in your toolchain though.

File GNUSRC/gdb-7.2/gdb/gdbserver/linux-or32-low.c uses register names like PT_GPR3:

  /*!Provide the ptrace "address" of a register.

This must be in GDB order (r0-r1, ppc, npc, sr) to ptrace offset. As with regs_or32, we substitute r31 for r0 and NPC for PPC. */ /* -------------------------------------------------------------------------- */
  static int or32_regmap[] = {
    PT_GPR31, PT_SP,    PT_GPR2,  PT_GPR3,
    PT_GPR4,  PT_GPR5,  PT_GPR6,  PT_GPR7,
    PT_GPR8,  PT_GPR9,  PT_GPR10, PT_GPR11,
    PT_GPR12, PT_GPR13, PT_GPR14, PT_GPR15,
    PT_GPR16, PT_GPR17, PT_GPR18, PT_GPR19,
    PT_GPR20, PT_GPR21, PT_GPR22, PT_GPR23,
    PT_GPR24, PT_GPR25, PT_GPR26, PT_GPR27,
    PT_GPR28, PT_GPR29, PT_GPR30, PT_GPR31,
    PT_PC,    PT_PC,    PT_SR
  };


File asm/ptrace.h from Jonas Bonn's Linux does define those constants:

  /*
   * Offsets used by 'ptrace' system call interface.
   */
  #define PT_SR         0
  #define PT_SP         4
  #define PT_GPR2       8
  #define PT_GPR3       12
  #define PT_GPR4       16
  #define PT_GPR5       20
  #define PT_GPR6       24
  #define PT_GPR7       28
  #define PT_GPR8       32
  #define PT_GPR9       36
  #define PT_GPR10      40
  #define PT_GPR11      44
  #define PT_GPR12      48
  #define PT_GPR13      52
  #define PT_GPR14      56
  #define PT_GPR15      60
  #define PT_GPR16      64
  #define PT_GPR17      68
  #define PT_GPR18      72
  #define PT_GPR19      76
  #define PT_GPR20      80
  #define PT_GPR21      84
  #define PT_GPR22      88
  #define PT_GPR23      92
  #define PT_GPR24      96
  #define PT_GPR25      100
  #define PT_GPR26      104
  #define PT_GPR27      108
  #define PT_GPR28      112
  #define PT_GPR29      116
  #define PT_GPR30      120
  #define PT_GPR31      124
  #define PT_PC       128
  #define PT_ORIG_GPR11 132
  #define PT_SYSCALLNO  136


However, your asm/ptrace.h does not define them.

The question is, is it safe to define those constants locally, or are those indexes different in your Linux Kernel version?

Thanks in advance,
  rdiez
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to