From 7486fe3ce0ee6b449829646e22c8de166bb72df4 Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Sat, 4 Jan 2020 14:06:13 +0100 Subject: -cheat_xml: Attempt at fixing Github issue #6114. Strip the leading colon from device names as necessary in order to avoid doubling of the root colon. [Ryan Holtz, DjDiabolik] --- plugins/cheat/cheat_xml.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/cheat/cheat_xml.lua b/plugins/cheat/cheat_xml.lua index 990e5fe64d8..7f66eb4125b 100644 --- a/plugins/cheat/cheat_xml.lua +++ b/plugins/cheat/cheat_xml.lua @@ -76,7 +76,12 @@ function xml.conv_cheat(data) local function convert_memref(cpu, phys, space, width, addr, rw) -- debug expressions address spaces by index not by name local function get_space_name(index) - return cpu_spaces[":" .. cpu][index] + local prefix = cpu:sub(1,1) + if prefix == ":" then + return cpu_spaces[cpu][index] + else + return cpu_spaces[":" .. cpu][index] + end end local mod = "" @@ -105,6 +110,12 @@ function xml.conv_cheat(data) elseif width == "q" then width = "u64" end + + local prefix = cpu:sub(1,1) + if prefix == ":" then + cpu = cpu:sub(2,cpu:len()) + end + local cpuname = cpu:gsub(":", "_") if space == "m" then regions[cpuname .. space] = ":" .. cpu -- cgit v1.2.3