summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/gdbstub/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/gdbstub/init.lua')
-rw-r--r--plugins/gdbstub/init.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/gdbstub/init.lua b/plugins/gdbstub/init.lua
index f7d4ceee6ba..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 = "The BSD 3-Clause License"
-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