This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix build on sparc (remote.c/tracepoints)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: David Miller <davem at davemloft dot net>, stan at codesourcery dot com
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 26 Nov 2011 12:14:04 -0800
- Subject: Re: [PATCH] Fix build on sparc (remote.c/tracepoints)
- References: <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