gdbstub: Introduce GDBFeature structure
Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230912224107.29669-6-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20231009164104.369749-13-alex.bennee@linaro.org>
This commit is contained in:
1 parent
1063693e1c
commit
956af7daad
7 files changed
+63
-79
No files matched your search
+3
-3
@@ -408,11 +408,11 @@ static const char *get_feature_xml(const char *p, const char **newp,
|
||||
}
|
||||
}
|
||||
/* Is it one of the encoded gdb-xml/ files? */
|
||||
for (int i = 0; xml_builtin[i][0]; i++) {
|
||||
const char *name = xml_builtin[i][0];
|
||||
for (int i = 0; gdb_static_features[i].xmlname; i++) {
|
||||
const char *name = gdb_static_features[i].xmlname;
|
||||
if ((strncmp(name, p, len) == 0) &&
|
||||
strlen(name) == len) {
|
||||
return xml_builtin[i][1];
|
||||
return gdb_static_features[i].xml;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user