- /* Re-install the breakpoint if possible. */
- if ((char *)*os_context_pc_addr(context) ==
- (char *)single_stepping + 1) {
- fprintf(stderr, "warning: couldn't reinstall breakpoint\n");
- } else {
- *((char *)single_stepping) = BREAKPOINT_INST; /* x86 INT3 */
- *((char *)single_stepping+1) = trap_Breakpoint;
- }
+ /* Re-install the breakpoint if possible. */
+ if (((char *)*os_context_pc_addr(context) >
+ (char *)single_stepping) &&
+ ((char *)*os_context_pc_addr(context) <=
+ (char *)single_stepping + BREAKPOINT_WIDTH)) {
+ fprintf(stderr, "warning: couldn't reinstall breakpoint\n");
+ } else {
+ arch_install_breakpoint(single_stepping);
+ }
+
+ single_stepping = NULL;
+ return;
+}
+
+void
+sigtrap_handler(int signal, siginfo_t *info, os_context_t *context)
+{
+ unsigned int trap;