Fix compilation error

gdb-rhbz795424-bitpos-20of25 was written before RISC-V was added
in GDB. This brings minimal modification to avoid compilation errors.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
This commit is contained in:
David Abdurachmanov 2019-01-23 20:03:27 +01:00
parent 904be0c6d3
commit 83c052e49a
Signed by: davidlt
GPG Key ID: 7108702C938B13C1
4 changed files with 63 additions and 0 deletions

View File

@ -481,3 +481,6 @@ Patch116: gdb-rhbz795424-bitpos-arrayview.patch
# BUILDSTDERR: | ^~~~
Patch117: gdb-fix-bfd-error-temp.patch
# Same as gdb-rhbz795424-bitpos-20of25, but for RISC-V
# (which was added alter on)
Patch130: gdb-rhbz795424-bitpos-20of25-riscv.patch

View File

@ -115,3 +115,4 @@
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch130 -p1

View File

@ -115,3 +115,4 @@ gdb-vla-intel-fix-print-char-array.patch
gdb-rhbz1553104-s390x-arch12-test.patch
gdb-rhbz795424-bitpos-arrayview.patch
gdb-fix-bfd-error-temp.patch
gdb-rhbz795424-bitpos-20of25-riscv.patch

View File

@ -0,0 +1,58 @@
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 7a21efc..706b5b4 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -1623,7 +1623,7 @@ riscv_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
/* Compute the alignment of the type T. Used while setting up the
arguments for a dummy call. */
-static int
+static LONGEST
riscv_type_alignment (struct type *t)
{
t = check_typedef (t);
@@ -1644,7 +1644,7 @@ riscv_type_alignment (struct type *t)
case TYPE_CODE_ARRAY:
if (TYPE_VECTOR (t))
- return std::min (TYPE_LENGTH (t), (unsigned) BIGGEST_ALIGNMENT);
+ return std::min (TYPE_LENGTH (t), (ULONGEST) BIGGEST_ALIGNMENT);
/* FALLTHROUGH */
case TYPE_CODE_COMPLEX:
@@ -2134,7 +2134,7 @@ riscv_call_arg_struct (struct riscv_arg_info *ainfo,
&& TYPE_LENGTH (sinfo.field_type (1)) <= cinfo->flen
&& riscv_arg_regs_available (&cinfo->float_regs) >= 2)
{
- int len0, len1, offset;
+ LONGEST len0, len1, offset;
gdb_assert (TYPE_LENGTH (ainfo->type) <= (2 * cinfo->flen));
@@ -2162,7 +2162,7 @@ riscv_call_arg_struct (struct riscv_arg_info *ainfo,
&& is_integral_type (sinfo.field_type (1))
&& TYPE_LENGTH (sinfo.field_type (1)) <= cinfo->xlen))
{
- int len0, len1, offset;
+ LONGEST len0, len1, offset;
len0 = TYPE_LENGTH (sinfo.field_type (0));
if (!riscv_assign_reg_location (&ainfo->argloc[0],
@@ -2185,7 +2185,7 @@ riscv_call_arg_struct (struct riscv_arg_info *ainfo,
&& TYPE_CODE (sinfo.field_type (1)) == TYPE_CODE_FLT
&& TYPE_LENGTH (sinfo.field_type (1)) <= cinfo->flen))
{
- int len0, len1, offset;
+ LONGEST len0, len1, offset;
len0 = TYPE_LENGTH (sinfo.field_type (0));
len1 = TYPE_LENGTH (sinfo.field_type (1));
@@ -2588,7 +2588,7 @@ riscv_return_value (struct gdbarch *gdbarch,
if (readbuf != nullptr || writebuf != nullptr)
{
- unsigned int arg_len;
+ ULONGEST arg_len;
struct value *abi_val;
gdb_byte *old_readbuf = nullptr;
int regnum;