summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-16 16:59:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-16 16:59:01 -0700
commitcde48c8282110817bafba59869c434444a3c0b6d (patch)
tree85deb615a36b96ccc1173cd126afd0e8fd8a3e30 /lib.c
parente42436bf67ede230612c838b0253276d98b48c72 (diff)
downloadtxr-cde48c8282110817bafba59869c434444a3c0b6d.tar.gz
txr-cde48c8282110817bafba59869c434444a3c0b6d.tar.bz2
txr-cde48c8282110817bafba59869c434444a3c0b6d.zip
debugging: disassemble vm code out of debugger.
* lib.c (dis): New function that we can call from gdb to disassemble a VM function, if we know its address. I've done this manually way too many times. * lib.h (dis): Declared.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index dcf9e870..58b05f0a 100644
--- a/lib.c
+++ b/lib.c
@@ -13098,3 +13098,16 @@ void d(val obj)
void breakpt(void)
{
}
+
+/*
+ * Function for dissembling VM functions
+ * when debugging in gdb.
+ */
+
+void dis(val obj)
+{
+ val sym = intern(lit("disassemble"), user_package);
+ val fun = cdr(if2(sym, lookup_fun(nil, sym)));
+ if (fun)
+ funcall1(fun, obj);
+}