Re: [PATCH] Fix that different function breakpoints are set@same pc address (PR gdb/12703)

Ulrich Weigand
2011-10-10T14:47:06Z

Yao Qi wrote:

> gdb/
> * arm-tdep.c (thumb_analyze_prologue): Check condition for 32-bit
> Thumb-2 instructions.

Huh. That check is indeed wrong.

> - else if ((insn & 0xe000) == 0xe000)
> + else if ((insn & 0xe000) == 0xe000 && (insn & 0x1800) != 0)
> {

Instead of open-coding the check, I think it would be preferable to
use the thumb_insn_size routine instead.

Note that there are a number of other places that either already open-
code the correct check, or -worse- use the same incorrect check as the
code above:

- thumb_in_function_epilogue_p
- thumb_get_next_pc_raw
- arm_breakpoint_from_pc

Would you mind converting them all to thumb_insn_size?

Thanks,
Ulrich

--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com