gdbstub: refactor get_feature_xml

Try to bring up the code to more modern standards by:

  - use dynamic GString built xml over a fixed buffer
  - use autofree to save on explicit g_free() calls
  - don't hand hack strstr to find the delimiter
  - fix up style of xml_builtin and invert loop

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230829161528.2707696-11-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2023-08-29 17:15:26 +01:00
parent 5b030993db
commit 56e534bd11
2 changed files with 46 additions and 43 deletions

View file

@ -33,7 +33,7 @@ typedef struct GDBProcess {
uint32_t pid;
bool attached;
char target_xml[1024];
char *target_xml;
} GDBProcess;
enum RSState {