diff options
author | Alan Modra <amodra@gmail.com> | 2014-12-11 16:02:35 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-12-11 17:07:46 +1030 |
commit | 4c219c2e69bb66a5535645e2c83fafda1362acea (patch) | |
tree | 10dd7e49bfa50e1c721ee6b938330e0c9884960e /binutils/dwarf.c | |
parent | 1b43a4392f2c979e77a9fef16877ec99b9cf26a3 (diff) | |
download | gdb-4c219c2e69bb66a5535645e2c83fafda1362acea.zip gdb-4c219c2e69bb66a5535645e2c83fafda1362acea.tar.gz gdb-4c219c2e69bb66a5535645e2c83fafda1362acea.tar.bz2 |
Use autoconf check for long long in binutils
Also fix a place where %lld was wrongly used to print a dwarf_vma.
* configure.ac: Check for long long and sizes of long long and long.
* elfcomm.h (HOST_WIDEST_INT): Test HAVE_LONG_LONG in place of
__STDC_VERSION__ and __GNUC__.
* strings.c (print_strings): Likewise.
* dwarf.c (DWARF_VMA_FMT, DWARF_VMA_FMT_LONG): Likewise.
(read_debug_line_header): Use dwarf_vmatoa to print warning.
* configure: Regenerate.
* config.in: Regenerate.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r-- | binutils/dwarf.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 4e37038..02b7668 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -162,17 +162,17 @@ get_encoded_value (unsigned char **pdata, return val; } -#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) -#ifndef __MINGW32__ -#define DWARF_VMA_FMT "ll" -#define DWARF_VMA_FMT_LONG "%16.16llx" +#if defined HAVE_LONG_LONG && SIZEOF_LONG_LONG > SIZEOF_LONG +# ifndef __MINGW32__ +# define DWARF_VMA_FMT "ll" +# define DWARF_VMA_FMT_LONG "%16.16llx" +# else +# define DWARF_VMA_FMT "I64" +# define DWARF_VMA_FMT_LONG "%016I64x" +# endif #else -#define DWARF_VMA_FMT "I64" -#define DWARF_VMA_FMT_LONG "%016I64x" -#endif -#else -#define DWARF_VMA_FMT "l" -#define DWARF_VMA_FMT_LONG "%16.16lx" +# define DWARF_VMA_FMT "l" +# define DWARF_VMA_FMT_LONG "%16.16lx" #endif /* Convert a dwarf vma value into a string. Returns a pointer to a static @@ -2757,7 +2757,8 @@ read_debug_line_header (struct dwarf_section * section, /* PR 17512: file:002-117414-0.004. */ if (* end_of_sequence > end) { - warn (_("Line length %lld extends beyond end of section\n"), linfo->li_length); + warn (_("Line length %s extends beyond end of section\n"), + dwarf_vmatoa ("u", linfo->li_length)); * end_of_sequence = end; return NULL; } |