diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-08-09 21:47:02 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-08-12 15:20:26 -0400 |
commit | 9b1f59fc95da32963f3ba22f8587ea0c12899e05 (patch) | |
tree | 27ece8ea76f043dec5c489e0055047c068144df7 /gdb/gdbarch.h | |
parent | 65f82b1972cca3476b3ef6abf1d9923d34f5d4f5 (diff) | |
download | gdb-9b1f59fc95da32963f3ba22f8587ea0c12899e05.zip gdb-9b1f59fc95da32963f3ba22f8587ea0c12899e05.tar.gz gdb-9b1f59fc95da32963f3ba22f8587ea0c12899e05.tar.bz2 |
gdb: make gdbarch_printable_names return a vector
I noticed that gdbarch_selftest::operator() leaked the value returned by
gdbarch_printable_names. Make gdbarch_printable_names return an
std::vector and update callers. That makes it easier for everyone
involved, less manual memory management.
Change-Id: Ia8fc028bdb91f787410cca34f10bf3c5a6da1498
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 7db3e36..979159b 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1824,12 +1824,11 @@ extern void gdbarch_register (enum bfd_architecture architecture, gdbarch_dump_tdep_ftype *); -/* Return a freshly allocated, NULL terminated, array of the valid - architecture names. Since architectures are registered during the - _initialize phase this function only returns useful information - once initialization has been completed. */ +/* Return a vector of the valid architecture names. Since architectures are + registered during the _initialize phase this function only returns useful + information once initialization has been completed. */ -extern const char **gdbarch_printable_names (void); +extern std::vector<const char *> gdbarch_printable_names (); /* Helper function. Search the list of ARCHES for a GDBARCH that |