From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Kai Tietz'" <ktietz70@googlemail.com>
Cc: "'Binutils'" <binutils@sourceware.org>
Subject: RE: [RFC patch]: Adjust the use of 'long' type in dwarf2.h header
Date: Wed, 23 Feb 2011 15:12:00 -0000 [thread overview]
Message-ID: <000301cbd36c$1c8c3330$55a49990$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <AANLkTi=v4XEzssnXK8z91n80jMe9bhtZh+2PtXY+_4vR@mail.gmail.com>
Kai,
please excuse me for asking this so late,
but I don't really understand why you had to introduce
a new 'dwarf_vma' type when we already have a 'bfd_signed_vma'
type that must be signed 64-bit as soon as
BFD64 macro is defined...
See definitions in bfd/bfd-in.h or bfd/bfd-in2.h
This macro should be set if any of the supported target is a 64-bit target
so it should be possible to use that type, no?
But of course, I might be missing some important point,
could you please explain to me in which case
a 64-bit dwarf_vma could be necessary without BFD64 being set.
Pierre Muller
GDB pascal language maintainer
> -----Message d'origine-----
> De : binutils-owner@sourceware.org [mailto:binutils-
> owner@sourceware.org] De la part de Kai Tietz
> Envoyé : mercredi 23 février 2011 10:00
> À : Nick Clifton
> Cc : Pierre Muller; GCC Patches; Binutils; gdb; Jakub Jelinek; Joel
> Brobecker
> Objet : Re: [RFC patch]: Adjust the use of 'long' type in dwarf2.h
> header
>
> 2011/2/22 Nick Clifton <nickc@redhat.com>:
> > Hi Kai,
> >
> >
> >> So this version uses new function dwarf_vma_print function for
> >> printf-messages, which are getting localized.
> >>
> >> Tested for x86_64-w64-mingw32 and x86_64-pc-linux-gnu. Ok for apply?
> >
> >> +static const char *
> >> +dwarf_vma_print (const char *fmtch, bfd_vma value)
> >
> > I think that I prefer your suggestion of dwarf_vmatoa.
> >
> >> +{
> >> + static int buf_pos = 0;
> >> + static struct dwarf_vma_print_buf {
> >> + char place[64];
> >> + } buf[16];
> >
> > Ideally you should have a comment here explaining why you have an
> array of
> > these string buffers.
> >
> >> + char fmt[32];
> >> + char *ret;
> >> +
> >> + sprintf (fmt, "%%%s%s", BFD_VMA_FMT, fmtch);
> >> + ret = &buf[buf_pos++].place[0];
> >
> > Or, more simply:
> >
> > ret = buf[buf_pos++].place;
> >
> >> + buf_pos &= 15;
> >
> > That "15" should be: "ARRAY_SIZE (buf) - 1", and it would be safer to
> write:
> >
> > buf_pos %= ARRAY_SIZE (buf);
> >
> > and leave it to the compiler to optimize this into an AND operation
> if it
> > can.
> >
> >> snprintf (ret, 64, fmt, value);
> >
> > And the "64" here should be "sizeof (buf[0].place)".
> >
> > Cheers
> > Nick
> >
> >
>
> Hello Nick,
>
> adjust the binutils part as you suggested. Applied to binutils and gcc
> (rev. 170433) tree.
>
> Regards,
> Kai
next prev parent reply other threads:[~2011-02-23 15:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-17 14:21 Kai Tietz
2011-02-17 18:59 ` Kai Tietz
2011-02-17 19:03 ` Jakub Jelinek
2011-02-17 19:07 ` Kai Tietz
2011-02-17 19:17 ` Jakub Jelinek
2011-02-18 9:50 ` Kai Tietz
2011-02-21 12:37 ` NightStrike
2011-02-21 13:10 ` Pierre Muller
[not found] ` <-8460070221060995487@unknownmsgid>
2011-02-21 13:27 ` Kai Tietz
2011-02-21 13:46 ` Pierre Muller
[not found] ` <-6930711422310680743@unknownmsgid>
2011-02-21 14:30 ` Kai Tietz
2011-02-21 15:25 ` Kai Tietz
2011-02-21 15:43 ` Mark Kettenis
2011-02-21 15:53 ` Kai Tietz
2011-02-22 15:21 ` Nick Clifton
2011-02-23 8:59 ` Kai Tietz
2011-02-23 15:12 ` Pierre Muller [this message]
[not found] ` <-2339605939192327273@unknownmsgid>
2011-02-23 17:42 ` Kai Tietz
2011-02-23 21:55 ` Pierre Muller
[not found] ` <-3886800211494155692@unknownmsgid>
2011-02-23 22:51 ` H.J. Lu
2011-02-24 11:33 ` Pierre Muller
[not found] ` <1561346207520594884@unknownmsgid>
2011-02-24 13:50 ` H.J. Lu
2011-02-25 10:40 ` [RFC] Use only dwarf_vma types in dwarf code (was RE: [RFC patch]: Adjust the use of 'long' type in dwarf2.h header) Pierre Muller
[not found] ` <5095785081977025060@unknownmsgid>
2011-02-25 12:23 ` Kai Tietz
2011-02-25 13:31 ` Pierre Muller
2011-02-25 13:35 ` [RFC-v2] Use only dwarf_vma types in dwarf code Pierre Muller
2011-03-25 15:16 ` Nick Clifton
2011-03-25 15:48 ` [RFA] Supplemtal patch for use " Pierre Muller
2011-03-25 18:04 ` Nick Clifton
2011-03-25 21:44 ` Pierre Muller
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='000301cbd36c$1c8c3330$55a49990$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=binutils@sourceware.org \
--cc=ktietz70@googlemail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).