From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14404 invoked by alias); 6 Jul 2009 18:09:40 -0000 Received: (qmail 14394 invoked by uid 22791); 6 Jul 2009 18:09:40 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jul 2009 18:09:34 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n66I9WHu012913 for ; Mon, 6 Jul 2009 14:09:32 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n66I9VJf000556 for ; Mon, 6 Jul 2009 14:09:32 -0400 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n66I9UIB009741 for ; Mon, 6 Jul 2009 14:09:31 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n66I9UBn029902 for ; Mon, 6 Jul 2009 20:09:30 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n66I9TNg029899 for gdb-patches@sourceware.org; Mon, 6 Jul 2009 20:09:29 +0200 Date: Mon, 06 Jul 2009 18:09:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] cleanup: source.c objfile removal Message-ID: <20090706180929.GA29430@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes 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 X-SW-Source: 2009-07/txt/msg00143.txt.bz2 Hi, probably obvious but rather requesting an approval. It is needed to unify some psymtab and symtab functions later. Thanks, Jan gdb/ 2009-07-06 Jan Kratochvil * source.c (find_and_open_source): Remove the `objfile' parameter. Update the function comment. (open_source_file, symtab_to_fullname, psymtab_to_fullname): Update the find_and_open_source callers. --- a/gdb/source.c +++ b/gdb/source.c @@ -922,11 +922,9 @@ rewrite_source_path (const char *path) } /* This function is capable of finding the absolute path to a - source file, and opening it, provided you give it an - OBJFILE and FILENAME. Both the DIRNAME and FULLNAME are only - added suggestions on where to find the file. + source file, and opening it, provided you give it a FILENAME. Both the + DIRNAME and FULLNAME are only added suggestions on where to find the file. - OBJFILE should be the objfile associated with a psymtab or symtab. FILENAME should be the filename to open. DIRNAME is the compilation directory of a particular source file. Only some debug formats provide this info. @@ -944,8 +942,7 @@ rewrite_source_path (const char *path) FULLNAME is set to NULL. */ static int -find_and_open_source (struct objfile *objfile, - const char *filename, +find_and_open_source (const char *filename, const char *dirname, char **fullname) { @@ -1044,8 +1041,7 @@ open_source_file (struct symtab *s) if (!s) return -1; - return find_and_open_source (s->objfile, s->filename, s->dirname, - &s->fullname); + return find_and_open_source (s->filename, s->dirname, &s->fullname); } /* Finds the fullname that a symtab represents. @@ -1065,8 +1061,7 @@ symtab_to_fullname (struct symtab *s) /* Don't check s->fullname here, the file could have been deleted/moved/..., look for it again */ - r = find_and_open_source (s->objfile, s->filename, s->dirname, - &s->fullname); + r = find_and_open_source (s->filename, s->dirname, &s->fullname); if (r >= 0) { @@ -1094,8 +1089,7 @@ psymtab_to_fullname (struct partial_symtab *ps) /* Don't check ps->fullname here, the file could have been deleted/moved/..., look for it again */ - r = find_and_open_source (ps->objfile, ps->filename, ps->dirname, - &ps->fullname); + r = find_and_open_source (ps->filename, ps->dirname, &ps->fullname); if (r >= 0) {