foss-for-synopsys-dwc-arc-processors/gdb — pull request #10 by anthony-kolesov (2013-10-07 14:13:50+00:00)
Title: ARC: Resolve GDB crash if branch target has an invalid address

In arc_linux_software_single_step remove first breakpoint in case second
insertion fails. This resolves a GDB internal error and crash. This usually
indicates problem with code itself, GDB just has to handle this gracefully.
Without this patch GDB after second insertion fails was left with first
breakpoint still active. If user would try to single step again, then GDB
would insert first breakpoint one more time but would think that it is a
_second_ breakpoint. So when there would be an attempt to insert actual
second breakpoint assertion in GDB would fail, as from its point of view it
is _third_ breakpoint, and only two are supported. This patch ensures that
GDB will not be left in a inconsistent state due to this problem.

Signed-off-by: Anton Kolesov