Convert tdesc's expedite_regs to a string vector

Right now the list of expedited registers is stored as an array of char *,
with a nullptr element at the end to signal its last element.

Convert expedite_regs to a std::vector of std::string so it is easier to
manage the elements and the storage is handled automatically.

Eventually we might want to convert all the target functions so they pass a
std::vector of std::string as well. Or maybe expose an interface that target can
use to add expedited registers on-by-one depending on the target description
discovery needs, as opposed to just a static list of char *.

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Luis Machado
2023-09-11 12:42:00 +01:00
parent ca65640ff7
commit 6a65998a8a
3 changed files with 21 additions and 19 deletions

View File

@@ -40,9 +40,9 @@ struct target_desc final : tdesc_element
std::vector<tdesc_feature_up> features;
#ifndef IN_PROCESS_AGENT
/* An array of register names. These are the "expedite" registers:
/* A vector of register names. These are the "expedite" registers:
registers whose values are sent along with stop replies. */
const char **expedite_regs = NULL;
std::vector<std::string> expedite_regs;
/* Defines what to return when looking for the "target.xml" file in
response to qXfer:features:read. Its contents can either be