gdbstub: refactor get_feature_xml
commit56e534bd116afda6f7b9ef96691549373c64040d
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 29 Aug 2023 16:15:26 +0000 (29 17:15 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 30 Aug 2023 13:57:56 +0000 (30 14:57 +0100)
tree9f1178a5b432c1610d544ecdd133ab975886a644
parent5b030993dba1bbb841431506c0919c7a7bef986c
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>
gdbstub/gdbstub.c
gdbstub/internals.h