1 /* Remote debugging interface for boot monitors, for GDB.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
3 2001 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* This file was derived from remote-eb.c, which did a similar job, but for
23 an AMD-29K running EBMON. That file was in turn derived from remote.c
24 as mentioned in the following comment (left in for comic relief):
26 "This is like remote.c but is for a different situation--
27 having a PC running os9000 hook up with a unix machine with
28 a serial line, and running ctty com2 on the PC. os9000 has a debug
29 monitor called ROMBUG running. Not to mention that the PC
30 has PC/NFS, so it can access the same executables that gdb can,
31 over the net in real time."
33 In reality, this module talks to a debug monitor called 'ROMBUG', which
34 We communicate with ROMBUG via a direct serial line, the network version
35 of ROMBUG is not available yet.
38 /* FIXME This file needs to be rewritten if it's to work again, either
39 to self-contained or to use the new monitor interface. */
44 #include "gdb_string.h"
45 #include <sys/types.h>
49 #include "remote-utils.h"
53 #include "gdb-stabs.h"
56 struct cmd_list_element
*showlist
;
57 extern struct target_ops rombug_ops
; /* Forward declaration */
58 extern struct monitor_ops rombug_cmds
; /* Forward declaration */
59 extern struct cmd_list_element
*setlist
;
60 extern struct cmd_list_element
*unsetlist
;
61 extern int attach_flag
;
63 static void rombug_close ();
64 static void rombug_fetch_register ();
65 static void rombug_fetch_registers ();
66 static void rombug_store_register ();
68 static int sr_get_debug (); /* flag set by "set remotedebug" */
70 static int hashmark
; /* flag set by "set hash" */
71 static int rombug_is_open
= 0;
73 /* FIXME: Replace with sr_get_debug (). */
74 #define LOG_FILE "monitor.log"
76 static int monitor_log
= 0;
77 static int tty_xon
= 0;
78 static int tty_xoff
= 0;
80 static int timeout
= 10;
81 static int is_trace_mode
= 0;
82 /* Descriptor for I/O to remote machine. Initialize it to NULL */
83 static struct serial
*monitor_desc
= NULL
;
85 static CORE_ADDR bufaddr
= 0;
86 static int buflen
= 0;
87 static char readbuf
[16];
89 /* Send data to monitor. Works just like printf. */
91 printf_monitor (char *pattern
,...)
97 va_start (args
, pattern
);
99 vsprintf (buf
, pattern
, args
);
102 if (serial_write (monitor_desc
, buf
, strlen (buf
)))
103 fprintf (stderr
, "serial_write failed: %s\n", safe_strerror (errno
));
106 /* Read a character from the remote system, doing all the fancy timeout stuff */
108 readchar (int timeout
)
112 c
= serial_readchar (monitor_desc
, timeout
);
117 if (monitor_log
&& isascii (c
))
118 putc (c
& 0x7f, log_file
);
123 if (c
== SERIAL_TIMEOUT
)
126 return c
; /* Polls shouldn't generate timeout errors */
128 error ("Timeout reading from remote system.");
131 perror_with_name ("remote-monitor");
134 /* Scan input from the remote system, until STRING is found. If DISCARD is
135 non-zero, then discard non-matching input, else print it out.
136 Let the user break out immediately. */
138 expect (char *string
, int discard
)
144 printf ("Expecting \"%s\"\n", string
);
149 c
= readchar (timeout
);
158 printf ("\nMatched\n");
166 fwrite (string
, 1, (p
- 1) - string
, stdout
);
175 /* Keep discarding input until we see the ROMBUG prompt.
177 The convention for dealing with the prompt is that you
179 o *then* wait for the prompt.
181 Thus the last thing that a procedure does with the serial line
182 will be an expect_prompt(). Exception: rombug_resume does not
183 wait for the prompt, because the terminal is being handed over
184 to the inferior. However, the next thing which happens after that
185 is a rombug_wait which does wait for the prompt.
186 Note that this includes abnormal exit, e.g. error(). This is
187 necessary to prevent getting into states from which we can't
190 expect_prompt (int discard
)
193 /* This is a convenient place to do this. The idea is to do it often
194 enough that we never lose much data if we terminate abnormally. */
199 expect ("trace", discard
);
203 expect (PROMPT
, discard
);
207 /* Get a hex digit from the remote system & return its value.
208 If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */
210 get_hex_digit (int ignore_space
)
215 ch
= readchar (timeout
);
216 if (ch
>= '0' && ch
<= '9')
218 else if (ch
>= 'A' && ch
<= 'F')
219 return ch
- 'A' + 10;
220 else if (ch
>= 'a' && ch
<= 'f')
221 return ch
- 'a' + 10;
222 else if (ch
== ' ' && ignore_space
)
227 error ("Invalid hex digit from remote system.");
232 /* Get a byte from monitor and put it in *BYT. Accept any number
235 get_hex_byte (char *byt
)
239 val
= get_hex_digit (1) << 4;
240 val
|= get_hex_digit (0);
244 /* Get N 32-bit words from remote, each preceded by a space,
245 and put them in registers starting at REGNO. */
247 get_hex_regs (int n
, int regno
)
253 for (i
= 0; i
< n
; i
++)
258 for (j
= 0; j
< 4; j
++)
261 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
262 val
= (val
<< 8) + b
;
264 val
= val
+ (b
<< (j
* 8));
266 supply_register (regno
++, (char *) &val
);
270 /* This is called not only when we first attach, but also when the
271 user types "run" after having attached. */
273 rombug_create_inferior (char *execfile
, char *args
, char **env
)
278 error ("Can't pass arguments to remote ROMBUG process");
280 if (execfile
== 0 || exec_bfd
== 0)
281 error ("No executable file specified");
283 entry_pt
= (int) bfd_get_start_address (exec_bfd
);
286 fputs ("\nIn Create_inferior()", log_file
);
289 /* The "process" (board) is already stopped awaiting our commands, and
290 the program is already downloaded. We just set its PC and go. */
292 init_wait_for_inferior ();
293 proceed ((CORE_ADDR
) entry_pt
, TARGET_SIGNAL_DEFAULT
, 0);
296 /* Open a connection to a remote debugger.
297 NAME is the filename used for communication. */
299 static char dev_name
[100];
302 rombug_open (char *args
, int from_tty
)
305 error ("Use `target RomBug DEVICE-NAME' to use a serial port, or \n\
306 `target RomBug HOST-NAME:PORT-NUMBER' to use a network connection.");
308 target_preopen (from_tty
);
311 unpush_target (&rombug_ops
);
313 strcpy (dev_name
, args
);
314 monitor_desc
= serial_open (dev_name
);
315 if (monitor_desc
== NULL
)
316 perror_with_name (dev_name
);
318 /* if baud rate is set by 'set remotebaud' */
319 if (serial_setbaudrate (monitor_desc
, sr_get_baud_rate ()))
321 serial_close (monitor_desc
);
322 perror_with_name ("RomBug");
324 serial_raw (monitor_desc
);
325 if (tty_xon
|| tty_xoff
)
327 struct hardware_ttystate
333 tty_s
= (struct hardware_ttystate
*) serial_get_tty_state (monitor_desc
);
335 tty_s
->t
.c_iflag
|= IXON
;
337 tty_s
->t
.c_iflag
|= IXOFF
;
338 serial_set_tty_state (monitor_desc
, (serial_ttystate
) tty_s
);
343 log_file
= fopen (LOG_FILE
, "w");
344 if (log_file
== NULL
)
345 perror_with_name (LOG_FILE
);
347 push_monitor (&rombug_cmds
);
348 printf_monitor ("\r"); /* CR wakes up monitor */
350 push_target (&rombug_ops
);
354 printf ("Remote %s connected to %s\n", target_shortname
,
357 rombug_fetch_registers ();
359 printf_monitor ("ov e \r");
366 * Close out all files and local state before this target loses control.
370 rombug_close (int quitting
)
374 serial_close (monitor_desc
);
381 if (ferror (log_file
))
382 fprintf (stderr
, "Error writing log file.\n");
383 if (fclose (log_file
) != 0)
384 fprintf (stderr
, "Error closing log file.\n");
390 rombug_link (char *mod_name
, CORE_ADDR
*text_reloc
)
396 printf_monitor ("l %s \r", mod_name
);
398 printf_monitor (".r \r");
399 expect (REG_DELIM
, 1);
400 for (i
= 0; i
<= 7; i
++)
403 for (j
= 0; j
< 4; j
++)
406 val
= (val
<< 8) + b
;
414 /* Terminate the open connection to the remote debugger.
415 Use this when you want to detach and do something else
418 rombug_detach (int from_tty
)
422 printf_monitor (GO_CMD
);
425 pop_target (); /* calls rombug_close to do the real work */
427 printf ("Ending remote %s debugging\n", target_shortname
);
431 * Tell the remote machine to resume.
434 rombug_resume (ptid_t ptid
, int step
, enum target_signal sig
)
437 fprintf (log_file
, "\nIn Resume (step=%d, sig=%d)\n", step
, sig
);
442 printf_monitor (STEP_CMD
);
443 /* wait for the echo. **
444 expect (STEP_CMD, 1);
449 printf_monitor (GO_CMD
);
450 /* swallow the echo. **
459 * Wait until the remote machine stops, then return,
460 * storing status in status just as `wait' would.
464 rombug_wait (ptid_t ptid
, struct target_waitstatus
*status
)
466 int old_timeout
= timeout
;
467 struct section_offsets
*offs
;
469 struct obj_section
*obj_sec
;
472 fputs ("\nIn wait ()", log_file
);
474 status
->kind
= TARGET_WAITKIND_EXITED
;
475 status
->value
.integer
= 0;
477 timeout
= -1; /* Don't time out -- user program is running. */
478 expect ("eax:", 0); /* output any message before register display */
479 expect_prompt (1); /* Wait for prompt, outputting extraneous text */
481 status
->kind
= TARGET_WAITKIND_STOPPED
;
482 status
->value
.sig
= TARGET_SIGNAL_TRAP
;
483 timeout
= old_timeout
;
484 rombug_fetch_registers ();
487 pc
= read_register (PC_REGNUM
);
488 addr
= read_register (DATABASE_REG
);
489 obj_sec
= find_pc_section (pc
);
492 if (obj_sec
->objfile
!= symfile_objfile
)
493 new_symfile_objfile (obj_sec
->objfile
, 1, 0);
494 offs
= (struct section_offsets
*) alloca (SIZEOF_SECTION_OFFSETS
);
495 memcpy (offs
, symfile_objfile
->section_offsets
, SIZEOF_SECTION_OFFSETS
);
496 offs
->offsets
[SECT_OFF_DATA (symfile_objfile
)] = addr
;
497 offs
->offsets
[SECT_OFF_BSS (symfile_objfile
)] = addr
;
499 objfile_relocate (symfile_objfile
, offs
);
502 return inferior_ptid
;
505 /* Return the name of register number regno in the form input and output by
506 monitor. Currently, register_names just happens to contain exactly what
507 monitor wants. Lets take advantage of that just as long as possible! */
510 get_reg_name (int regno
)
521 for (p = REGISTER_NAME (regno); *p; p++)
525 p
= (char *) REGISTER_NAME (regno
);
532 /* read the remote registers into the block regs. */
535 rombug_fetch_registers (void)
541 printf_monitor (GET_REG
);
552 for (regno
= 8; regno
<= 15; regno
++)
554 expect (REG_DELIM
, 1);
555 if (regno
>= 8 && regno
<= 13)
558 for (j
= 0; j
< 2; j
++)
561 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
562 val
= (val
<< 8) + b
;
564 val
= val
+ (b
<< (j
* 8));
569 if (regno
>= 9 && regno
<= 12)
573 supply_register (i
, (char *) &val
);
575 else if (regno
== 14)
577 get_hex_regs (1, PC_REGNUM
);
579 else if (regno
== 15)
586 supply_register (regno
, (char *) &val
);
593 /* Fetch register REGNO, or all registers if REGNO is -1.
594 Returns errno value. */
596 rombug_fetch_register (int regno
)
603 fprintf (log_file
, "\nIn Fetch Register (reg=%s)\n", get_reg_name (regno
));
609 rombug_fetch_registers ();
613 char *name
= get_reg_name (regno
);
614 printf_monitor (GET_REG
);
615 if (regno
>= 10 && regno
<= 15)
620 expect (REG_DELIM
, 1);
622 for (j
= 0; j
< 2; j
++)
625 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
626 val
= (val
<< 8) + b
;
628 val
= val
+ (b
<< (j
* 8));
630 supply_register (regno
, (char *) &val
);
632 else if (regno
== 8 || regno
== 9)
638 expect (REG_DELIM
, 1);
639 get_hex_regs (1, regno
);
644 expect (REG_DELIM
, 1);
660 /* Store the remote registers from the contents of the block REGS. */
663 rombug_store_registers (void)
667 for (regno
= 0; regno
<= PC_REGNUM
; regno
++)
668 rombug_store_register (regno
);
670 registers_changed ();
673 /* Store register REGNO, or all if REGNO == 0.
674 return errno value. */
676 rombug_store_register (int regno
)
681 fprintf (log_file
, "\nIn Store_register (regno=%d)\n", regno
);
684 rombug_store_registers ();
688 printf ("Setting register %s to 0x%x\n", get_reg_name (regno
), read_register (regno
));
690 name
= get_reg_name (regno
);
693 printf_monitor (SET_REG
, name
, read_register (regno
));
700 /* Get ready to modify the registers array. On machines which store
701 individual registers, this doesn't need to do anything. On machines
702 which store all the registers in one fell swoop, this makes sure
703 that registers contains all the registers from the program being
707 rombug_prepare_to_store (void)
709 /* Do nothing, since we can store individual regs */
713 rombug_files_info (void)
715 printf ("\tAttached to %s at %d baud.\n",
716 dev_name
, sr_get_baud_rate ());
719 /* Copy LEN bytes of data from debugger memory at MYADDR
720 to inferior's memory at MEMADDR. Returns length moved. */
722 rombug_write_inferior_memory (CORE_ADDR memaddr
, unsigned char *myaddr
, int len
)
728 fprintf (log_file
, "\nIn Write_inferior_memory (memaddr=%x, len=%d)\n", memaddr
, len
);
730 printf_monitor (MEM_SET_CMD
, memaddr
);
731 for (i
= 0; i
< len
; i
++)
733 expect (CMD_DELIM
, 1);
734 printf_monitor ("%x \r", myaddr
[i
]);
736 printf ("\nSet 0x%x to 0x%x\n", memaddr
+ i
, myaddr
[i
]);
738 expect (CMD_DELIM
, 1);
740 printf_monitor (CMD_END
);
749 /* Read LEN bytes from inferior memory at MEMADDR. Put the result
750 at debugger address MYADDR. Returns length moved. */
752 rombug_read_inferior_memory (CORE_ADDR memaddr
, char *myaddr
, int len
)
756 /* Number of bytes read so far. */
759 /* Starting address of this pass. */
760 unsigned long startaddr
;
762 /* Number of bytes to read in this pass. */
766 fprintf (log_file
, "\nIn Read_inferior_memory (memaddr=%x, len=%d)\n", memaddr
, len
);
768 /* Note that this code works correctly if startaddr is just less
769 than UINT_MAX (well, really CORE_ADDR_MAX if there was such a
770 thing). That is, something like
771 rombug_read_bytes (CORE_ADDR_MAX - 4, foo, 4)
772 works--it never adds len To memaddr and gets 0. */
773 /* However, something like
774 rombug_read_bytes (CORE_ADDR_MAX - 3, foo, 4)
775 doesn't need to work. Detect it and give up if there's an attempt
777 if (((memaddr
- 1) + len
) < memaddr
)
782 if (bufaddr
<= memaddr
&& (memaddr
+ len
) <= (bufaddr
+ buflen
))
784 memcpy (myaddr
, &readbuf
[memaddr
- bufaddr
], len
);
793 if ((startaddr
% 16) != 0)
794 len_this_pass
-= startaddr
% 16;
795 if (len_this_pass
> (len
- count
))
796 len_this_pass
= (len
- count
);
798 printf ("\nDisplay %d bytes at %x\n", len_this_pass
, startaddr
);
800 printf_monitor (MEM_DIS_CMD
, startaddr
, 8);
802 for (i
= 0; i
< 16; i
++)
804 get_hex_byte (&readbuf
[i
]);
808 memcpy (&myaddr
[count
], readbuf
, len_this_pass
);
809 count
+= len_this_pass
;
810 startaddr
+= len_this_pass
;
811 expect (CMD_DELIM
, 1);
814 printf_monitor (CMD_END
);
821 /* Transfer LEN bytes between GDB address MYADDR and target address
822 MEMADDR. If WRITE is non-zero, transfer them to the target,
823 otherwise transfer them from the target. TARGET is unused.
825 Returns the number of bytes transferred. */
828 rombug_xfer_inferior_memory (CORE_ADDR memaddr
, char *myaddr
, int len
,
830 struct mem_attrib
*attrib ATTRIBUTE_UNUSED
,
831 struct target_ops
*target ATTRIBUTE_UNUSED
)
834 return rombug_write_inferior_memory (memaddr
, myaddr
, len
);
836 return rombug_read_inferior_memory (memaddr
, myaddr
, len
);
840 rombug_kill (char *args
, int from_tty
)
842 return; /* ignore attempts to kill target system */
845 /* Clean up when a program exits.
846 The program actually lives on in the remote processor's RAM, and may be
847 run again without a download. Don't leave it full of breakpoint
851 rombug_mourn_inferior (void)
853 remove_breakpoints ();
854 generic_mourn_inferior (); /* Do all the proper things now */
857 #define MAX_MONITOR_BREAKPOINTS 16
859 static CORE_ADDR breakaddr
[MAX_MONITOR_BREAKPOINTS
] =
863 rombug_insert_breakpoint (CORE_ADDR addr
, char *shadow
)
866 CORE_ADDR bp_addr
= addr
;
870 fprintf (log_file
, "\nIn Insert_breakpoint (addr=%x)\n", addr
);
871 BREAKPOINT_FROM_PC (&bp_addr
, &bp_size
);
873 for (i
= 0; i
<= MAX_MONITOR_BREAKPOINTS
; i
++)
874 if (breakaddr
[i
] == 0)
878 printf ("Breakpoint at %x\n", addr
);
879 rombug_read_inferior_memory (bp_addr
, shadow
, bp_size
);
880 printf_monitor (SET_BREAK_CMD
, addr
);
886 fprintf (stderr
, "Too many breakpoints (> 16) for monitor\n");
891 * _remove_breakpoint -- Tell the monitor to remove a breakpoint
894 rombug_remove_breakpoint (CORE_ADDR addr
, char *shadow
)
899 fprintf (log_file
, "\nIn Remove_breakpoint (addr=%x)\n", addr
);
901 for (i
= 0; i
< MAX_MONITOR_BREAKPOINTS
; i
++)
902 if (breakaddr
[i
] == addr
)
905 printf_monitor (CLR_BREAK_CMD
, addr
);
911 fprintf (stderr
, "Can't find breakpoint associated with 0x%x\n", addr
);
915 /* Load a file. This is usually an srecord, which is ascii. No
916 protocol, just sent line by line. */
918 #define DOWNLOAD_LINE_SIZE 100
920 rombug_load (char *arg
)
922 /* this part comment out for os9* */
925 char buf
[DOWNLOAD_LINE_SIZE
];
929 printf ("Loading %s to monitor\n", arg
);
931 download
= fopen (arg
, "r");
932 if (download
== NULL
)
934 error (sprintf (buf
, "%s Does not exist", arg
));
938 printf_monitor (LOAD_CMD
);
939 /* expect ("Waiting for S-records from host... ", 1); */
941 while (!feof (download
))
943 bytes_read
= fread (buf
, sizeof (char), DOWNLOAD_LINE_SIZE
, download
);
950 if (serial_write (monitor_desc
, buf
, bytes_read
))
952 fprintf (stderr
, "serial_write failed: (while downloading) %s\n", safe_strerror (errno
));
956 while (i
++ <= 200000)
958 }; /* Ugly HACK, probably needs flow control */
959 if (bytes_read
< DOWNLOAD_LINE_SIZE
)
961 if (!feof (download
))
962 error ("Only read %d bytes\n", bytes_read
);
971 if (!feof (download
))
972 error ("Never got EOF while downloading");
977 /* Put a command string, in args, out to MONITOR.
978 Output from MONITOR is placed on the users terminal until the prompt
982 rombug_command (char *args
, int fromtty
)
984 if (monitor_desc
== NULL
)
985 error ("monitor target not open.");
988 fprintf (log_file
, "\nIn command (args=%s)\n", args
);
991 error ("Missing command.");
993 printf_monitor ("%s\r", args
);
998 /* Connect the user directly to MONITOR. This command acts just like the
999 'cu' or 'tip' command. Use <CR>~. or <CR>~^D to break out. */
1001 static struct ttystate ttystate
;
1006 printf ("\r\n[Exiting connect mode]\r\n");
1007 /*serial_restore(0, &ttystate); */
1011 connect_command (char *args
, int fromtty
)
1020 if (monitor_desc
== NULL
)
1021 error ("monitor target not open.");
1024 fprintf ("This command takes no args. They have been ignored.\n");
1026 printf ("[Entering connect mode. Use ~. or ~^D to escape]\n");
1028 serial_raw (0, &ttystate
);
1030 make_cleanup (cleanup_tty
, 0);
1038 FD_SET (0, &readfds
);
1039 FD_SET (deprecated_serial_fd (monitor_desc
), &readfds
);
1040 numfds
= select (sizeof (readfds
) * 8, &readfds
, 0, 0, 0);
1042 while (numfds
== 0);
1045 perror_with_name ("select");
1047 if (FD_ISSET (0, &readfds
))
1048 { /* tty input, send to monitor */
1051 perror_with_name ("connect");
1053 printf_monitor ("%c", c
);
1067 if (c
== '.' || c
== '\004')
1074 if (FD_ISSET (deprecated_serial_fd (monitor_desc
), &readfds
))
1090 * Define the monitor command strings. Since these are passed directly
1091 * through to a printf style function, we need can include formatting
1092 * strings. We also need a CR or LF on the end.
1094 #warning FIXME: monitor interface pattern strings, stale struct decl
1095 struct monitor_ops rombug_cmds
=
1097 "g \r", /* execute or usually GO command */
1098 "g \r", /* continue command */
1099 "t \r", /* single step */
1100 "b %x\r", /* set a breakpoint */
1101 "k %x\r", /* clear a breakpoint */
1102 "c %x\r", /* set memory to a value */
1103 "d %x %d\r", /* display memory */
1104 "$%08X", /* prompt memory commands use */
1105 ".%s %x\r", /* set a register */
1106 ":", /* delimiter between registers */
1107 ". \r", /* read a register */
1108 "mf \r", /* download command */
1109 "RomBug: ", /* monitor command prompt */
1110 ": ", /* end-of-command delimitor */
1111 ".\r" /* optional command terminator */
1114 struct target_ops rombug_ops
;
1117 init_rombug_ops (void)
1119 rombug_ops
.to_shortname
= "rombug";
1120 rombug_ops
.to_longname
= "Microware's ROMBUG debug monitor";
1121 rombug_ops
.to_doc
= "Use a remote computer running the ROMBUG debug monitor.\n\
1122 Specify the serial device it is connected to (e.g. /dev/ttya).",
1123 rombug_ops
.to_open
= rombug_open
;
1124 rombug_ops
.to_close
= rombug_close
;
1125 rombug_ops
.to_attach
= 0;
1126 rombug_ops
.to_post_attach
= NULL
;
1127 rombug_ops
.to_require_attach
= NULL
;
1128 rombug_ops
.to_detach
= rombug_detach
;
1129 rombug_ops
.to_require_detach
= NULL
;
1130 rombug_ops
.to_resume
= rombug_resume
;
1131 rombug_ops
.to_wait
= rombug_wait
;
1132 rombug_ops
.to_post_wait
= NULL
;
1133 rombug_ops
.to_fetch_registers
= rombug_fetch_register
;
1134 rombug_ops
.to_store_registers
= rombug_store_register
;
1135 rombug_ops
.to_prepare_to_store
= rombug_prepare_to_store
;
1136 rombug_ops
.to_xfer_memory
= rombug_xfer_inferior_memory
;
1137 rombug_ops
.to_files_info
= rombug_files_info
;
1138 rombug_ops
.to_insert_breakpoint
= rombug_insert_breakpoint
;
1139 rombug_ops
.to_remove_breakpoint
= rombug_remove_breakpoint
; /* Breakpoints */
1140 rombug_ops
.to_terminal_init
= 0;
1141 rombug_ops
.to_terminal_inferior
= 0;
1142 rombug_ops
.to_terminal_ours_for_output
= 0;
1143 rombug_ops
.to_terminal_ours
= 0;
1144 rombug_ops
.to_terminal_info
= 0; /* Terminal handling */
1145 rombug_ops
.to_kill
= rombug_kill
;
1146 rombug_ops
.to_load
= rombug_load
; /* load */
1147 rombug_ops
.to_lookup_symbol
= rombug_link
; /* lookup_symbol */
1148 rombug_ops
.to_create_inferior
= rombug_create_inferior
;
1149 rombug_ops
.to_post_startup_inferior
= NULL
;
1150 rombug_ops
.to_acknowledge_created_inferior
= NULL
;
1151 rombug_ops
.to_clone_and_follow_inferior
= NULL
;
1152 rombug_ops
.to_post_follow_inferior_by_clone
= NULL
;
1153 rombug_ops
.to_insert_fork_catchpoint
= NULL
;
1154 rombug_ops
.to_remove_fork_catchpoint
= NULL
;
1155 rombug_ops
.to_insert_vfork_catchpoint
= NULL
;
1156 rombug_ops
.to_remove_vfork_catchpoint
= NULL
;
1157 rombug_ops
.to_has_forked
= NULL
;
1158 rombug_ops
.to_has_vforked
= NULL
;
1159 rombug_ops
.to_can_follow_vfork_prior_to_exec
= NULL
;
1160 rombug_ops
.to_post_follow_vfork
= NULL
;
1161 rombug_ops
.to_insert_exec_catchpoint
= NULL
;
1162 rombug_ops
.to_remove_exec_catchpoint
= NULL
;
1163 rombug_ops
.to_has_execd
= NULL
;
1164 rombug_ops
.to_reported_exec_events_per_exec_call
= NULL
;
1165 rombug_ops
.to_has_exited
= NULL
;
1166 rombug_ops
.to_mourn_inferior
= rombug_mourn_inferior
;
1167 rombug_ops
.to_can_run
= 0; /* can_run */
1168 rombug_ops
.to_notice_signals
= 0; /* notice_signals */
1169 rombug_ops
.to_thread_alive
= 0;
1170 rombug_ops
.to_stop
= 0; /* to_stop */
1171 rombug_ops
.to_pid_to_exec_file
= NULL
;
1172 rombug_ops
.to_stratum
= process_stratum
;
1173 rombug_ops
.DONT_USE
= 0; /* next */
1174 rombug_ops
.to_has_all_memory
= 1;
1175 rombug_ops
.to_has_memory
= 1;
1176 rombug_ops
.to_has_stack
= 1;
1177 rombug_ops
.to_has_registers
= 1;
1178 rombug_ops
.to_has_execution
= 1; /* has execution */
1179 rombug_ops
.to_sections
= 0;
1180 rombug_ops
.to_sections_end
= 0; /* Section pointers */
1181 rombug_ops
.to_magic
= OPS_MAGIC
; /* Always the last thing */
1185 _initialize_remote_os9k (void)
1188 add_target (&rombug_ops
);
1191 add_set_cmd ("hash", no_class
, var_boolean
, (char *) &hashmark
,
1192 "Set display of activity while downloading a file.\nWhen enabled, a period \'.\' is displayed.",
1197 add_set_cmd ("timeout", no_class
, var_zinteger
,
1199 "Set timeout in seconds for remote MIPS serial I/O.",
1204 add_set_cmd ("remotelog", no_class
, var_zinteger
,
1205 (char *) &monitor_log
,
1206 "Set monitor activity log on(=1) or off(=0).",
1211 add_set_cmd ("remotexon", no_class
, var_zinteger
,
1213 "Set remote tty line XON control",
1218 add_set_cmd ("remotexoff", no_class
, var_zinteger
,
1220 "Set remote tty line XOFF control",
1224 add_com ("rombug <command>", class_obscure
, rombug_command
,
1225 "Send a command to the debug monitor.");
1227 add_com ("connect", class_obscure
, connect_command
,
1228 "Connect the terminal directly up to a serial based command monitor.\nUse <CR>~. or <CR>~^D to break out.");