From: Yao Qi <yao@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [patchv4 4/5] Keep objfile original filename
Date: Tue, 07 Jan 2014 13:37:00 -0000 [thread overview]
Message-ID: <52CC02B1.9060607@codesourcery.com> (raw)
In-Reply-To: <20130919135631.GD16978@host2.jankratochvil.net>
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 "<in-memory>".
I didn't run testsuite. Is it OK?
--
Yao (é½å°§)
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* 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
next prev parent reply other threads:[~2014-01-07 13:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 14:20 Jan Kratochvil
2013-09-19 23:37 ` Doug Evans
2013-09-24 14:01 ` [commit] " Jan Kratochvil
2014-01-07 13:37 ` Yao Qi [this message]
2014-01-07 18:47 ` Jan Kratochvil
2014-01-08 2:47 ` Yao Qi
2014-01-08 3:23 ` Tom Tromey
2014-01-08 6:26 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52CC02B1.9060607@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox