xml-tdesc.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* XML target description support for GDB.
  2. Copyright (C) 2006-2022 Free Software Foundation, Inc.
  3. Contributed by CodeSourcery.
  4. This file is part of GDB.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef XML_TDESC_H
  16. #define XML_TDESC_H
  17. #include "gdbsupport/gdb_optional.h"
  18. #include <string>
  19. struct target_ops;
  20. struct target_desc;
  21. /* Read an XML target description from FILENAME. Parse it, and return
  22. the parsed description. */
  23. const struct target_desc *file_read_description_xml (const char *filename);
  24. /* Read an XML target description using OPS. Parse it, and return the
  25. parsed description. */
  26. const struct target_desc *target_read_description_xml (struct target_ops *);
  27. /* Fetches an XML target description using OPS, processing includes,
  28. but not parsing it. Used to dump whole tdesc as a single XML file.
  29. Returns the description on success, and a disengaged optional
  30. otherwise. */
  31. gdb::optional<std::string> target_fetch_description_xml (target_ops *ops);
  32. /* Take an xml string, parse it, and return the parsed description. Does not
  33. handle a string containing includes. */
  34. const struct target_desc *string_read_description_xml (const char *xml);
  35. #endif /* XML_TDESC_H */