Introduce breakpoint_get_return_bp

- This should be used for per-breakpoint customization of how return
  breakpoints are constructed.  Hopefully it will be possible to use
  this to implement the address mangling that the ARM backed currently
  has to do.
diff --git a/breakpoints.c b/breakpoints.c
index f0dd5b6..144735c 100644
--- a/breakpoints.c
+++ b/breakpoints.c
@@ -85,6 +85,20 @@
 		(bp->cbs->on_retract)(bp, proc);
 }
 
+int
+breakpoint_get_return_bp(struct breakpoint **ret,
+			 struct breakpoint *bp, struct process *proc)
+{
+	assert(bp != NULL);
+	if (bp->cbs != NULL && bp->cbs->get_return_bp != NULL)
+		return (bp->cbs->get_return_bp)(ret, bp, proc);
+
+	if ((*ret = create_default_return_bp(proc)) == NULL)
+		return -1;
+
+	return 0;
+}
+
 /*****************************************************************************/
 
 struct breakpoint *
@@ -230,6 +244,19 @@
 }
 
 struct breakpoint *
+create_default_return_bp(struct process *proc)
+{
+	struct breakpoint *bp = malloc(sizeof *bp);
+	arch_addr_t return_addr = get_return_addr(proc, proc->stack_pointer);
+	if (return_addr == 0 || bp == NULL
+	    || breakpoint_init(bp, proc, return_addr, NULL) < 0) {
+		free(bp);
+		return NULL;
+	}
+	return bp;
+}
+
+struct breakpoint *
 insert_breakpoint_at(struct process *proc, arch_addr_t addr,
 		     struct library_symbol *libsym)
 {