Author: Armin Rigo <[email protected]>
Branch: reverse-debugger
Changeset: r85211:30bf0d9e0ee7
Date: 2016-06-17 11:32 +0200
http://bitbucket.org/pypy/pypy/changeset/30bf0d9e0ee7/
Log: Add revdb.breakpoint()
diff --git a/rpython/rlib/revdb.py b/rpython/rlib/revdb.py
--- a/rpython/rlib/revdb.py
+++ b/rpython/rlib/revdb.py
@@ -52,6 +52,10 @@
"""
_change_time('f', time_delta, callback, arg_string)
[email protected](0)
+def breakpoint(callback, arg_string):
+ _change_time('k', 1, callback, arg_string)
+
@specialize.arg(1)
def jump_in_time(target_time, callback, arg_string, exact=True):
"""For RPython debug commands: the debugger should run the
diff --git a/rpython/translator/revdb/src-revdb/revdb.c
b/rpython/translator/revdb/src-revdb/revdb.c
--- a/rpython/translator/revdb/src-revdb/revdb.c
+++ b/rpython/translator/revdb/src-revdb/revdb.c
@@ -861,6 +861,19 @@
case 'b': /* go non exact */
cmd_go(time >= 1 ? time : 1, callback, arg, mode);
abort(); /* unreachable */
+
+ case 'k': /* breakpoint */
+ assert(time > 0);
+ if (stopped_time != 0) {
+ fprintf(stderr, "revdb.breakpoint(): cannot be called from a "
+ "debug command\n");
+ exit(1);
+ }
+ rpy_revdb.stop_point_break = rpy_revdb.stop_point_seen + time;
+ invoke_after_forward = callback;
+ invoke_argument = arg;
+ break;
+
default:
abort(); /* unreachable */
}
@@ -892,6 +905,7 @@
RPY_EXTERN
uint64_t rpy_reverse_db_unique_id_break(void *new_object)
{
+ rpy_revdb.unique_id_break = 0;
tracked_object = new_object;
rpy_revdb.stop_point_break = rpy_revdb.stop_point_seen + 1;
return rpy_revdb.unique_id_seen;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit