1999-02-02 Martin Hunt <hunt@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / remote-array.c
index f7878ecd6a34ba27a646b8469ee0347ab3466b2b..624871cff020d30083889d0150d6eed3e16ec4fc 100644 (file)
@@ -1,5 +1,5 @@
 /* Remote debugging interface for Array Tech RAID controller..
-   Copyright 90, 91, 92, 93, 94, 1995  Free Software Foundation, Inc.
+   Copyright 90, 91, 92, 93, 94, 1995, 1998  Free Software Foundation, Inc.
    Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
 
    This module talks to a debug monitor called 'MONITOR', which
@@ -90,7 +90,7 @@ static int from_hex();
 static int array_send_packet();
 static int array_get_packet();
 static unsigned long ascii2hexword();
-static char *hexword2ascii();
+static void hexword2ascii();
 
 extern char *version;
 
@@ -123,7 +123,9 @@ extern char *tmp_mips_processor_type;
 extern int mips_set_processor_type();
 
 static struct target_ops array_ops ;
-static void init_array_ops(void)
+
+static void 
+init_array_ops(void)
 {
   array_ops.to_shortname =   "array";  
   array_ops.to_longname =              
@@ -133,10 +135,14 @@ static void init_array_ops(void)
 Specify the serial device it is connected to (e.g. /dev/ttya)." ;
   array_ops.to_open =   array_open;    
   array_ops.to_close =   array_close;  
-  array_ops.to_attach =   NULL;                
+  array_ops.to_attach =   NULL;
+  array_ops.to_post_attach = NULL;             
+  array_ops.to_require_attach = NULL;
   array_ops.to_detach =   array_detach;        
+  array_ops.to_require_detach = NULL;
   array_ops.to_resume =   array_resume;        
   array_ops.to_wait  =   array_wait;   
+  array_ops.to_post_wait = NULL;
   array_ops.to_fetch_registers  =   array_fetch_registers;
   array_ops.to_store_registers  =   array_store_registers;
   array_ops.to_prepare_to_store =   array_prepare_to_store;
@@ -153,11 +159,30 @@ Specify the serial device it is connected to (e.g. /dev/ttya)." ;
   array_ops.to_load  =   0;                    
   array_ops.to_lookup_symbol =   0;            
   array_ops.to_create_inferior =   array_create_inferior;      
+  array_ops.to_post_startup_inferior = NULL;
+  array_ops.to_acknowledge_created_inferior = NULL;
+  array_ops.to_clone_and_follow_inferior = NULL;          
+  array_ops.to_post_follow_inferior_by_clone = NULL;  
+  array_ops.to_insert_fork_catchpoint = NULL;
+  array_ops.to_remove_fork_catchpoint = NULL;
+  array_ops.to_insert_vfork_catchpoint = NULL;
+  array_ops.to_remove_vfork_catchpoint = NULL;                      
+  array_ops.to_has_forked = NULL;
+  array_ops.to_has_vforked = NULL;            
+  array_ops.to_can_follow_vfork_prior_to_exec = NULL;            
+  array_ops.to_post_follow_vfork = NULL;
+  array_ops.to_insert_exec_catchpoint = NULL;
+  array_ops.to_remove_exec_catchpoint = NULL;
+  array_ops.to_has_execd = NULL;
+  array_ops.to_reported_exec_events_per_exec_call = NULL;
+  array_ops.to_has_exited = NULL;
   array_ops.to_mourn_inferior =   array_mourn_inferior;                
   array_ops.to_can_run  =   0;         
   array_ops.to_notice_signals =   0;   
   array_ops.to_thread_alive  =   0;    
-  array_ops.to_stop  =   0;             
+  array_ops.to_stop  =   0;
+  array_ops.to_pid_to_exec_file = NULL;
+  array_ops.to_core_file_to_sym_file = NULL;         
   array_ops.to_stratum =   process_stratum;    
   array_ops.DONT_USE =   0;                    
   array_ops.to_has_all_memory =   1;           
@@ -530,7 +555,7 @@ array_create_inferior (execfile, args, env)
     error("Can't pass arguments to remote MONITOR process");
 
   if (execfile == 0 || exec_bfd == 0)
-    error("No exec file specified");
+    error("No executable file specified");
 
   entry_pt = (int) bfd_get_start_address (exec_bfd);
 
@@ -602,9 +627,9 @@ array_open(args, name, from_tty)
   log_file = fopen (LOG_FILE, "w");
   if (log_file == NULL)
     perror_with_name (LOG_FILE);
-  fprintf_filtered (log_file, "GDB %s (%s", version);
-  fprintf_filtered (log_file, " --target %s)\n", array_ops.to_shortname);
-  fprintf_filtered (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name);
+  fprintf (log_file, "GDB %s (%s", version);
+  fprintf (log_file, " --target %s)\n", array_ops.to_shortname);
+  fprintf (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name);
 #endif
 
   /* see if the target is alive. For a ROM monitor, we can just try to force the
@@ -749,7 +774,7 @@ array_wait (pid, status)
        i = 0;
       }
       fputc_unfiltered (c, gdb_stdout);
-      fflush (stdout);
+      gdb_flush (gdb_stdout);
     }
     c = SERIAL_READCHAR(tty_desc, timeout);
     if (c > 0) {
@@ -759,7 +784,7 @@ array_wait (pid, status)
        break;
 #if 0
       fputc_unfiltered (c, gdb_stdout);
-      fflush (stdout);
+      gdb_flush (gdb_stdout);
 #endif
     }
   }
@@ -1050,7 +1075,6 @@ array_mourn_inferior ()
 
 #define MAX_ARRAY_BREAKPOINTS 16
 
-extern int memory_breakpoint_size;
 static CORE_ADDR breakaddr[MAX_ARRAY_BREAKPOINTS] = {0};
 
 /*
@@ -1062,15 +1086,18 @@ array_insert_breakpoint (addr, shadow)
      char *shadow;
 {
   int i;
+  int bp_size = 0;
+  CORE_ADDR bp_addr = addr;
 
   debuglogs (1, "array_insert_breakpoint() addr = 0x%x", addr);
+  BREAKPOINT_FROM_PC (&bp_addr, &bp_size);
 
   for (i = 0; i <= MAX_ARRAY_BREAKPOINTS; i++) {
     if (breakaddr[i] == 0) {
       breakaddr[i] = addr;
       if (sr_get_debug() > 4)
        printf ("Breakpoint at %x\n", addr);
-      array_read_inferior_memory(addr, shadow, memory_breakpoint_size);
+      array_read_inferior_memory (bp_addr, shadow, bp_size);
       printf_monitor("b 0x%x\n", addr);
       expect_prompt(1);
       return 0;
@@ -1363,6 +1390,7 @@ array_get_packet (packet)
       }
     }
   }
+  return 0; /* exceeded retries */
 }
 
 /*
@@ -1396,7 +1424,7 @@ ascii2hexword (mem)
  * ascii2hexword -- convert a hex value to an ascii number represented by 8
  *     digits.
  */
-static char*
+static void
 hexword2ascii (mem, num)
      unsigned char *mem;
      unsigned long num;
This page took 0.025318 seconds and 4 git commands to generate.