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]
Other format: [Raw text]

[PATCH/RFA] builtin-regs buglet



I think this probably come under obvious, but lets see what others think.

With my new ARM pseudo-registers code, I'm getting an internal error if I 
type

(gdb) p $fp

Why?  Well there's some missing brackets...

	* builtin-regs.c (value_of_builtin_reg): Correctly calculate the
	builtin reg number.


Index: builtin-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/builtin-regs.c,v
retrieving revision 1.1
diff -p -r1.1 builtin-regs.c
*** builtin-regs.c	9 Apr 2002 03:06:13 -0000	1.1
--- builtin-regs.c	13 May 2002 15:59:50 -0000
*************** builtin_reg_map_name_to_regnum (const ch
*** 71,77 ****
  struct value *
  value_of_builtin_reg (int regnum, struct frame_info *frame)
  {
!   int reg = regnum - NUM_REGS + NUM_PSEUDO_REGS;
    gdb_assert (reg >= 0 && reg < nr_builtin_regs);
    return builtin_regs[reg].value (frame);
  }
--- 71,77 ----
  struct value *
  value_of_builtin_reg (int regnum, struct frame_info *frame)
  {
!   int reg = regnum - (NUM_REGS + NUM_PSEUDO_REGS);
    gdb_assert (reg >= 0 && reg < nr_builtin_regs);
    return builtin_regs[reg].value (frame);
  }

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