From patchwork Wed Dec 3 17:06:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 4056 Received: (qmail 9360 invoked by alias); 3 Dec 2014 17:07:03 -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 9303 invoked by uid 89); 3 Dec 2014 17:07:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham 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; Wed, 03 Dec 2014 17:07:01 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB3H70mZ024946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 3 Dec 2014 12:07:00 -0500 Received: from host2.jankratochvil.net (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sB3H6uRO002058 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 3 Dec 2014 12:06:59 -0500 Date: Wed, 3 Dec 2014 18:06:56 +0100 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch +const 1/2] Add const to many struct objfile * Message-ID: <20141203170656.GB25020@host2.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes 2014-12-03 Jan Kratochvil Add const to struct objfile *. * minsyms.c, minsyms.h, symtab.c, symtab.h: In these files. diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 2463be4..8057fda 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -404,7 +404,7 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf) struct minimal_symbol * lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name, - struct objfile *objf) + const struct objfile *objf) { struct objfile *objfile; struct minimal_symbol *msymbol; diff --git a/gdb/minsyms.h b/gdb/minsyms.h index 807e5ee..5e52367 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -206,7 +206,7 @@ struct bound_minimal_symbol lookup_minimal_symbol_solib_trampoline symbol that matches, or NULL if no match is found. */ struct minimal_symbol *lookup_minimal_symbol_by_pc_name - (CORE_ADDR, const char *, struct objfile *); + (CORE_ADDR, const char *, const struct objfile *); /* Search through the minimal symbol table for each objfile and find the symbol whose address is the largest address that is still less diff --git a/gdb/symtab.c b/gdb/symtab.c index a52f7c0..79035f6 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1061,7 +1061,7 @@ expand_symtab_containing_pc (CORE_ADDR pc, struct obj_section *section) void fixup_section (struct general_symbol_info *ginfo, - CORE_ADDR addr, struct objfile *objfile) + CORE_ADDR addr, const struct objfile *objfile) { struct minimal_symbol *msym; @@ -1141,7 +1141,7 @@ fixup_section (struct general_symbol_info *ginfo, } struct symbol * -fixup_symbol_section (struct symbol *sym, struct objfile *objfile) +fixup_symbol_section (struct symbol *sym, const struct objfile *objfile) { CORE_ADDR addr; @@ -1561,7 +1561,7 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile, if (sym) { block_found = block; - return fixup_symbol_section (sym, (struct objfile *)objfile); + return fixup_symbol_section (sym, objfile); } } @@ -1580,8 +1580,9 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile, static symbols. */ static struct symbol * -lookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index, - const char *name, const domain_enum domain) +lookup_symbol_in_objfile_symtabs (const struct objfile *objfile, + int block_index, const char *name, + const domain_enum domain) { struct compunit_symtab *cust; diff --git a/gdb/symtab.h b/gdb/symtab.h index 57d234d..82ca77f 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1426,7 +1426,7 @@ extern CORE_ADDR skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr); extern struct symbol *fixup_symbol_section (struct symbol *, - struct objfile *); + const struct objfile *); /* Symbol searching */ /* Note: struct symbol_search, search_symbols, et.al. are declared here, @@ -1484,7 +1484,7 @@ extern struct symbol * int producer_is_realview (const char *producer); void fixup_section (struct general_symbol_info *ginfo, - CORE_ADDR addr, struct objfile *objfile); + CORE_ADDR addr, const struct objfile *objfile); /* Look up objfile containing BLOCK. */