* config/tc-dvp.c (VU_LABEL_PREFIX): New macro.
[deliverable/binutils-gdb.git] / gdb / remote-sim.c
index 713e539801e2c69a6ec623837d6c0c11cbb29db3..4ec4cd392470f99b802cc0be19b612c8aee6cabd 100644 (file)
@@ -337,8 +337,9 @@ gdb_os_error (p, va_alist)
 
 static void
 gdbsim_fetch_register (regno)
-int regno;
+     int regno;
 {
+  static int warn_user = 1;
   if (regno == -1) 
     {
       for (regno = 0; regno < NUM_REGS; regno++)
@@ -347,8 +348,18 @@ int regno;
   else if (reg_names[regno] != NULL && *reg_names[regno] != '\0')
     {
       char buf[MAX_REGISTER_RAW_SIZE];
-
-      sim_fetch_register (gdbsim_desc, regno, buf);
+      int nr_bytes = sim_fetch_register (gdbsim_desc, regno, buf, REGISTER_RAW_SIZE (regno));
+      if (nr_bytes == 0)
+       /* register not applicable, supply zero's */
+       memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+      else if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno)
+              && warn_user)
+       {
+         printf_unfiltered ("Size of register %s (%d) incorrect (%d instead of %d))",
+                            reg_names [regno], regno,
+                            nr_bytes, REGISTER_RAW_SIZE (regno));
+         warn_user = 0;
+       }
       supply_register (regno, buf);
       if (sr_get_debug ())
        {
@@ -362,7 +373,7 @@ int regno;
 
 static void
 gdbsim_store_register (regno)
-int regno;
+     int regno;
 {
   if (regno  == -1) 
     {
@@ -371,10 +382,12 @@ int regno;
     }
   else if (reg_names[regno] != NULL && *reg_names[regno] != '\0')
     {
-      /* FIXME: Until read_register() returns LONGEST, we have this.  */
       char tmp[MAX_REGISTER_RAW_SIZE];
+      int nr_bytes;
       read_register_gen (regno, tmp);
-      sim_store_register (gdbsim_desc, regno, tmp);
+      nr_bytes = sim_store_register (gdbsim_desc, regno, tmp, REGISTER_RAW_SIZE (regno));
+      if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno))
+       fatal ("Register size different to expected");
       if (sr_get_debug ())
        {
          printf_filtered ("gdbsim_store_register: %d", regno);
@@ -474,6 +487,8 @@ gdbsim_create_inferior (exec_file, args, env)
   inferior_pid = 42;
   insert_breakpoints (); /* Needed to get correct instruction in cache */
 
+  clear_proceed_status ();
+
   /* NB: Entry point already set by sim_create_inferior. */
   proceed ((CORE_ADDR)-1, TARGET_SIGNAL_DEFAULT, 0);
 }
@@ -506,7 +521,7 @@ gdbsim_open (args, from_tty)
 
   len = (7 + 1 /* gdbsim */
         + strlen (" -E little")
-        + strlen (" --arch=xxxxxxxxxx")
+        + strlen (" --architecture=xxxxxxxxxx")
         + (args ? strlen (args) : 0)
         + 50) /* slack */;
   arg_buf = (char *) alloca (len);
@@ -533,7 +548,7 @@ gdbsim_open (args, from_tty)
      explicitly specified */
   if (!target_architecture_auto)
     {
-      strcat (arg_buf, " --arch=");
+      strcat (arg_buf, " --architecture=");
       strcat (arg_buf, target_architecture->printable_name);
     }
   /* finally, any explicit args */
@@ -700,9 +715,8 @@ gdbsim_wait (pid, status)
     prev_sigint = osa.sa_handler;
   }
 #else
-  prev_sigint = signal (SIGINT, cntrl_c);
-#endif
   prev_sigint = signal (SIGINT, gdbsim_cntrl_c);
+#endif
   sim_resume (gdbsim_desc, resume_step,
              target_signal_to_host (resume_siggnal));
   signal (SIGINT, prev_sigint);
This page took 0.026069 seconds and 4 git commands to generate.