[Bug breakpoints/14145] New: BranchDest at arm-tdep.c overflowed

manjian2006 at gmail dot com sourceware-bugzilla@sourceware.org
Wed May 23 13:53:00 GMT 2012


http://sourceware.org/bugzilla/show_bug.cgi?id=14145

             Bug #: 14145
           Summary: BranchDest at arm-tdep.c overflowed
           Product: gdb
           Version: 7.4
            Status: NEW
          Severity: critical
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned@sourceware.org
        ReportedBy: manjian2006@gmail.com
    Classification: Unclassified


BranchDest was intended to find the branch address from the instruction
provided.But its define:

#define BranchDest(addr,instr) \
  ((CORE_ADDR) (((long) (addr)) + 8 + (sbits (instr, 0, 23) << 2)))
tried to convert the 32-bit integer to 64-bit integer without considering the
overflow,which caused the result which has signed bit(e.g 0x859127d4) expanded
its higher bits to 0xffffffff (e.g. 0xffffffff859127d4).

The solution is to fix the define like this

  ((CORE_ADDR) (((CORE_ADDR) (addr)) + 8 + (sbits (instr, 0, 23) << 2)))

This bug might result in failing to execute the "next" command in the machine
which had no hardware debug registers.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Gdb-prs mailing list