1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / v850ice.c
index bbf5b9e41c276d251b94f465376c706fc23f4351..36784c082fe659c527c9bb0b14e8856bd94750b7 100755 (executable)
@@ -4,7 +4,7 @@
 This file is part of GDB.
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Pessublic License as published by
+it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 
@@ -124,6 +124,9 @@ static void togdb_force_update PARAMS ((void));
 
 static void view_source PARAMS ((CORE_ADDR));
 
+static void do_gdb (char *, char *, int);
+
+
 /* Globals */
 static HWND hidden_hwnd;                 /* HWND for messages */
 
@@ -506,11 +509,11 @@ convert_register (regno, buf)
 {
   if (regno <= 31)
     sprintf (buf, "r%d", regno);
-  else if (reg_names[regno][0] == 's'
-          && reg_names[regno][1] == 'r')
+  else if (REGISTER_NAME (regno)[0] == 's'
+          && REGISTER_NAME (regno)[1] == 'r')
     return 0;
   else
-    sprintf (buf, "%s", reg_names[regno]);
+    sprintf (buf, "%s", REGISTER_NAME (regno));
 
   return 1;
 }
@@ -843,17 +846,30 @@ ice_cont (c)
   return 1;
 }
 
+static void
+do_gdb (cmd, str, count)
+     char *cmd;
+     char *str;
+     int count;
+{
+
+  ReplyMessage ((LRESULT) 1);
+
+  while (count--)
+    {
+      printf_unfiltered (str);
+      Tcl_Eval (gdbtk_interp, cmd);
+    }
+}
+
+
 static int
 ice_stepi (c)
   char *c;
 {
-  char string[50] = "\0";
   int count = (int) c;
 
-  sprintf (string, "gdb_immediate stepi %d", count);
-  printf_unfiltered ("stepi (ice)\n");
-  ReplyMessage ((LRESULT) 1);
-  Tcl_Eval (gdbtk_interp, string);
+  do_gdb ("gdb_immediate stepi", "stepi (ice)\n", count);
   return 1;
 }
 
@@ -861,13 +877,9 @@ static int
 ice_nexti (c)
   char *c;
 {
-  char string[50] = "\0";
   int count = (int) c;
 
-  sprintf (string, "gdb_immediate nexti %d", count);
-  printf_unfiltered ("nexti (ice)\n");
-  ReplyMessage ((LRESULT) 1);
-  Tcl_Eval (gdbtk_interp, string);
+  do_gdb ("gdb_immediate nexti", "nexti (ice)\n", count);
   return 1;
 }
 
@@ -896,23 +908,28 @@ view_source (addr)
 {
   char c[256];
 
-  sprintf (c, "set src [lindex [manage find src] 0]\n$src location [gdb_loc *0x%x]", addr);
+  sprintf (c, "set src [lindex [manage find src] 0]\n$src location BROWSE [gdb_loc *0x%x]", addr);
   Tcl_Eval (gdbtk_interp, c);
 }
 
 /* Define the target subroutine names */
 
-static void init_850ice_ops(void)
+static void 
+init_850ice_ops(void)
 {
   v850ice_ops.to_shortname   =   "ice";                
   v850ice_ops.to_longname    =   "NEC V850 ICE interface";
   v850ice_ops.to_doc         =   "Debug a system controlled by a NEC 850 ICE.";
   v850ice_ops.to_open        =   v850ice_open;         
   v850ice_ops.to_close       =   v850ice_close;        
-  v850ice_ops.to_attach      =   NULL;         
-  v850ice_ops.to_detach      =   v850ice_detach;       
+  v850ice_ops.to_attach      =   NULL;
+  v850ice_ops.to_post_attach =   NULL;
+  v850ice_ops.to_require_attach = NULL;                
+  v850ice_ops.to_detach      =   v850ice_detach;
+  v850ice_ops.to_require_detach = NULL;        
   v850ice_ops.to_resume      =   v850ice_resume;       
-  v850ice_ops.to_wait        =   v850ice_wait; 
+  v850ice_ops.to_wait        =   v850ice_wait;
+  v850ice_ops.to_post_wait = NULL;     
   v850ice_ops.to_fetch_registers  =   v850ice_fetch_registers;
   v850ice_ops.to_store_registers  =   v850ice_store_registers;
   v850ice_ops.to_prepare_to_store =   v850ice_prepare_to_store;
@@ -928,12 +945,14 @@ static void init_850ice_ops(void)
   v850ice_ops.to_kill            =   v850ice_kill;             
   v850ice_ops.to_load            =   v850ice_load;             
   v850ice_ops.to_lookup_symbol   =   NULL;             
-  v850ice_ops.to_create_inferior =   NULL;             
+  v850ice_ops.to_create_inferior =   NULL;
   v850ice_ops.to_mourn_inferior  =   v850ice_mourn;
   v850ice_ops.to_can_run         =   0;                
   v850ice_ops.to_notice_signals  =   0;                
   v850ice_ops.to_thread_alive    =    NULL;    
   v850ice_ops.to_stop            =   v850ice_stop;
+  v850ice_ops.to_pid_to_exec_file = NULL;
+  v850ice_ops.to_core_file_to_sym_file = NULL;                 
   v850ice_ops.to_stratum         =   process_stratum;  
   v850ice_ops.DONT_USE           =   NULL;             
   v850ice_ops.to_has_all_memory  =   1;                
This page took 0.024407 seconds and 4 git commands to generate.