[commit] Cannot set the PC on mips-irix

Joel Brobecker brobecker@adacore.com
Sat Jan 9 04:59:00 GMT 2010


Any attempt at setting the pc silently fails. I noticed this while
trying to call a function: The inferior would sometimes run away,
or immediately stopped at the current instruction if there was
a breakpoint inserted there.

This can also be seen by:

  . Attempting a "jump" where the same behavior as during a function
    call is observed.
   
  . Or by simply doing a "set $pc = 0xdeadbeeef"; a stepi after
    the assignment shows that we've stepped the insn at the original
    PC value.

I traced the problem down to a confusion between raw and cooked register
numbers.  We were passing a raw register number to irix5-nat.c:fill_gregset,
while the latter was comparing it with the register number returned
by gdbarch_pc_regnum, which happens to return a cooked register number.
     
The fix is to compare the given register number against the raw PC
register number.  This actually makes this part of the code more consistent
with the rest of this function...

gdb/ChangeLog:

        Cannot set the PC on mips-irix.
        * irix5-nat.c (fill_gregset): Check regno against the raw PC
        register number, no the cooked one.

-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Cannot-set-the-PC-on-mips-irix.patch
Type: text/x-diff
Size: 779 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20100109/0570b20a/attachment.bin>


More information about the Gdb-patches mailing list