summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-11-30 12:01:14 +1100
committer Vas Crabb <vas@vastheman.com>2020-11-30 12:01:14 +1100
commit1bdf8d272a32d161e11c96984bf3614de3210003 (patch)
treeaca314836043ffb5303de52ceaba860bf0860133 /plugins
parentf3454cee2f5fbfff068f53c3716ba187ea4b1492 (diff)
frontend: Lua engine improvements.
Added methods for enabling and disabling breakpoints and watchpoints, and made debugger views update when breakpoints/watchpoints are manipulated from Lua. Made breakpoints and watchpoints objects rather than tables. (It’s not possible to enable/disable a breakpoint or watchpoint from the object itself, you have to go through its owners' debug interface.) Exposed more device_t members for dealing with child/sibling tags and devices. Also provided a way to get regions/shares/banks from a device using relative tags rather than going through the memory manager with absolute tags.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/cheatfind/init.lua4
-rw-r--r--plugins/gdbstub/init.lua8
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua
index 729aed26cb0..83e00e4d51a 100644
--- a/plugins/cheatfind/init.lua
+++ b/plugins/cheatfind/init.lua
@@ -31,7 +31,7 @@ function cheatfind.startplugin()
function cheat.getram()
local ram = {}
for tag, device in pairs(manager:machine().devices) do
- if device:shortname() == "ram" then
+ if device.shortname == "ram" then
ram[tag] = {}
ram[tag].dev = device
ram[tag].size = emu.item(device.items["0/m_size"]):read(0)
@@ -56,7 +56,7 @@ function cheatfind.startplugin()
data.shift = space.shift
end
if getmetatable(space).__name:match("device_t") then
- if space:shortname() == "ram" then
+ if space.shortname == "ram" then
data.block = emu.item(space.items["0/m_pointer"]):read_block(start, size)
if not data.block then
return nil
diff --git a/plugins/gdbstub/init.lua b/plugins/gdbstub/init.lua
index e34b0dcfb5d..f2292bc0027 100644
--- a/plugins/gdbstub/init.lua
+++ b/plugins/gdbstub/init.lua
@@ -45,8 +45,8 @@ function gdbstub.startplugin()
if not cpu then
print("gdbstub: maincpu not found")
end
- if not regmaps[cpu:shortname()] then
- print("gdbstub: no register map for cpu " .. cpu:shortname())
+ if not regmaps[cpu.shortname] then
+ print("gdbstub: no register map for cpu " .. cpu.shortname)
cpu = nil
end
consolelog = debugger.consolelog
@@ -98,7 +98,7 @@ function gdbstub.startplugin()
consolelast = #consolelog
if #consolelog > last and msg:find("Stopped at", 1, true) then
local point = tonumber(msg:match("Stopped at breakpoint ([0-9]+)"))
- local map = regmaps[cpu:shortname()]
+ local map = regmaps[cpu.shortname]
running = false
if not point then
point = tonumber(msg:match("Stopped at watchpoint ([0-9]+"))
@@ -152,7 +152,7 @@ function gdbstub.startplugin()
if packet then
packet:gsub("}(.)", function(s) return string.char(string.byte(s) ~ 0x20) end)
local cmd = packet:sub(1, 1)
- local map = regmaps[cpu:shortname()]
+ local map = regmaps[cpu.shortname]
if cmd == "g" then
local regs = {}
for reg, idx in pairs(map.togdb) do