Protect nat/gdb_thread_db.h against multiple inclusion.
[deliverable/binutils-gdb.git] / gdb / monitor.c
index 25742ac5a3ea734b44a5e7ce7affbc135fb41aa3..4657d7383f376b36443d351cd27e854d4a1a4170 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote debugging interface for boot monitors, for GDB.
 
-   Copyright (C) 1990-2014 Free Software Foundation, Inc.
+   Copyright (C) 1990-2015 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by Rob Savoye for Cygnus.
    Resurrected from the ashes by Stu Grossman.
 #include "defs.h"
 #include "gdbcore.h"
 #include "target.h"
-#include "exceptions.h"
 #include <signal.h>
 #include <ctype.h>
-#include <string.h>
 #include <sys/types.h>
 #include "command.h"
 #include "serial.h"
@@ -56,6 +54,7 @@
 #include "regcache.h"
 #include "gdbthread.h"
 #include "readline/readline.h"
+#include "rsp-low.h"
 
 static char *dev_name;
 static struct target_ops *targ_ops;
@@ -227,21 +226,6 @@ monitor_error (char *function, char *message,
           message, safe_string);
 }
 
-/* Convert hex digit A to a number.  */
-
-static int
-fromhex (int a)
-{
-  if (a >= '0' && a <= '9')
-    return a - '0';
-  else if (a >= 'a' && a <= 'f')
-    return a - 'a' + 10;
-  else if (a >= 'A' && a <= 'F')
-    return a - 'A' + 10;
-  else
-    error (_("Invalid hex digit %d"), a);
-}
-
 /* monitor_vsprintf - similar to vsprintf but handles 64-bit addresses
 
    This function exists to get around the problem that many host platforms
@@ -713,9 +697,9 @@ compile_pattern (char *pattern, struct re_pattern_buffer *compiled_pattern,
    for communication.  */
 
 void
-monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
+monitor_open (const char *args, struct monitor_ops *mon_ops, int from_tty)
 {
-  char *name;
+  const char *name;
   char **p;
   struct inferior *inf;
 
@@ -769,6 +753,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
        }
     }
 
+  serial_setparity (monitor_desc, serial_parity);
   serial_raw (monitor_desc);
 
   serial_flush_input (monitor_desc);
@@ -868,8 +853,7 @@ monitor_close (struct target_ops *self)
 
   monitor_desc = NULL;
 
-  delete_thread_silent (monitor_ptid);
-  delete_inferior_silent (ptid_get_pid (monitor_ptid));
+  discard_all_inferiors ();
 }
 
 /* Terminate the open connection to the remote debugger.  Use this
@@ -2080,7 +2064,7 @@ monitor_create_inferior (struct target_ops *ops, char *exec_file,
     error (_("Args are not supported by the monitor."));
 
   first_time = 1;
-  clear_proceed_status ();
+  clear_proceed_status (0);
   regcache_write_pc (get_current_regcache (),
                     bfd_get_start_address (exec_bfd));
 }
@@ -2104,7 +2088,7 @@ static int
 monitor_insert_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
                           struct bp_target_info *bp_tgt)
 {
-  CORE_ADDR addr = bp_tgt->placed_address;
+  CORE_ADDR addr = bp_tgt->placed_address = bp_tgt->reqstd_address;
   int i;
   int bplen;
 
@@ -2200,7 +2184,7 @@ monitor_wait_srec_ack (void)
 /* monitor_load -- download a file.  */
 
 static void
-monitor_load (struct target_ops *self, char *args, int from_tty)
+monitor_load (struct target_ops *self, const char *args, int from_tty)
 {
   CORE_ADDR load_offset = 0;
   char **argv;
@@ -2282,7 +2266,7 @@ monitor_stop (struct target_ops *self, ptid_t ptid)
    ourseleves here cause of a nasty echo.  */
 
 static void
-monitor_rcmd (struct target_ops *self, char *command,
+monitor_rcmd (struct target_ops *self, const char *command,
              struct ui_file *outbuf)
 {
   char *p;
This page took 0.025747 seconds and 4 git commands to generate.