diff options
author | 2023-04-07 06:20:40 +1000 | |
---|---|---|
committer | 2023-04-07 06:20:40 +1000 | |
commit | b67b969bf0911d71396c77e42d85ddfe80de6f20 (patch) | |
tree | 8d964eac6e0c4c849dc2b9b0b3742154c6c943d4 /plugins/gdbstub/init.lua | |
parent | c4282fecede9032be78028e8fde737d44bf2b7c6 (diff) |
-Improved some Lua APIs:
* Moved several machine lifecycle callbacks to the notifier/subscriber
model. The old callback registration model is still available for
them for now, but prints a deprecation warning.
* Added pre-save/post-load notifications.
* Use a single allocated timer rather than one anonymous timer per
waiter. Waiters no longer prevent saved states from being loaded.
* Clean up outstanding waiters on stop or state load rather than just
leaking them.
* Started documenting parts of the emulator interface object that should
be relatively stable.
-imagedev/avivideo.cpp: Fixed an object leak on unload. Also changed
some other media image devices to use smart pointers.
Diffstat (limited to 'plugins/gdbstub/init.lua')
-rw-r--r-- | plugins/gdbstub/init.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/gdbstub/init.lua b/plugins/gdbstub/init.lua index 8a28a68d8cc..1d358518965 100644 --- a/plugins/gdbstub/init.lua +++ b/plugins/gdbstub/init.lua @@ -1,11 +1,11 @@ -- license:BSD-3-Clause -- copyright-holders: Carl -local exports = {} -exports.name = "gdbstub" -exports.version = "0.0.1" -exports.description = "GDB stub plugin" -exports.license = "BSD-3-Clause" -exports.author = { name = "Carl" } +local exports = { + name = "gdbstub", + version = "0.0.1", + description = "GDB stub plugin", + license = "BSD-3-Clause", + author = { name = "Carl" } } local gdbstub = exports @@ -25,6 +25,8 @@ local regmaps = { regmaps.i486 = regmaps.i386 regmaps.pentium = regmaps.i386 +local reset_subscription, stop_subscription + function gdbstub.startplugin() local debugger local debug @@ -35,7 +37,7 @@ function gdbstub.startplugin() local consolelast local running - emu.register_start(function () + reset_subscription = emu.add_machine_reset_notifier(function () debugger = manager.machine.debugger if not debugger then print("gdbstub: debugger not enabled") @@ -56,7 +58,7 @@ function gdbstub.startplugin() running = false end) - emu.register_stop(function() + stop_subscription = emu.add_machine_stop_notifier(function () consolelog = nil cpu = nil debug = nil |