From d64ad97c6ba5a1deb97788fd015b60459f64a753 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Tue, 7 Jan 2014 17:48:07 +0800 Subject: [PATCH] Pass name to symbol_file_add_from_bfd MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch fixes the following build error: ../../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’ Argument 'name' was added to function symbol_file_add_from_bfd by this patch [patchv4 4/5] Keep objfile original filename https://sourceware.org/ml/gdb-patches/2013-09/msg00683.html but caller of symbol_file_add_from_bfd in spu-linux-nat.c wasn't updated. This patch fixes the build error. gdb: 2014-01-08 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/ChangeLog | 5 +++++ gdb/spu-linux-nat.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 152d9eb..e5c7bdc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-01-08 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. + 2014-01-08 Pierre Muller Fix PR16201. 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); } -- 2.7.4