From 1d59cee5abf49fb4960dfc3a850a6ce2867aeaf7 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 3 Mar 2009 02:10:08 +0000 Subject: [PATCH] Remove some unused routines. * ada-lang.c (is_suppressed_name, ada_suppress_symbol_printing): Delete. * ada-lang.c (ada_task_list_iterator_ftype) (iterate_over_live_ada_tasks): Delete. * ada-tasks.c (ada_get_environment_task, iterate_over_live_ada_tasks): Delete. --- gdb/ChangeLog | 11 +++++++++++ gdb/ada-lang.c | 48 ------------------------------------------------ gdb/ada-lang.h | 4 ---- gdb/ada-tasks.c | 37 ------------------------------------- 4 files changed, 11 insertions(+), 89 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 43773419134..1f2a8ed1d17 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2009-03-02 Joel Brobecker + + Remove some unused routines. + + * ada-lang.c (is_suppressed_name, ada_suppress_symbol_printing): + Delete. + * ada-lang.c (ada_task_list_iterator_ftype) + (iterate_over_live_ada_tasks): Delete. + * ada-tasks.c (ada_get_environment_task, iterate_over_live_ada_tasks): + Delete. + 2009-03-01 Doug Evans * symtab.c: Remove trailing whitespace throughout the file. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 671cb35b21f..fbcc32ad2fc 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -732,42 +732,6 @@ const struct ada_opname_map ada_opname_table[] = { {NULL, NULL} }; -/* Return non-zero if STR should be suppressed in info listings. */ - -static int -is_suppressed_name (const char *str) -{ - if (strncmp (str, "_ada_", 5) == 0) - str += 5; - if (str[0] == '_' || str[0] == '\000') - return 1; - else - { - const char *p; - const char *suffix = strstr (str, "___"); - if (suffix != NULL && suffix[3] != 'X') - return 1; - if (suffix == NULL) - suffix = str + strlen (str); - for (p = suffix - 1; p != str; p -= 1) - if (isupper (*p)) - { - int i; - if (p[0] == 'X' && p[-1] != '_') - goto OK; - if (*p != 'O') - return 1; - for (i = 0; ada_opname_table[i].encoded != NULL; i += 1) - if (strncmp (ada_opname_table[i].encoded, p, - strlen (ada_opname_table[i].encoded)) == 0) - goto OK; - return 1; - OK:; - } - return 0; - } -} - /* The "encoded" form of DECODED, according to GNAT conventions. The result is valid until the next call to ada_encode. */ @@ -1231,18 +1195,6 @@ ada_match_name (const char *sym_name, const char *name, int wild) && is_name_suffix (sym_name + len_name + 5)); } } - -/* True (non-zero) iff, in Ada mode, the symbol SYM should be - suppressed in info listings. */ - -static int -ada_suppress_symbol_printing (struct symbol *sym) -{ - if (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN) - return 1; - else - return is_suppressed_name (SYMBOL_LINKAGE_NAME (sym)); -} /* Arrays */ diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index c7cc62a48d3..946ffccc897 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -463,10 +463,6 @@ extern char *ada_main_name (void); extern int valid_task_id (int); -typedef void (ada_task_list_iterator_ftype) (struct ada_task_info *task); -extern void iterate_over_live_ada_tasks - (ada_task_list_iterator_ftype *iterator); - extern void ada_adjust_exception_stop (bpstat bs); extern void ada_print_exception_stop (bpstat bs); diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 61ed06e7e97..d51291b06ed 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -196,43 +196,6 @@ valid_task_id (int task_num) && task_num <= VEC_length (ada_task_info_s, task_list)); } -/* Return the task info associated to the Environment Task. - This function assumes that the inferior does in fact use tasking. */ - -static struct ada_task_info * -ada_get_environment_task (void) -{ - ada_build_task_list (0); - gdb_assert (VEC_length (ada_task_info_s, task_list) > 0); - - /* We use a little bit of insider knowledge to determine which task - is the Environment Task: We know that this task is created first, - and thus should always be task #1, which is at index 0 of the - TASK_LIST. */ - return (VEC_index (ada_task_info_s, task_list, 0)); -} - -/* Call the ITERATOR function once for each Ada task that hasn't been - terminated yet. */ - -void -iterate_over_live_ada_tasks (ada_task_list_iterator_ftype *iterator) -{ - int i, nb_tasks; - struct ada_task_info *task; - - ada_build_task_list (0); - nb_tasks = VEC_length (ada_task_info_s, task_list); - - for (i = 0; i < nb_tasks; i++) - { - task = VEC_index (ada_task_info_s, task_list, i); - if (!ada_task_is_alive (task)) - continue; - iterator (task); - } -} - /* Extract the contents of the value as a string whose length is LENGTH, and store the result in DEST. */ -- 2.30.2