diff options
author | Luis Machado <luis.machado@linaro.org> | 2021-01-21 10:27:12 -0300 |
---|---|---|
committer | Luis Machado <luis.machado@linaro.org> | 2021-01-21 17:16:02 -0300 |
commit | d5d24e12f97e1db527a704d0f57e678d3552b55e (patch) | |
tree | 9061e8bc763882cb71d9a421f3bc150f90d91fa2 | |
parent | a59902a7c123512681bddc3fa90f271d4f089c35 (diff) | |
download | gdb-d5d24e12f97e1db527a704d0f57e678d3552b55e.zip gdb-d5d24e12f97e1db527a704d0f57e678d3552b55e.tar.gz gdb-d5d24e12f97e1db527a704d0f57e678d3552b55e.tar.bz2 |
Fix build errors for armhf
When building for 32-bit ARM, I ran into a couple build failures.
The first one seems to be caused by recent changes to warning switches,
leading to the following error:
--
In file included from gdb/coffread.c:35:0:
gdb/coffread.c: In function "void enter_linenos(file_ptr, int, int, objfile*)":
gdb/complaints.h:40:40: error: format "%ld" expects argument of type "long int", but argument 2 has type "file_ptr {aka long long int}" [-Werror=format=]
complaint_internal (FMT, ##__VA_ARGS__); \
^
gdb/coffread.c:1413:7: note: in expansion of macro "complaint"
complaint (_("Line number pointer %ld lower than start of line numbers"),
^~~~~~~~~
--
The other one is due to a narrowing conversion in valops.c:
--
gdb/valops.c: In function "value* value_assign(value*, value*)":
gdb/gdbtypes.h:1798:43: error: narrowing conversion of "type->type::length" from "ULONGEST {aka long long unsigned int}" to "size_t {aka unsigned int}" inside { } [-Werror=narrowing]
#define TYPE_LENGTH(thistype) (thistype)->length
~~~~~~~~~~~~^
gdb/valops.c:1252:9: note: in expansion of macro "TYPE_LENGTH"
TYPE_LENGTH (type)});
--
Fix both with the following patch. Validated with --enable-targets=all on
Ubuntu 18.04/20.04.
gdb/ChangeLog:
2021-01-21 Luis Machado <luis.machado@linaro.org>
* coffread.c (enter_linenos): Passing string to complaint.
* valops.c (value_assign): Make array view.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/coffread.c | 4 | ||||
-rw-r--r-- | gdb/valops.c | 6 |
3 files changed, 11 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2d820d2..83c1de9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2021-01-21 Luis Machado <luis.machado@linaro.org> + + * coffread.c (enter_linenos): Passing string to complaint. + * valops.c (value_assign): Make array view. + 2021-01-21 Simon Marchi <simon.marchi@polymtl.ca> * auto-load.h (debug_auto_load): Move here. diff --git a/gdb/coffread.c b/gdb/coffread.c index 3b59ba9..77752bc 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1410,8 +1410,8 @@ enter_linenos (file_ptr file_offset, int first_line, return; if (file_offset < linetab_offset) { - complaint (_("Line number pointer %ld lower than start of line numbers"), - file_offset); + complaint (_("Line number pointer %s lower than start of line numbers"), + plongest (file_offset)); if (file_offset > linetab_size) /* Too big to be an offset? */ return; file_offset += linetab_offset; /* Try reading at that linetab diff --git a/gdb/valops.c b/gdb/valops.c index 882f6e7..d0d5628 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1246,10 +1246,12 @@ value_assign (struct value *toval, struct value *fromval) } else { + gdb::array_view<const gdb_byte> contents + = gdb::make_array_view (value_contents (fromval), + TYPE_LENGTH (type)); put_frame_register_bytes (frame, value_reg, value_offset (toval), - {value_contents (fromval), - TYPE_LENGTH (type)}); + contents); } } |