summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/debug/debugcpu.cpp')
-rw-r--r--src/emu/debug/debugcpu.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index 90641019986..b8ef947b4f8 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -220,7 +220,7 @@ bool debugger_cpu::comment_save()
bool comments_saved = false;
// if we don't have a root, bail
- xml_data_node *root = xml_file_create();
+ xml_data_node *const root = xml_data_node::file_create();
if (root == nullptr)
return false;
@@ -228,16 +228,16 @@ bool debugger_cpu::comment_save()
try
{
// create a comment node
- xml_data_node *commentnode = xml_add_child(root, "mamecommentfile", nullptr);
+ xml_data_node *const commentnode = root->add_child("mamecommentfile", nullptr);
if (commentnode == nullptr)
throw emu_exception();
- xml_set_attribute_int(commentnode, "version", COMMENT_VERSION);
+ commentnode->set_attribute_int("version", COMMENT_VERSION);
// create a system node
- xml_data_node *systemnode = xml_add_child(commentnode, "system", nullptr);
+ xml_data_node *const systemnode = commentnode->add_child("system", nullptr);
if (systemnode == nullptr)
throw emu_exception();
- xml_set_attribute(systemnode, "name", m_machine.system().name);
+ systemnode->set_attribute("name", m_machine.system().name);
// for each device
bool found_comments = false;
@@ -245,10 +245,10 @@ bool debugger_cpu::comment_save()
if (device.debug() && device.debug()->comment_count() > 0)
{
// create a node for this device
- xml_data_node *curnode = xml_add_child(systemnode, "cpu", nullptr);
+ xml_data_node *const curnode = systemnode->add_child("cpu", nullptr);
if (curnode == nullptr)
throw emu_exception();
- xml_set_attribute(curnode, "tag", device.tag());
+ curnode->set_attribute("tag", device.tag());
// export the comments
if (!device.debug()->comment_export(*curnode))
@@ -263,19 +263,19 @@ bool debugger_cpu::comment_save()
osd_file::error filerr = file.open(m_machine.basename(), ".cmt");
if (filerr == osd_file::error::NONE)
{
- xml_file_write(root, file);
+ root->file_write(file);
comments_saved = true;
}
}
}
catch (emu_exception &)
{
- xml_file_free(root);
+ root->file_free();
return false;
}
// free and get out of here
- xml_file_free(root);
+ root->file_free();
return comments_saved;
}
@@ -295,7 +295,7 @@ bool debugger_cpu::comment_load(bool is_inline)
return false;
// wrap in a try/catch to handle errors
- xml_data_node *root = xml_file_read(file, nullptr);
+ xml_data_node *const root = xml_data_node::file_read(file, nullptr);
try
{
// read the file
@@ -303,25 +303,25 @@ bool debugger_cpu::comment_load(bool is_inline)
throw emu_exception();
// find the config node
- xml_data_node *commentnode = xml_get_sibling(root->child, "mamecommentfile");
+ xml_data_node const *const commentnode = root->get_child("mamecommentfile");
if (commentnode == nullptr)
throw emu_exception();
// validate the config data version
- int version = xml_get_attribute_int(commentnode, "version", 0);
+ int version = commentnode->get_attribute_int("version", 0);
if (version != COMMENT_VERSION)
throw emu_exception();
// check to make sure the file is applicable
- xml_data_node *systemnode = xml_get_sibling(commentnode->child, "system");
- const char *name = xml_get_attribute_string(systemnode, "name", "");
+ xml_data_node const *const systemnode = commentnode->get_child("system");
+ const char *const name = systemnode->get_attribute_string("name", "");
if (strcmp(name, m_machine.system().name) != 0)
throw emu_exception();
// iterate over devices
- for (xml_data_node *cpunode = xml_get_sibling(systemnode->child, "cpu"); cpunode; cpunode = xml_get_sibling(cpunode->next, "cpu"))
+ for (xml_data_node const *cpunode = systemnode->get_child("cpu"); cpunode; cpunode = cpunode->get_next_sibling("cpu"))
{
- const char *cputag_name = xml_get_attribute_string(cpunode, "tag", "");
+ const char *cputag_name = cpunode->get_attribute_string("tag", "");
device_t *device = m_machine.device(cputag_name);
if (device != nullptr)
{
@@ -337,12 +337,12 @@ bool debugger_cpu::comment_load(bool is_inline)
{
// clean up in case of error
if (root != nullptr)
- xml_file_free(root);
+ root->file_free();
return false;
}
// free the parser
- xml_file_free(root);
+ root->file_free();
return true;
}
@@ -2583,12 +2583,12 @@ bool device_debug::comment_export(xml_data_node &curnode)
// iterate through the comments
for (const auto & elem : m_comment_set)
{
- xml_data_node *datanode = xml_add_child(&curnode, "comment", xml_normalize_string(elem.m_text.c_str()));
+ xml_data_node *datanode = curnode.add_child("comment", xml_normalize_string(elem.m_text.c_str()));
if (datanode == nullptr)
return false;
- xml_set_attribute_int(datanode, "address", elem.m_address);
- xml_set_attribute_int(datanode, "color", elem.m_color);
- xml_set_attribute(datanode, "crc", string_format("%08X", elem.m_crc).c_str());
+ datanode->set_attribute_int("address", elem.m_address);
+ datanode->set_attribute_int("color", elem.m_color);
+ datanode->set_attribute("crc", string_format("%08X", elem.m_crc).c_str());
}
return true;
}
@@ -2599,23 +2599,23 @@ bool device_debug::comment_export(xml_data_node &curnode)
// given XML data node
//-------------------------------------------------
-bool device_debug::comment_import(xml_data_node &cpunode,bool is_inline)
+bool device_debug::comment_import(xml_data_node const &cpunode, bool is_inline)
{
// iterate through nodes
- for (xml_data_node *datanode = xml_get_sibling(cpunode.child, "comment"); datanode; datanode = xml_get_sibling(datanode->next, "comment"))
+ for (xml_data_node const *datanode = cpunode.get_child("comment"); datanode; datanode = datanode->get_next_sibling("comment"))
{
// extract attributes
- offs_t address = xml_get_attribute_int(datanode, "address", 0);
- rgb_t color = xml_get_attribute_int(datanode, "color", 0);
+ offs_t address = datanode->get_attribute_int("address", 0);
+ rgb_t color = datanode->get_attribute_int("color", 0);
uint32_t crc;
- sscanf(xml_get_attribute_string(datanode, "crc", nullptr), "%08X", &crc);
+ sscanf(datanode->get_attribute_string("crc", nullptr), "%08X", &crc);
// add the new comment
if(is_inline == true)
- m_comment_set.insert(dasm_comment(address, crc, datanode->value, color));
+ m_comment_set.insert(dasm_comment(address, crc, datanode->get_value(), color));
else
- m_device.machine().debugger().console().printf(" %08X - %s\n", address, datanode->value);
+ m_device.machine().debugger().console().printf(" %08X - %s\n", address, datanode->get_value());
}
return true;
}