diff --git a/ext/gdb-xml/mips.xml b/ext/gdb-xml/mips.xml
new file mode 100644
index 0000000000..23133d7e33
--- /dev/null
+++ b/ext/gdb-xml/mips.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+ mips
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/arch/mips/SConscript b/src/arch/mips/SConscript
index cac589f8ec..d8771de8ce 100644
--- a/src/arch/mips/SConscript
+++ b/src/arch/mips/SConscript
@@ -1,6 +1,7 @@
# -*- mode:python -*-
# Copyright (c) 2004-2006 The Regents of The University of Michigan
+# Copyright (c) 2020 LabWare
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -50,3 +51,5 @@ if env['TARGET_ISA'] == 'mips':
DebugFlag('MipsPRA')
ISADesc('isa/main.isa')
+
+ GdbXml('mips.xml', 'gdb_xml_mips')
diff --git a/src/arch/mips/remote_gdb.cc b/src/arch/mips/remote_gdb.cc
index 48138eec78..bd9a40f686 100644
--- a/src/arch/mips/remote_gdb.cc
+++ b/src/arch/mips/remote_gdb.cc
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 LabWare
+ * Copyright 2015-2020 LabWare
* Copyright 2014 Google, Inc.
* Copyright (c) 2010 ARM Limited
* All rights reserved
@@ -136,6 +136,7 @@
#include
#include "arch/mips/decoder.hh"
+#include "blobs/gdb_xml_mips.hh"
#include "cpu/thread_state.hh"
#include "debug/GDBAcc.hh"
#include "debug/GDBMisc.hh"
@@ -201,3 +202,20 @@ RemoteGDB::gdbRegs()
{
return ®Cache;
}
+
+bool
+RemoteGDB::getXferFeaturesRead(const std::string &annex, std::string &output)
+{
+#define GDB_XML(x, s) \
+ { x, std::string(reinterpret_cast(Blobs::s), \
+ Blobs::s ## _len) }
+ static const std::map annexMap {
+ GDB_XML("target.xml", gdb_xml_mips),
+ };
+#undef GDB_XML
+ auto it = annexMap.find(annex);
+ if (it == annexMap.end())
+ return false;
+ output = it->second;
+ return true;
+}
diff --git a/src/arch/mips/remote_gdb.hh b/src/arch/mips/remote_gdb.hh
index 407a5574f5..2119d8e1d6 100644
--- a/src/arch/mips/remote_gdb.hh
+++ b/src/arch/mips/remote_gdb.hh
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 LabWare
+ * Copyright 2015-2020 LabWare
* Copyright 2014 Google, Inc.
* Copyright (c) 2007 The Regents of The University of Michigan
* All rights reserved.
@@ -79,6 +79,12 @@ class RemoteGDB : public BaseRemoteGDB
public:
RemoteGDB(System *_system, ThreadContext *tc, int _port);
BaseGdbRegCache *gdbRegs();
+ std::vector
+ availableFeatures() const
+ {
+ return {"qXfer:features:read+"};
+ };
+ bool getXferFeaturesRead(const std::string &annex, std::string &output);
};
} // namespace MipsISA