This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] New register definition interface


On 5-Jan-2001, Stephane Carrez wrote:

>Do you have any target specific patch/example to use that?

Not that I can release at the moment, but I have tested it with one
architecture so far.

>I would like to have some example to try the memory mapped registers in
>the 68HC11/68HC12 port.

You'll need to use regs_init_mem() instead of regs_init_real().  Here's
the example I posted initially for architecture "foo", modified for
registers memory-mapped contiguously from address 0:

    r0..r31   32-bit data registers, starting at address 0x0
    sp        stack pointer, at address 0x80
    ret       return value register, alias for r0

  static void
  foo_init_regs (struct gdbarch *gdbarch)
  {
    struct regs_init_context *context;
    char name[4];
    int i, parents[2];
    CORE_ADDR mem;

    context = regs_init_start (gdbarch, foo_caller_regs);

    /* General data registers.  */
    for (i = 0, mem = 0x0; i < 32; i++, mem += 4)
      {
        sprintf (name, "r%d", i);
        regs_init_mem (context, name, i, 4, &builtin_type_int32, mem, 0);
      }

    /* Stack pointer.  */
    regs_init_mem (context, "sp", FOO_SP_REGNUM, 4,
                   &builtin_type_CORE_ADDR, 0x80, 0);

    /* Return value.  */
    parents[0] = 0;
    parents[1] = -1;
    regs_init_pseudo (context, "ret", 4, &builtin_type_int32, REGS_HIDEALL,
                      regs_rpseudo_alias, regs_wpseudo_alias, NULL, parents);

    regs_init_finish (context);
  }

>> Since this and the other regcache.c patch are so large and touch such a
>> fundamental piece of GDB, I'll commit them after a 2-day waiting period.

Note that by "them", I meant the two regcache.c patches needed for the big
register interface patch, which still hasn't gotten approved.

>Don't wait too much :-) :-) :-)

:-)  I'll commit it as soon as it gets approved,

Nick

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]