This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix build on sparc (remote.c/tracepoints)


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]