return gdbarch_breakpoint_kind_from_pc (bl->gdbarch, addr);
}
+#define RETHROW_ON_TARGET_CLOSE_ERROR(E) \
+ do \
+ { \
+ if ((E).reason != 0) \
+ { \
+ /* Can't set the breakpoint. */ \
+ \
+ if ((E).error == TARGET_CLOSE_ERROR) \
+ /* If the target has closed then it will have deleted any \
+ breakpoints inserted within the target inferior, as a \
+ result any further attempts to interact with the \
+ breakpoint objects is not possible. Just rethrow the \
+ error. Don't use E to rethrow, to prevent object \
+ slicing of the exception. */ \
+ throw; \
+ } \
+ } while (0)
+
/* Insert a low-level "breakpoint" of some type. BL is the breakpoint
location. Any error messages are printed to TMP_ERROR_STREAM; and
DISABLED_BREAKS, and HW_BREAKPOINT_ERROR are used to report problems.
}
catch (gdb_exception &e)
{
+ RETHROW_ON_TARGET_CLOSE_ERROR (e);
bp_excpt = std::move (e);
}
}
}
catch (gdb_exception &e)
{
+ RETHROW_ON_TARGET_CLOSE_ERROR (e);
bp_excpt = std::move (e);
}
}
catch (gdb_exception &e)
{
+ RETHROW_ON_TARGET_CLOSE_ERROR (e);
bp_excpt = std::move (e);
}
}
if (bp_excpt.reason != 0)
{
/* Can't set the breakpoint. */
-
- /* If the target has closed then it will have deleted any
- breakpoints inserted within the target inferior, as a result
- any further attempts to interact with the breakpoint objects
- is not possible. Just rethrow the error. */
- if (bp_excpt.error == TARGET_CLOSE_ERROR)
- throw bp_excpt;
gdb_assert (bl->owner != nullptr);
/* In some cases, we might not be able to insert a