Pass dwarf2_cu objects to dwo-related functions, instead of dwarf2_per_cu_data
[deliverable/binutils-gdb.git] / gdb / h8300-tdep.c
index 2a3d37408587ff1133ec0ca3585380d71e424d15..b569a23f2631cfb1f69d16e639734070b2b24cca 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-machine dependent code for Renesas H8/300, for GDB.
 
-   Copyright (C) 1988-2019 Free Software Foundation, Inc.
+   Copyright (C) 1988-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -29,7 +29,7 @@
 #include "gdbcore.h"
 #include "objfiles.h"
 #include "dis-asm.h"
-#include "dwarf2-frame.h"
+#include "dwarf2/frame.h"
 #include "frame-base.h"
 #include "frame-unwind.h"
 
@@ -178,10 +178,10 @@ h8300_is_argument_spill (struct gdbarch *gdbarch, CORE_ADDR pc)
       if (IS_MOVB_Rn24_SP (read_memory_unsigned_integer (pc + 2,
                                                         2, byte_order)))
        {
-         LONGEST disp = read_memory_integer (pc + 4, 4, byte_order);
+         ULONGEST disp = read_memory_unsigned_integer (pc + 4, 4, byte_order);
 
          /* ... and d:24 is negative.  */
-         if (disp < 0 && disp > 0xffffff)
+         if ((disp & 0x00800000) != 0)
            return 8;
        }
     }
@@ -197,10 +197,10 @@ h8300_is_argument_spill (struct gdbarch *gdbarch, CORE_ADDR pc)
       if (IS_MOVW_Rn24_SP (read_memory_unsigned_integer (pc + 2,
                                                         2, byte_order)))
        {
-         LONGEST disp = read_memory_integer (pc + 4, 4, byte_order);
+         ULONGEST disp = read_memory_unsigned_integer (pc + 4, 4, byte_order);
 
          /* ... and d:24 is negative.  */
-         if (disp < 0 && disp > 0xffffff)
+         if ((disp & 0x00800000) != 0)
            return 8;
        }
     }
@@ -219,10 +219,11 @@ h8300_is_argument_spill (struct gdbarch *gdbarch, CORE_ADDR pc)
        {
          if (IS_MOVL_Rn24_SP (read_memory_integer (pc + 4, 2, byte_order)))
            {
-             LONGEST disp = read_memory_integer (pc + 6, 4, byte_order);
+             ULONGEST disp = read_memory_unsigned_integer (pc + 6, 4,
+                                                           byte_order);
 
              /* ... and d:24 is negative.  */
-             if (disp < 0 && disp > 0xffffff)
+             if ((disp & 0x00800000) != 0)
                return 10;
            }
        }
@@ -740,7 +741,7 @@ h8300_extract_return_value (struct type *type, struct regcache *regcache,
       store_unsigned_integer (valbuf + 2, 2, byte_order, c);
       break;
     case 8:                    /* long long is now 8 bytes.  */
-      if (TYPE_CODE (type) == TYPE_CODE_INT)
+      if (type->code () == TYPE_CODE_INT)
        {
          regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &addr);
          c = read_memory_unsigned_integer ((CORE_ADDR) addr, len, byte_order);
@@ -771,7 +772,7 @@ h8300h_extract_return_value (struct type *type, struct regcache *regcache,
       store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c);
       break;
     case 8:                    /* long long is now 8 bytes.  */
-      if (TYPE_CODE (type) == TYPE_CODE_INT)
+      if (type->code () == TYPE_CODE_INT)
        {
          regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
          store_unsigned_integer (valbuf, 4, byte_order, c);
@@ -792,8 +793,8 @@ h8300_use_struct_convention (struct type *value_type)
   /* Types of 1, 2 or 4 bytes are returned in R0/R1, everything else on the
      stack.  */
 
-  if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
-      || TYPE_CODE (value_type) == TYPE_CODE_UNION)
+  if (value_type->code () == TYPE_CODE_STRUCT
+      || value_type->code () == TYPE_CODE_UNION)
     return 1;
   return !(TYPE_LENGTH (value_type) == 1
           || TYPE_LENGTH (value_type) == 2
@@ -805,14 +806,14 @@ h8300h_use_struct_convention (struct type *value_type)
 {
   /* Types of 1, 2 or 4 bytes are returned in R0, INT types of 8 bytes are
      returned in R0/R1, everything else on the stack.  */
-  if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
-      || TYPE_CODE (value_type) == TYPE_CODE_UNION)
+  if (value_type->code () == TYPE_CODE_STRUCT
+      || value_type->code () == TYPE_CODE_UNION)
     return 1;
   return !(TYPE_LENGTH (value_type) == 1
           || TYPE_LENGTH (value_type) == 2
           || TYPE_LENGTH (value_type) == 4
           || (TYPE_LENGTH (value_type) == 8
-              && TYPE_CODE (value_type) == TYPE_CODE_INT));
+              && value_type->code () == TYPE_CODE_INT));
 }
 
 /* Function: store_return_value
@@ -1343,7 +1344,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   frame_base_set_default (gdbarch, &h8300_frame_base);
 
   /* 
-   * Miscelany
+   * Miscellany
    */
   /* Stack grows up.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -1377,8 +1378,9 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
 }
 
+void _initialize_h8300_tdep ();
 void
-_initialize_h8300_tdep (void)
+_initialize_h8300_tdep ()
 {
   register_gdbarch_init (bfd_arch_h8300, h8300_gdbarch_init);
 }
This page took 0.025794 seconds and 4 git commands to generate.