From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4240 invoked by alias); 7 Jan 2014 13:37:33 -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 4226 invoked by uid 89); 7 Jan 2014 13:37:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.5 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jan 2014 13:37:32 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1W0WqW-0001n0-94 from Yao_Qi@mentor.com ; Tue, 07 Jan 2014 05:37:28 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 Jan 2014 05:37:27 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Tue, 7 Jan 2014 05:37:26 -0800 Message-ID: <52CC02B1.9060607@codesourcery.com> Date: Tue, 07 Jan 2014 13:37:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Jan Kratochvil CC: Subject: Re: [patchv4 4/5] Keep objfile original filename References: <20130919135631.GD16978@host2.jankratochvil.net> In-Reply-To: <20130919135631.GD16978@host2.jankratochvil.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00138.txt.bz2 On 09/19/2013 09:56 PM, Jan Kratochvil wrote: > @@ -1189,11 +1200,12 @@ symbol_file_add_separate (bfd *bfd, int symfile_flags, struct objfile *objfile) > See symbol_file_add_with_addrs's comments for details. */ > > struct objfile * > -symbol_file_add_from_bfd (bfd *abfd, int add_flags, > +symbol_file_add_from_bfd (bfd *abfd, const char *name, int add_flags, > struct section_addr_info *addrs, > int flags, struct objfile *parent) We add an argument name here, but don't update spu_symbol_file_add_from_memory in spu-linux-nat.c. We get a build error below, when we build GDB with --target=spu-elf on powerpc-linux machine. ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 2 of ‘symbol_file_add_from_bfd’ makes pointer from integer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘const char *’ but argument is of type ‘int’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 3 of ‘symbol_file_add_from_bfd’ makes integer from pointer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘int’ but argument is of type ‘void *’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 5 of ‘symbol_file_add_from_bfd’ makes integer from pointer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘int’ but argument is of type ‘void *’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: too few arguments to function ‘symbol_file_add_from_bfd’ This patch fixes the build error, but I am not sure NAME we passed to symbol_file_add_from_bfd is desired. IIUC, the NAME is "". I didn't run testsuite. Is it OK? -- Yao (齐尧) gdb: 2014-01-07 Yao Qi * spu-linux-nat.c (spu_symbol_file_add_from_memory): Pass return value of bfd_get_filename to symbol_file_add_from_bfd. --- gdb/spu-linux-nat.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c index 9441e02..cfd5fd9 100644 --- a/gdb/spu-linux-nat.c +++ b/gdb/spu-linux-nat.c @@ -379,7 +379,8 @@ spu_symbol_file_add_from_memory (int inferior_fd) { struct cleanup *cleanup = make_cleanup_bfd_unref (nbfd); - symbol_file_add_from_bfd (nbfd, SYMFILE_VERBOSE | SYMFILE_MAINLINE, + symbol_file_add_from_bfd (nbfd, bfd_get_filename (nbfd), + SYMFILE_VERBOSE | SYMFILE_MAINLINE, NULL, 0, NULL); do_cleanups (cleanup); } -- 1.7.7.6