Makefile.in: Add gen-zero-r0 option.
[deliverable/binutils-gdb.git] / gdb / h8300-tdep.c
index c0250f51be9c129bd3e871428a75f9ce8881debb..f992d4bd6b9f8a92baac957875bfb90c79c551d3 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "defs.h"
 #include "frame.h"
-#include "obstack.h"
 #include "symtab.h"
 #include "dis-asm.h"
 #include "gdbcmd.h"
@@ -54,19 +53,18 @@ extern int h8300hmode, h8300smode;
 #define IS_MOVK_R5(x) (x==0x7905)
 #define IS_SUB_R5SP(x) (x==0x1957)
 
-
 /* The register names change depending on whether the h8300h processor
    type is selected. */
 
 static char *original_register_names[] = REGISTER_NAMES;
 
-static char *h8300h_register_names[] =
-{"er0", "er1", "er2", "er3", "er4", "er5", "er6",
- "sp", "ccr","pc", "cycles", "exr", "tick", "inst"};
+static char *h8300h_register_names[] = {
+  "er0", "er1", "er2", "er3", "er4", "er5", "er6",
+  "sp", "ccr", "pc", "cycles", "exr", "tick", "inst"
+};
 
 char **h8300_register_names = original_register_names;
 
-
 /* Local function declarations.  */
 
 static CORE_ADDR examine_prologue ();
@@ -143,7 +141,7 @@ h8300_skip_prologue (CORE_ADDR start_pc)
 }
 
 int
-gdb_print_insn_h8300 (bfd_vma memaddr, disassemble_info *info)
+gdb_print_insn_h8300 (bfd_vma memaddr, disassemble_info * info)
 {
   if (h8300smode)
     return print_insn_h8300s (memaddr, info);
@@ -228,7 +226,7 @@ h8300_frame_find_saved_regs (struct frame_info *fi,
    of the instruction. */
 
 CORE_ADDR
-NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, INSN_WORD *pword1)
+NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, INSN_WORD * pword1)
 {
   char buf[2];
   if (addr < lim + 8)
@@ -391,14 +389,16 @@ examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
   /* Locals are always reffed based from the fp */
   fi->locals_pointer = after_prolog_fp;
   /* The PC is at a known place */
-  fi->from_pc = read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD);
+  fi->from_pc =
+    read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD);
 
   /* Rememeber any others too */
   in_frame[PC_REGNUM] = 0;
 
   if (have_fp)
     /* We keep the old FP in the SP spot */
-    fsr->regs[SP_REGNUM] = read_memory_unsigned_integer (fsr->regs[6], BINWORD);
+    fsr->regs[SP_REGNUM] =
+      read_memory_unsigned_integer (fsr->regs[6], BINWORD);
   else
     fsr->regs[SP_REGNUM] = after_prolog_fp + auto_depth;
 
@@ -532,8 +532,7 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
   sp = sp & ~stack_align;
 
   /* Now make sure there's space on the stack */
-  for (argnum = 0, stack_alloc = 0;
-       argnum < nargs; argnum++)
+  for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
     stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + stack_align)
                    & ~stack_align);
   sp -= stack_alloc;           /* make room on stack for args */
@@ -564,8 +563,9 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
       else
        val = (char *) VALUE_CONTENTS (args[argnum]);
 
-      if (len > (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM) ||
-         (len > wordsize && (len & stack_align) != 0))
+      if (len >
+         (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM)
+         || (len > wordsize && (len & stack_align) != 0))
        {                       /* passed on the stack */
          write_memory (sp + stack_offset, val,
                        len < wordsize ? wordsize : len);
@@ -574,7 +574,8 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
       /* NOTE WELL!!!!!  This is not an "else if" clause!!!
          That's because some *&^%$ things get passed on the stack
          AND in the registers!   */
-      if (len <= (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM))
+      if (len <=
+         (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM))
        while (len > 0)
          {                     /* there's room in registers */
            regval = extract_address (val, wordsize);
@@ -766,7 +767,6 @@ h8300s_command (char *args, int from_tty)
   set_register_names ();
 }
 
-
 static void
 set_machine (char *args, int from_tty)
 {
@@ -807,8 +807,7 @@ _initialize_h8300m (void)
 {
   add_prefix_cmd ("machine", no_class, set_machine,
                  "set the machine type",
-                 &setmemorylist, "set machine ", 0,
-                 &setlist);
+                 &setmemorylist, "set machine ", 0, &setlist);
 
   add_cmd ("h8300", class_support, h8300_command,
           "Set machine to be H8/300.", &setmemorylist);
@@ -824,8 +823,6 @@ _initialize_h8300m (void)
   specify_exec_file_hook (set_machine_hook);
 }
 
-
-
 void
 h8300_print_register_hook (int regno)
 {
@@ -880,11 +877,11 @@ h8300_print_register_hook (int regno)
       frame_register_read (selected_frame, regno, b);
       l = b[REGISTER_VIRTUAL_SIZE (EXR_REGNUM) - 1];
       printf_unfiltered ("\t");
-      printf_unfiltered ("T-%d - - - ",  (l & 0x80) != 0);
+      printf_unfiltered ("T-%d - - - ", (l & 0x80) != 0);
       printf_unfiltered ("I2-%d ", (l & 4) != 0);
       printf_unfiltered ("I1-%d ", (l & 2) != 0);
       printf_unfiltered ("I0-%d", (l & 1) != 0);
-     }
+    }
 }
 
 void
This page took 0.082931 seconds and 4 git commands to generate.