aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/remote-hms.c9
-rw-r--r--gdb/remote-sim.c17
-rw-r--r--gdb/state.c5
3 files changed, 13 insertions, 18 deletions
diff --git a/gdb/remote-hms.c b/gdb/remote-hms.c
index a21d86e..0cb42f6 100644
--- a/gdb/remote-hms.c
+++ b/gdb/remote-hms.c
@@ -622,14 +622,13 @@ static void
hms_close (quitting)
int quitting;
{
-
/* Clear any break points */
hms_clear_breakpoints ();
-
- /* Put this port back into REMOTE mode */
sleep (1); /* Let any output make it all the way back */
- serial_write ("R\r", 2);
- serial_close ();
+ if (is_open) {
+ serial_write ("R\r", 2);
+ serial_close ();
+ }
is_open = 0;
}
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 92be34a..d5840be 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -45,7 +45,7 @@ sim_write_inferior_memory (memaddr, myaddr, len)
return sim_write(memaddr, myaddr, len);
}
-static int
+static void
store_register(regno)
int regno;
{
@@ -58,7 +58,6 @@ int regno;
{
sim_store_register(regno, read_register(regno));
}
- return 0;
}
@@ -142,7 +141,7 @@ sim_create_inferior (execfile, args, env)
-static int
+static void
sim_open (name, from_tty)
char *name;
int from_tty;
@@ -151,7 +150,6 @@ sim_open (name, from_tty)
{
name = "";
}
-
push_target (&sim_ops);
target_fetch_registers(-1);
printf_filtered("Connected to the simulator.\n");
@@ -159,7 +157,7 @@ sim_open (name, from_tty)
/* Close out all files and local state before this target loses control. */
-static int
+static void
sim_close (quitting)
int quitting;
{
@@ -168,7 +166,7 @@ sim_close (quitting)
/* Terminate the open connection to the remote debugger.
Use this when you want to detach and do something else
with your gdb. */
-int
+void
sim_detach (args,from_tty)
char *args;
int from_tty;
@@ -176,7 +174,7 @@ sim_detach (args,from_tty)
pop_target(); /* calls sim_close to do the real work */
if (from_tty)
printf_filtered ("Ending remote %s debugging\n", target_shortname);
- return 0;
+
}
/* Tell the remote machine to resume. */
@@ -245,15 +243,14 @@ sim_before_main_loop ()
}
-static int rem_resume(a,b)
+static void rem_resume(a,b)
{
sim_resume(a,b);
- return 0;
}
+void
pstore()
{
- return 1;
}
/* Define the target subroutine names */
diff --git a/gdb/state.c b/gdb/state.c
index 51b73fa..64f86d6 100644
--- a/gdb/state.c
+++ b/gdb/state.c
@@ -198,7 +198,6 @@ static struct formnode *
alloc_formnode ()
{
struct formnode *fnp;
-
fnp = (struct formnode *) xmalloc (sizeof (struct formnode));
(void) memset (fnp, 0, sizeof (struct formnode));
fnp -> sibling = formtree;
@@ -461,7 +460,7 @@ load_state_command (arg_string, from_tty)
filename = tilde_expand (*argv);
make_cleanup (free, filename);
- if ((fp = fopen (filename, "r")) == NULL)
+ if ((fp = fopen (filename, FOPEN_RB)) == NULL)
{
perror_with_name (filename);
}
@@ -517,7 +516,7 @@ dump_state_command (arg_string, from_tty)
/* Now attempt to create a fresh state file. */
- if ((asfd = sfd_fopen (filename, "w")) == NULL)
+ if ((asfd = sfd_fopen (filename, FOPEN_WB)) == NULL)
{
perror_with_name (filename);
}