From patchwork Fri Jun 20 15:38:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 1597 Received: (qmail 25933 invoked by alias); 20 Jun 2014 15:39:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25796 invoked by uid 89); 20 Jun 2014 15:39:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 20 Jun 2014 15:39:01 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5KFd0Sl014670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 20 Jun 2014 11:39:00 -0400 Received: from barimba.redhat.com (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5KFcxM9004765; Fri, 20 Jun 2014 11:38:59 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 1/2] fix indentation in minsyms.c Date: Fri, 20 Jun 2014 09:38:56 -0600 Message-Id: <1403278737-29257-2-git-send-email-tromey@redhat.com> In-Reply-To: <1403278737-29257-1-git-send-email-tromey@redhat.com> References: <1403278737-29257-1-git-send-email-tromey@redhat.com> This fixes a few spots in minsyms.c that had incorrect indentation. 2014-06-20 Tom Tromey * minsyms.c (add_minsym_to_demangled_hash_table) (lookup_minimal_symbol, install_minimal_symbols): Reindent. --- gdb/ChangeLog | 5 +++ gdb/minsyms.c | 98 +++++++++++++++++++++++++++++------------------------------ 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 6f1fb35..e59b534 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -127,7 +127,7 @@ add_minsym_to_hash_table (struct minimal_symbol *sym, TABLE. */ static void add_minsym_to_demangled_hash_table (struct minimal_symbol *sym, - struct minimal_symbol **table) + struct minimal_symbol **table) { if (sym->demangled_hash_next == NULL) { @@ -201,17 +201,17 @@ lookup_minimal_symbol (const char *name, const char *sfile, { /* Do two passes: the first over the ordinary hash table, and the second over the demangled hash table. */ - int pass; + int pass; - for (pass = 1; pass <= 2 && found_symbol.minsym == NULL; pass++) + for (pass = 1; pass <= 2 && found_symbol.minsym == NULL; pass++) { - /* Select hash list according to pass. */ - if (pass == 1) - msymbol = objfile->per_bfd->msymbol_hash[hash]; - else - msymbol = objfile->per_bfd->msymbol_demangled_hash[dem_hash]; + /* Select hash list according to pass. */ + if (pass == 1) + msymbol = objfile->per_bfd->msymbol_hash[hash]; + else + msymbol = objfile->per_bfd->msymbol_demangled_hash[dem_hash]; - while (msymbol != NULL && found_symbol.minsym == NULL) + while (msymbol != NULL && found_symbol.minsym == NULL) { int match; @@ -228,50 +228,50 @@ lookup_minimal_symbol (const char *name, const char *sfile, { /* The function respects CASE_SENSITIVITY. */ match = MSYMBOL_MATCHES_SEARCH_NAME (msymbol, - modified_name); + modified_name); } if (match) { - switch (MSYMBOL_TYPE (msymbol)) - { - case mst_file_text: - case mst_file_data: - case mst_file_bss: - if (sfile == NULL - || filename_cmp (msymbol->filename, sfile) == 0) - { - found_file_symbol.minsym = msymbol; - found_file_symbol.objfile = objfile; - } - break; - - case mst_solib_trampoline: - - /* If a trampoline symbol is found, we prefer to - keep looking for the *real* symbol. If the - actual symbol is not found, then we'll use the - trampoline entry. */ - if (trampoline_symbol.minsym == NULL) - { - trampoline_symbol.minsym = msymbol; - trampoline_symbol.objfile = objfile; - } - break; - - case mst_unknown: - default: - found_symbol.minsym = msymbol; - found_symbol.objfile = objfile; - break; - } + switch (MSYMBOL_TYPE (msymbol)) + { + case mst_file_text: + case mst_file_data: + case mst_file_bss: + if (sfile == NULL + || filename_cmp (msymbol->filename, sfile) == 0) + { + found_file_symbol.minsym = msymbol; + found_file_symbol.objfile = objfile; + } + break; + + case mst_solib_trampoline: + + /* If a trampoline symbol is found, we prefer to + keep looking for the *real* symbol. If the + actual symbol is not found, then we'll use the + trampoline entry. */ + if (trampoline_symbol.minsym == NULL) + { + trampoline_symbol.minsym = msymbol; + trampoline_symbol.objfile = objfile; + } + break; + + case mst_unknown: + default: + found_symbol.minsym = msymbol; + found_symbol.objfile = objfile; + break; + } } - /* Find the next symbol on the hash chain. */ - if (pass == 1) - msymbol = msymbol->hash_next; - else - msymbol = msymbol->demangled_hash_next; + /* Find the next symbol on the hash chain. */ + if (pass == 1) + msymbol = msymbol->hash_next; + else + msymbol = msymbol->demangled_hash_next; } } } @@ -1228,7 +1228,7 @@ install_minimal_symbols (struct objfile *objfile) if (objfile->per_bfd->minimal_symbol_count) memcpy ((char *) msymbols, (char *) objfile->per_bfd->msymbols, - objfile->per_bfd->minimal_symbol_count * sizeof (struct minimal_symbol)); + objfile->per_bfd->minimal_symbol_count * sizeof (struct minimal_symbol)); /* Walk through the list of minimal symbol bunches, adding each symbol to the new contiguous array of symbols. Note that we start with the @@ -1256,7 +1256,7 @@ install_minimal_symbols (struct objfile *objfile) mcount = compact_minimal_symbols (msymbols, mcount, objfile); obstack_blank (&objfile->per_bfd->storage_obstack, - (mcount + 1 - alloc_count) * sizeof (struct minimal_symbol)); + (mcount + 1 - alloc_count) * sizeof (struct minimal_symbol)); msymbols = (struct minimal_symbol *) obstack_finish (&objfile->per_bfd->storage_obstack);