From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13551 invoked by alias); 6 Dec 2013 22:35:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 13535 invoked by uid 89); 6 Dec 2013 22:35:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-oa0-f74.google.com Received: from Unknown (HELO mail-oa0-f74.google.com) (209.85.219.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 06 Dec 2013 22:35:46 +0000 Received: by mail-oa0-f74.google.com with SMTP id o6so251052oag.1 for ; Fri, 06 Dec 2013 14:35:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=G6ckQt6xH6tKUiGNqLyqtsPGz4KWTjShPf3eUpVaWdA=; b=OOq8OPajkeeAV7YvRdaZw5dCqiHGgTHdypL6On0hjEwaWnxbWplROmzIXVXrk8P3yB EDGF5H2XMkIVwcqF3q893/rs+XVBiAPDp5hiemlweNJ+o2ZeHjZ+64fT77s+9Q5p5iID sno3p34DGd5mi2CFVe2LQd+Fg3oitutEJmXwu8JE1fGFnUmf+WXvqB8SS9xLF6MNxe97 3Zql+VSGQxnBthg2oWRFyfoizRcPRpZsv5/C0xx1uGby/1idh75XMenjsjxj7qrd6cnp 8FhT5Id+E0KtMDy/CrduKIlXypF8Tr862Dp1Y+6ML4qO4Dc0plZoZH5GJbTJJ9hQ/D4z XKoQ== X-Gm-Message-State: ALoCoQkrcEVV3bNBwB2CPoNuRDdaIDQIuHp53NKfnB1kOdqZ5JBdAl+AQH8Xzk1rtYRROr+/grxu224DnP7vkdLzFAxejWUByfdhR6Tcpb2mlVAVlXmY3edyj4//LY5hzBEmLKlfGfuuqErQZiJ/nQJzg2OuKJ0e+9lMC7pC2L4CYoQ60iWkE2IDCNTmoE10SfJp/f6eytKDUS/YAMUeqRnON5GAvEN+iPh+x0+ueT2LCrYLti2SBOM= X-Received: by 10.42.175.73 with SMTP id az9mr1930378icb.4.1386369339042; Fri, 06 Dec 2013 14:35:39 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id d9si4281123yhl.2.2013.12.06.14.35.39 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Dec 2013 14:35:39 -0800 (PST) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id A5AC15A41B7 for ; Fri, 6 Dec 2013 14:35:38 -0800 (PST) From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH 3/3] psymtab.c cleanup: remove "partial" from function names Date: Fri, 06 Dec 2013 22:35:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00275.txt.bz2 Hi. This last patch removes "partial" from the names of expand_partial_symbol_names and map_partial_symbol_filenames. It also renames expand_partial_symbol_names to match the struct quick_symbol_functions "method" that it wraps: expand_symtabs_matching. This patch also adds two parameters to expand_symtabs_matching so that it can fully wrap the underlying quick_symbol_functions method. This makes it usable in more places. I thought of having a cover function that still had the same signature as the old expand_partial_symbol_names function, but I couldn't think of a good name, and it wasn't clear it was worth it anyway. 2013-12-06 Doug Evans * symfile.h (expand_symtabs_matching): Renamed from expand_partial_symbol_names. Update prototype. (map_symbol_filenames): Renamed from map_partial_symbol_filenames. * symfile.c (expand_symtabs_matching): Renamed from expand_partial_symbol_names. New args file_matcher, kind. Rename arg fun to symbol_matcher. (map_symbol_filenames): Renamed from map_partial_symbol_filenames. * ada-lang.c (ada_make_symbol_completion_list): Update to call expand_symtabs_matching. (ada_add_global_exceptions): Call expand_symtabs_matching. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update to call map_symbol_filenames. * symtab.c (sources_info): Update to call map_symbol_filenames. (search_symbols): Call expand_symtabs_matching. (default_make_symbol_completion_list_break_on): Update to call expand_symtabs_matching. (make_source_files_completion_list): Update to call map_symbol_filenames. diff --git a/gdb/symfile.h b/gdb/symfile.h index 9780320..3829803 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -566,11 +566,12 @@ void free_symfile_segment_data (struct symfile_segment_data *data); extern struct cleanup *increment_reading_symtab (void); -void expand_partial_symbol_names (int (*fun) (const char *, void *), - void *data); +void expand_symtabs_matching (expand_symtabs_file_matcher_ftype *, + expand_symtabs_symbol_matcher_ftype *, + enum search_domain kind, void *data); -void map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data, - int need_fullname); +void map_symbol_filenames (symbol_filename_ftype *fun, void *data, + int need_fullname); /* From dwarf2read.c */ diff --git a/gdb/symfile.c b/gdb/symfile.c index a67b398..8c39dd6 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3844,16 +3844,19 @@ symfile_free_objfile (struct objfile *objfile) See quick_symbol_functions.expand_symtabs_matching for details. */ void -expand_partial_symbol_names (expand_symtabs_symbol_matcher_ftype *fun, - void *data) +expand_symtabs_matching (expand_symtabs_file_matcher_ftype *file_matcher, + expand_symtabs_symbol_matcher_ftype *symbol_matcher, + enum search_domain kind, + void *data) { struct objfile *objfile; ALL_OBJFILES (objfile) { if (objfile->sf) - objfile->sf->qf->expand_symtabs_matching (objfile, NULL, fun, - ALL_DOMAIN, data); + objfile->sf->qf->expand_symtabs_matching (objfile, file_matcher, + symbol_matcher, kind, + data); } } @@ -3862,8 +3865,8 @@ expand_partial_symbol_names (expand_symtabs_symbol_matcher_ftype *fun, See quick_symbol_functions.map_symbol_filenames for details. */ void -map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data, - int need_fullname) +map_symbol_filenames (symbol_filename_ftype *fun, void *data, + int need_fullname) { struct objfile *objfile; diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 786ca7a..259c489 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5944,7 +5944,8 @@ ada_make_symbol_completion_list (const char *text0, const char *word, data.word = word; data.wild_match = wild_match_p; data.encoded = encoded_p; - expand_partial_symbol_names (ada_expand_partial_symbol_name, &data); + expand_symtabs_matching (NULL, ada_expand_partial_symbol_name, ALL_DOMAIN, + &data); } /* At this point scan through the misc symbol vectors and add each @@ -12511,11 +12512,8 @@ ada_add_global_exceptions (regex_t *preg, VEC(ada_exc_info) **exceptions) struct objfile *objfile; struct symtab *s; - ALL_OBJFILES (objfile) - if (objfile->sf) - objfile->sf->qf->expand_symtabs_matching - (objfile, NULL, ada_exc_search_name_matches, - VARIABLES_DOMAIN, preg); + expand_symtabs_matching (NULL, ada_exc_search_name_matches, + VARIABLES_DOMAIN, preg); ALL_PRIMARY_SYMTABS (objfile, s) { diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c index 07d9722..81c887f 100644 --- a/gdb/mi/mi-cmd-file.c +++ b/gdb/mi/mi-cmd-file.c @@ -100,8 +100,8 @@ mi_cmd_file_list_exec_source_files (char *command, char **argv, int argc) ui_out_end (uiout, ui_out_type_tuple); } - map_partial_symbol_filenames (print_partial_file_name, NULL, - 1 /*need_fullname*/); + map_symbol_filenames (print_partial_file_name, NULL, + 1 /*need_fullname*/); ui_out_end (uiout, ui_out_type_list); } diff --git a/gdb/symtab.c b/gdb/symtab.c index d554c67..35214e7 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3283,8 +3283,8 @@ sources_info (char *ignore, int from_tty) clear_filename_seen_cache (data.filename_seen_cache); data.first = 1; - map_partial_symbol_filenames (output_partial_symbol_filename, &data, - 1 /*need_fullname*/); + map_symbol_filenames (output_partial_symbol_filename, &data, + 1 /*need_fullname*/); printf_filtered ("\n"); do_cleanups (cleanups); @@ -3566,17 +3566,11 @@ search_symbols (char *regexp, enum search_domain kind, datum.nfiles = nfiles; datum.files = files; - ALL_OBJFILES (objfile) - { - if (objfile->sf) - objfile->sf->qf->expand_symtabs_matching (objfile, - (nfiles == 0 - ? NULL - : search_symbols_file_matches), - search_symbols_name_matches, - kind, - &datum); - } + expand_symtabs_matching ((nfiles == 0 + ? NULL + : search_symbols_file_matches), + search_symbols_name_matches, + kind, &datum); /* Here, we search through the minimal symbol tables for functions and variables that match, and force their symbols to be read. @@ -4356,7 +4350,8 @@ default_make_symbol_completion_list_break_on (const char *text, /* Look through the partial symtabs for all symbols which begin by matching SYM_TEXT. Expand all CUs that you find to the list. The real names will get added by COMPLETION_LIST_ADD_SYMBOL below. */ - expand_partial_symbol_names (expand_partial_symbol_name, &datum); + expand_symtabs_matching (NULL, expand_partial_symbol_name, ALL_DOMAIN, + &datum); /* At this point scan through the misc symbol vectors and add each symbol you find to the list. Eventually we want to ignore @@ -4770,8 +4765,8 @@ make_source_files_completion_list (const char *text, const char *word) datum.word = word; datum.text_len = text_len; datum.list = &list; - map_partial_symbol_filenames (maybe_add_partial_symtab_filename, &datum, - 0 /*need_fullname*/); + map_symbol_filenames (maybe_add_partial_symtab_filename, &datum, + 0 /*need_fullname*/); do_cleanups (cache_cleanup); discard_cleanups (back_to);