aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorgdb-2.5.1 <gdb@fsf.org>1988-05-02 01:00:00 +0100
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:30 +0100
commit632ea0ccc5c4c3f9fc06881bfedfc4b075873941 (patch)
tree96f152433c41c5f51fe57307b287eb85865a43e2 /gdb/infrun.c
parent7b4ac7e1ed2c4616bce56d1760807798be87ac9e (diff)
downloadgdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.zip
gdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.tar.gz
gdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.tar.bz2
gdb-2.5.1
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c50
1 files changed, 47 insertions, 3 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index e980cec..97966e4 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1,5 +1,5 @@
/* Start and stop the inferior process, for GDB.
- Copyright (C) 1986, 1987 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1987, 1988 Free Software Foundation, Inc.
GDB is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY. No author or distributor accepts responsibility to anyone
@@ -90,6 +90,10 @@ static int stop_after_attach;
int pc_changed;
+/* Nonzero if debugging a remote machine via a serial link or ethernet. */
+
+int remote_debugging;
+
/* Save register contents here when about to pop a stack dummy frame. */
char stop_registers[REGISTER_BYTES];
@@ -238,8 +242,38 @@ start_inferior ()
/* Install inferior's terminal modes. */
terminal_inferior ();
+ if (remote_debugging)
+ {
+ trap_expected = 0;
+ fetch_inferior_registers();
+ set_current_frame (read_register(FP_REGNUM));
+ stop_frame = get_current_frame();
+ inferior_pid = 3;
+ if (insert_breakpoints())
+ fatal("Can't insert breakpoints");
+ breakpoints_inserted = 1;
+ proceed(-1, -1, 0);
+ }
+ else
+ {
+ wait_for_inferior ();
+ normal_stop ();
+ }
+}
+
+/* Start remote-debugging of a machine over a serial link. */
+
+void
+start_remote ()
+{
+ clear_proceed_status ();
+ running_in_shell = 0;
+ trap_expected = 0;
+ inferior_pid = 3;
+ breakpoints_inserted = 0;
+ mark_breakpoints_out ();
wait_for_inferior ();
- normal_stop ();
+ normal_stop();
}
#ifdef ATTACH_DETACH
@@ -290,7 +324,16 @@ wait_for_inferior ()
while (1)
{
prev_pc = read_pc ();
- pid = wait (&w);
+
+ if (remote_debugging)
+ remote_wait (&w);
+ else
+ {
+ pid = wait (&w);
+ if (pid != inferior_pid)
+ continue;
+ }
+
pc_changed = 0;
fetch_inferior_registers ();
stop_pc = read_pc ();
@@ -530,6 +573,7 @@ wait_for_inferior ()
else if (!random_signal && step_range_end)
{
newfun = find_pc_function (stop_pc);
+ newmisc = -1;
if (newfun)
{
newfun_pc = BLOCK_START (SYMBOL_BLOCK_VALUE (newfun))