Update years in copyright notice for the GDB files.
[deliverable/binutils-gdb.git] / gdb / monitor.c
index e5a2a7c6ec9747b98ed80ce04b3bca6d4209139c..d56179a67a75fad36ee581dea22ff0a6ec6623a2 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote debugging interface for boot monitors, for GDB.
 
-   Copyright (C) 1990-2002, 2006-2012 Free Software Foundation, Inc.
+   Copyright (C) 1990-2013 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by Rob Savoye for Cygnus.
    Resurrected from the ashes by Stu Grossman.
@@ -120,7 +120,7 @@ static ptid_t monitor_ptid;
 
 static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
 
-static int monitor_debug_p = 0;
+static unsigned int monitor_debug_p = 0;
 
 /* NOTE: This file alternates between monitor_debug_p and remote_debug
    when determining if debug information is printed.  Perhaps this
@@ -217,11 +217,11 @@ monitor_error (char *function, char *message,
 
   if (final_char)
     error (_("%s (%s): %s: %s%c"),
-          function, paddress (target_gdbarch, memaddr),
+          function, paddress (target_gdbarch (), memaddr),
           message, safe_string, final_char);
   else
     error (_("%s (%s): %s: %s"),
-          function, paddress (target_gdbarch, memaddr),
+          function, paddress (target_gdbarch (), memaddr),
           message, safe_string);
 }
 
@@ -256,7 +256,7 @@ fromhex (int a)
 static void
 monitor_vsprintf (char *sndbuf, char *pattern, va_list args)
 {
-  int addr_bit = gdbarch_addr_bit (target_gdbarch);
+  int addr_bit = gdbarch_addr_bit (target_gdbarch ());
   char format[10];
   char fmt;
   char *p;
@@ -512,6 +512,7 @@ monitor_expect (char *string, char *buf, int buflen)
     }
 
   immediate_quit++;
+  QUIT;
   while (1)
     {
       if (buf)
@@ -1162,7 +1163,7 @@ monitor_wait (struct target_ops *ops,
 #endif
 
   status->kind = TARGET_WAITKIND_STOPPED;
-  status->value.sig = TARGET_SIGNAL_TRAP;
+  status->value.sig = GDB_SIGNAL_TRAP;
 
   discard_cleanups (old_chain);
 
@@ -1439,15 +1440,15 @@ monitor_files_info (struct target_ops *ops)
 static int
 monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   unsigned int val, hostval;
   char *cmd;
   int i;
 
-  monitor_debug ("MON write %d %s\n", len, paddress (target_gdbarch, memaddr));
+  monitor_debug ("MON write %d %s\n", len, paddress (target_gdbarch (), memaddr));
 
   if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
-    memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr);
+    memaddr = gdbarch_addr_bits_remove (target_gdbarch (), memaddr);
 
   /* Use memory fill command for leading 0 bytes.  */
 
@@ -1706,7 +1707,7 @@ monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
 static int
 monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   unsigned int val;
   char membuf[sizeof (int) * 2 + 1];
   char *p;
@@ -1851,11 +1852,11 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
     }
 
   monitor_debug ("MON read block ta(%s) ha(%s) %d\n",
-                paddress (target_gdbarch, memaddr),
+                paddress (target_gdbarch (), memaddr),
                 host_address_to_string (myaddr), len);
 
   if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
-    memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr);
+    memaddr = gdbarch_addr_bits_remove (target_gdbarch (), memaddr);
 
   if (current_monitor->flags & MO_GETMEM_READ_SINGLE)
     return monitor_read_memory_single (memaddr, myaddr, len);
@@ -2376,14 +2377,14 @@ When enabled, a hashmark \'#\' is displayed."),
                           NULL, /* FIXME: i18n: */
                           &setlist, &showlist);
 
-  add_setshow_zinteger_cmd ("monitor", no_class, &monitor_debug_p, _("\
+  add_setshow_zuinteger_cmd ("monitor", no_class, &monitor_debug_p, _("\
 Set debugging of remote monitor communication."), _("\
 Show debugging of remote monitor communication."), _("\
 When enabled, communication between GDB and the remote monitor\n\
 is displayed."),
-                           NULL,
-                           NULL, /* FIXME: i18n: */
-                           &setdebuglist, &showdebuglist);
+                            NULL,
+                            NULL, /* FIXME: i18n: */
+                            &setdebuglist, &showdebuglist);
 
   /* Yes, 42000 is arbitrary.  The only sense out of it, is that it
      isn't 0.  */
This page took 0.025433 seconds and 4 git commands to generate.