diff options
author | Alan Modra <amodra@gmail.com> | 2017-09-26 11:28:04 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-09-26 13:39:35 +0930 |
commit | 66cfc0fd0d9daadc2dac5a783b69b4050c0b1722 (patch) | |
tree | c4bfe4c81311d9fd53ab1ce6e81b676554ee6689 /binutils/dwarf.c | |
parent | 6c3e20f177102519cf4f8b3c7e7e17996ed7cd7f (diff) | |
download | gdb-66cfc0fd0d9daadc2dac5a783b69b4050c0b1722.zip gdb-66cfc0fd0d9daadc2dac5a783b69b4050c0b1722.tar.gz gdb-66cfc0fd0d9daadc2dac5a783b69b4050c0b1722.tar.bz2 |
PR21732, String-concatenated message can not be translated
Preprocessor tokens like DWARF_VMA_FMT and BFD_VMA_FMT are not
understood by gettext, and cause the translation string to be
truncated. Even if it were not truncated, we wouldn't want a value
that changes depending on host or configure options to be put in a
translation string.
PR 21732
* dwarf.c (READ_ULEB): Don't use DWARF_VMA_FMT in translated string.
(READ_SLEB): Likewise.
* readelf.c (bfd_vmatoa): New function.
(get_data, get_dynamic_data): Use it for printing error messages.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r-- | binutils/dwarf.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index af8732b..d4156e4 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -353,8 +353,9 @@ read_uleb128 (unsigned char * data, \ (var) = _val = read_uleb128 (start, &length_return, end); \ if ((var) != _val) \ - error (_("Internal error: %s%d: LEB value (%#" DWARF_VMA_FMT "x) too large for containing variable\n"), \ - __FILE__, __LINE__, _val); \ + error (_("Internal error: %s:%d: LEB value (%s) " \ + "too large for containing variable\n"), \ + __FILE__, __LINE__, dwarf_vmatoa ("u", _val)); \ start += length_return; \ } \ while (0) @@ -366,8 +367,9 @@ read_uleb128 (unsigned char * data, \ (var) = _val = read_sleb128 (start, &length_return, end); \ if ((var) != _val) \ - error (_("Internal error: %s%d: LEB value (%#" DWARF_VMA_FMT "x) too large for containing variable\n"), \ - __FILE__, __LINE__, _val); \ + error (_("Internal error: %s:%d: LEB value (%s) " \ + "too large for containing variable\n"), \ + __FILE__, __LINE__, dwarf_vmatoa ("d", _val)); \ start += length_return; \ } \ while (0) |