From: Joel Brobecker <brobecker@adacore.com>
To: David Miller <davem@davemloft.net>, stan@codesourcery.com
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix build on sparc (remote.c/tracepoints)
Date: Sat, 26 Nov 2011 20:14:00 -0000 [thread overview]
Message-ID: <20111126201404.GA24943@adacore.com> (raw)
In-Reply-To: <20111126.143855.1966723588620210024.davem@davemloft.net>
> sprintf_vma() expands to a printf format string appropriate for
> a bfd_vma type, so the only proper cast is to that exact type.
Actually, I think the problem in this case comes from the fact
that we're calling sprintf_vma with a ULONGEST. What we probably
want is to use phex (or phex_nz).
Attached is a patch that implements that, but only tested as far
as compiling goes. I don't have time to test it. I decided to use
phex_nz instead of phex, because I don't think we need the leading
zeros and it seems we're trying to avoid increasing the size of
the packets unnecessarily (probably for slow links). Similarly,
for loc->address value, I used phex_nz instead of paddr because
that's what we already do elsewhere, and avoids the use of the
leading "0x" prefix.
gdb/ChangeLog:
* remote.c (remote_get_tracepoint_status): Delete addrbuf
local variable. Avoid use of sprintf_vma.
PS: It looks like we're using sprintf_vma everywhere else for
printing breakpoint location addresses, and I thought that
we should change them as well. Except that CORE_ADDR is
a typedef of bfd_vma, so I guess that's OK. So maybe we
shouldn't commit the first half of my patch, as it avoids
the use of target_gdbarch, which always makes me uncomfortable.
But on the other hand, we avoid the use of that local bounded
buffer. Stan's choice.
--
Joel
next prev parent reply other threads:[~2011-11-26 20:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-26 19:39 [PATCH] Fix build on sparc David Miller
2011-11-26 20:14 ` Joel Brobecker [this message]
2011-11-26 20:32 ` [PATCH] Fix build on sparc (remote.c/tracepoints) David Miller
2011-11-26 20:51 ` Joel Brobecker
2011-11-26 23:42 ` Stan Shebs
2011-11-27 17:44 ` Joel Brobecker
2011-11-26 20:48 ` [PATCH] Fix build on sparc Jan Kratochvil
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=20111126201404.GA24943@adacore.com \
--to=brobecker@adacore.com \
--cc=davem@davemloft.net \
--cc=gdb-patches@sourceware.org \
--cc=stan@codesourcery.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