diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-16 16:59:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-16 16:59:01 -0700 |
commit | b5a859dd2188e51abdbbbcb68af1a299605f92dd (patch) | |
tree | 85deb615a36b96ccc1173cd126afd0e8fd8a3e30 | |
parent | 0e3992bb2c96fea651067698572f855949ebe6f5 (diff) | |
download | txr-b5a859dd2188e51abdbbbcb68af1a299605f92dd.tar.gz txr-b5a859dd2188e51abdbbbcb68af1a299605f92dd.tar.bz2 txr-b5a859dd2188e51abdbbbcb68af1a299605f92dd.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.
-rw-r--r-- | lib.c | 13 | ||||
-rw-r--r-- | lib.h | 1 |
2 files changed, 14 insertions, 0 deletions
@@ -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); +} @@ -1217,6 +1217,7 @@ int compat_fixup(int compat_ver); void dump(val obj, val stream); void d(val obj); void breakpt(void); +void dis(val obj); #define nil convert(obj_t *, 0) |