aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-11-20 11:17:32 -0500
committerSimon Marchi <simon.marchi@efficios.com>2020-11-20 11:19:19 -0500
commita43b29c90d8efa1013cb4b6bc49bb78de5e79784 (patch)
tree522bb10f51a7533b30d55429c44c60d38ef89de5 /gdb
parent14f62a099a0287c858ac7f4882e88736c11ed1cc (diff)
downloadfsf-binutils-gdb-a43b29c90d8efa1013cb4b6bc49bb78de5e79784.zip
fsf-binutils-gdb-a43b29c90d8efa1013cb4b6bc49bb78de5e79784.tar.gz
fsf-binutils-gdb-a43b29c90d8efa1013cb4b6bc49bb78de5e79784.tar.bz2
gdb: fix dwarf2/read.c build on solaris
When building on solaris (gcc farm machine gcc211), I get: CXX dwarf2/read.o /export/home/simark/src/binutils-gdb/gdb/dwarf2/read.c: In function 'void finish_fixed_point_type(type*, die_info*, dwarf2_cu*)': /export/home/simark/src/binutils-gdb/gdb/dwarf2/read.c:18204:42: error: call of overloaded 'abs(LONGEST&)' is ambiguous *num_or_denom = 1 << abs (scale_exp); ^ In file included from /usr/include/stdlib.h:11:0, from ../gnulib/import/stdlib.h:36, from /opt/csw/include/c++/5.5.0/cstdlib:72, from /export/home/simark/src/binutils-gdb/gdb/../gdbsupport/common-defs.h:90, from /export/home/simark/src/binutils-gdb/gdb/defs.h:28, from /export/home/simark/src/binutils-gdb/gdb/dwarf2/read.c:31: /opt/csw/lib/gcc/sparc-sun-solaris2.10/5.5.0/include-fixed/iso/stdlib_iso.h:163:16: note: candidate: long int std::abs(long int) inline long abs(long _l) { return labs(_l); } ^ /opt/csw/lib/gcc/sparc-sun-solaris2.10/5.5.0/include-fixed/iso/stdlib_iso.h:117:12: note: candidate: int std::abs(int) extern int abs(int); ^ I don't know why, but using std::abs instead of just abs fixes it. gdb/ChangeLog: * dwarf2/read.c (finish_fixed_point_type): Use std::abs instead of abs. Change-Id: I57b9098351f2a8b2d2f61e848b97f7b2dfe55908
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2/read.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0fb0997..9106860 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-11-20 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * dwarf2/read.c (finish_fixed_point_type): Use std::abs instead
+ of abs.
+
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* ctfread.c (elfctf_build_psymtabs): Use ctf_dict_open, not
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 3c5982629..f879753 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -18201,14 +18201,14 @@ finish_fixed_point_type (struct type *type, struct die_info *die,
LONGEST scale_exp = attr->constant_value (0);
ULONGEST *num_or_denom = scale_exp > 0 ? &scale_num : &scale_denom;
- *num_or_denom = 1 << abs (scale_exp);
+ *num_or_denom = 1 << std::abs (scale_exp);
}
else if (attr->name == DW_AT_decimal_scale)
{
LONGEST scale_exp = attr->constant_value (0);
ULONGEST *num_or_denom = scale_exp > 0 ? &scale_num : &scale_denom;
- *num_or_denom = uinteger_pow (10, abs (scale_exp));
+ *num_or_denom = uinteger_pow (10, std::abs (scale_exp));
}
else if (attr->name == DW_AT_small)
{