From ab816a274505933da2f854014b54901c3c3db9d2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 4 May 2017 16:35:09 -0600 Subject: Use a std::vector for ada_exceptions_list Change ada_exceptions_list to return a std::vector and fix up the users. This allows removing a cleanup in MI. gdb/ChangeLog 2017-09-29 Tom Tromey * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions): Update. * ada-lang.h (struct ada_exc_info): Remove typedef. Declare operator< and operator==. (ada_exceptions_list): Return a std::vector. * ada-lang.c (ada_exc_info::operator<): Rename from compare_ada_exception_info. (ada_exc_info::operator==): New. (sort_remove_dups_ada_exceptions_list): Change type of "exceptions". (ada_add_standard_exceptions, ada_add_exceptions_from_frame) (ada_add_global_exceptions): Likewise. (ada_exceptions_list_1): Return a std::vector. (ada_exceptions_list): Likewise. --- gdb/ada-lang.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gdb/ada-lang.h') diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index f5b3bca..f92b88d 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -379,18 +379,19 @@ extern void create_ada_exception_catchpoint /* Some information about a given Ada exception. */ -typedef struct ada_exc_info +struct ada_exc_info { /* The name of the exception. */ const char *name; /* The address of the symbol corresponding to that exception. */ CORE_ADDR addr; -} ada_exc_info; -DEF_VEC_O(ada_exc_info); + bool operator< (const ada_exc_info &); + bool operator== (const ada_exc_info &); +}; -extern VEC(ada_exc_info) *ada_exceptions_list (const char *regexp); +extern std::vector ada_exceptions_list (const char *regexp); /* Tasking-related: ada-tasks.c */ -- cgit v1.1