1 /* Remote debugging interface for boot monitors, for GDB.
2 Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* This file was derived from remote-eb.c, which did a similar job, but for
22 an AMD-29K running EBMON. That file was in turn derived from remote.c
23 as mentioned in the following comment (left in for comic relief):
25 "This is like remote.c but is for a different situation--
26 having a PC running os9000 hook up with a unix machine with
27 a serial line, and running ctty com2 on the PC. os9000 has a debug
28 monitor called ROMBUG running. Not to mention that the PC
29 has PC/NFS, so it can access the same executables that gdb can,
30 over the net in real time."
32 In reality, this module talks to a debug monitor called 'ROMBUG', which
33 We communicate with ROMBUG via a direct serial line, the network version
34 of ROMBUG is not available yet.
37 /* FIXME This file needs to be rewritten if it's to work again, either
38 to self-contained or to use the new monitor interface. */
44 #ifdef ANSI_PROTOTYPES
50 #include "gdb_string.h"
51 #include <sys/types.h>
55 #include "remote-utils.h"
59 #include "gdb-stabs.h"
61 struct cmd_list_element
*showlist
;
62 extern struct target_ops rombug_ops
; /* Forward declaration */
63 extern struct monitor_ops rombug_cmds
; /* Forward declaration */
64 extern struct cmd_list_element
*setlist
;
65 extern struct cmd_list_element
*unsetlist
;
66 extern int attach_flag
;
68 static void rombug_close ();
69 static void rombug_fetch_register ();
70 static void rombug_fetch_registers ();
71 static void rombug_store_register ();
73 static int sr_get_debug (); /* flag set by "set remotedebug" */
75 static int hashmark
; /* flag set by "set hash" */
76 static int rombug_is_open
= 0;
78 /* FIXME: Replace with sr_get_debug (). */
79 #define LOG_FILE "monitor.log"
81 static int monitor_log
= 0;
82 static int tty_xon
= 0;
83 static int tty_xoff
= 0;
85 static int timeout
= 10;
86 static int is_trace_mode
= 0;
87 /* Descriptor for I/O to remote machine. Initialize it to NULL */
88 static serial_t monitor_desc
= NULL
;
90 static CORE_ADDR bufaddr
= 0;
91 static int buflen
= 0;
92 static char readbuf
[16];
94 /* Send data to monitor. Works just like printf. */
96 #ifdef ANSI_PROTOTYPES
97 printf_monitor (char *pattern
,...)
99 printf_monitor (va_alist
)
107 #ifdef ANSI_PROTOTYPES
108 va_start (args
, pattern
);
112 pattern
= va_arg (args
, char *);
115 vsprintf (buf
, pattern
, args
);
118 if (SERIAL_WRITE (monitor_desc
, buf
, strlen (buf
)))
119 fprintf (stderr
, "SERIAL_WRITE failed: %s\n", safe_strerror (errno
));
122 /* Read a character from the remote system, doing all the fancy timeout stuff */
129 c
= SERIAL_READCHAR (monitor_desc
, timeout
);
134 if (monitor_log
&& isascii (c
))
135 putc (c
& 0x7f, log_file
);
140 if (c
== SERIAL_TIMEOUT
)
143 return c
; /* Polls shouldn't generate timeout errors */
145 error ("Timeout reading from remote system.");
148 perror_with_name ("remote-monitor");
151 /* Scan input from the remote system, until STRING is found. If DISCARD is
152 non-zero, then discard non-matching input, else print it out.
153 Let the user break out immediately. */
155 expect (string
, discard
)
163 printf ("Expecting \"%s\"\n", string
);
168 c
= readchar (timeout
);
177 printf ("\nMatched\n");
185 fwrite (string
, 1, (p
- 1) - string
, stdout
);
194 /* Keep discarding input until we see the ROMBUG prompt.
196 The convention for dealing with the prompt is that you
198 o *then* wait for the prompt.
200 Thus the last thing that a procedure does with the serial line
201 will be an expect_prompt(). Exception: rombug_resume does not
202 wait for the prompt, because the terminal is being handed over
203 to the inferior. However, the next thing which happens after that
204 is a rombug_wait which does wait for the prompt.
205 Note that this includes abnormal exit, e.g. error(). This is
206 necessary to prevent getting into states from which we can't
209 expect_prompt (discard
)
213 /* This is a convenient place to do this. The idea is to do it often
214 enough that we never lose much data if we terminate abnormally. */
219 expect ("trace", discard
);
223 expect (PROMPT
, discard
);
227 /* Get a hex digit from the remote system & return its value.
228 If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */
230 get_hex_digit (ignore_space
)
236 ch
= readchar (timeout
);
237 if (ch
>= '0' && ch
<= '9')
239 else if (ch
>= 'A' && ch
<= 'F')
240 return ch
- 'A' + 10;
241 else if (ch
>= 'a' && ch
<= 'f')
242 return ch
- 'a' + 10;
243 else if (ch
== ' ' && ignore_space
)
248 error ("Invalid hex digit from remote system.");
253 /* Get a byte from monitor and put it in *BYT. Accept any number
261 val
= get_hex_digit (1) << 4;
262 val
|= get_hex_digit (0);
266 /* Get N 32-bit words from remote, each preceded by a space,
267 and put them in registers starting at REGNO. */
269 get_hex_regs (n
, regno
)
277 for (i
= 0; i
< n
; i
++)
282 for (j
= 0; j
< 4; j
++)
285 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
286 val
= (val
<< 8) + b
;
288 val
= val
+ (b
<< (j
* 8));
290 supply_register (regno
++, (char *) &val
);
294 /* This is called not only when we first attach, but also when the
295 user types "run" after having attached. */
297 rombug_create_inferior (execfile
, args
, env
)
305 error ("Can't pass arguments to remote ROMBUG process");
307 if (execfile
== 0 || exec_bfd
== 0)
308 error ("No executable file specified");
310 entry_pt
= (int) bfd_get_start_address (exec_bfd
);
313 fputs ("\nIn Create_inferior()", log_file
);
316 /* The "process" (board) is already stopped awaiting our commands, and
317 the program is already downloaded. We just set its PC and go. */
319 init_wait_for_inferior ();
320 proceed ((CORE_ADDR
) entry_pt
, TARGET_SIGNAL_DEFAULT
, 0);
323 /* Open a connection to a remote debugger.
324 NAME is the filename used for communication. */
326 static char dev_name
[100];
329 rombug_open (args
, from_tty
)
334 error ("Use `target RomBug DEVICE-NAME' to use a serial port, or \n\
335 `target RomBug HOST-NAME:PORT-NUMBER' to use a network connection.");
337 target_preopen (from_tty
);
340 unpush_target (&rombug_ops
);
342 strcpy (dev_name
, args
);
343 monitor_desc
= SERIAL_OPEN (dev_name
);
344 if (monitor_desc
== NULL
)
345 perror_with_name (dev_name
);
347 /* if baud rate is set by 'set remotebaud' */
348 if (SERIAL_SETBAUDRATE (monitor_desc
, sr_get_baud_rate ()))
350 SERIAL_CLOSE (monitor_desc
);
351 perror_with_name ("RomBug");
353 SERIAL_RAW (monitor_desc
);
354 if (tty_xon
|| tty_xoff
)
356 struct hardware_ttystate
362 tty_s
= (struct hardware_ttystate
*) SERIAL_GET_TTY_STATE (monitor_desc
);
364 tty_s
->t
.c_iflag
|= IXON
;
366 tty_s
->t
.c_iflag
|= IXOFF
;
367 SERIAL_SET_TTY_STATE (monitor_desc
, (serial_ttystate
) tty_s
);
372 log_file
= fopen (LOG_FILE
, "w");
373 if (log_file
== NULL
)
374 perror_with_name (LOG_FILE
);
376 push_monitor (&rombug_cmds
);
377 printf_monitor ("\r"); /* CR wakes up monitor */
379 push_target (&rombug_ops
);
383 printf ("Remote %s connected to %s\n", target_shortname
,
386 rombug_fetch_registers ();
388 printf_monitor ("ov e \r");
395 * Close out all files and local state before this target loses control.
399 rombug_close (quitting
)
404 SERIAL_CLOSE (monitor_desc
);
411 if (ferror (log_file
))
412 fprintf (stderr
, "Error writing log file.\n");
413 if (fclose (log_file
) != 0)
414 fprintf (stderr
, "Error closing log file.\n");
420 rombug_link (mod_name
, text_reloc
)
422 CORE_ADDR
*text_reloc
;
428 printf_monitor ("l %s \r", mod_name
);
430 printf_monitor (".r \r");
431 expect (REG_DELIM
, 1);
432 for (i
= 0; i
<= 7; i
++)
435 for (j
= 0; j
< 4; j
++)
438 val
= (val
<< 8) + b
;
446 /* Terminate the open connection to the remote debugger.
447 Use this when you want to detach and do something else
450 rombug_detach (from_tty
)
455 printf_monitor (GO_CMD
);
458 pop_target (); /* calls rombug_close to do the real work */
460 printf ("Ending remote %s debugging\n", target_shortname
);
464 * Tell the remote machine to resume.
467 rombug_resume (pid
, step
, sig
)
469 enum target_signal sig
;
472 fprintf (log_file
, "\nIn Resume (step=%d, sig=%d)\n", step
, sig
);
477 printf_monitor (STEP_CMD
);
478 /* wait for the echo. **
479 expect (STEP_CMD, 1);
484 printf_monitor (GO_CMD
);
485 /* swallow the echo. **
494 * Wait until the remote machine stops, then return,
495 * storing status in status just as `wait' would.
499 rombug_wait (pid
, status
)
501 struct target_waitstatus
*status
;
503 int old_timeout
= timeout
;
504 struct section_offsets
*offs
;
506 struct obj_section
*obj_sec
;
509 fputs ("\nIn wait ()", log_file
);
511 status
->kind
= TARGET_WAITKIND_EXITED
;
512 status
->value
.integer
= 0;
514 timeout
= -1; /* Don't time out -- user program is running. */
515 expect ("eax:", 0); /* output any message before register display */
516 expect_prompt (1); /* Wait for prompt, outputting extraneous text */
518 status
->kind
= TARGET_WAITKIND_STOPPED
;
519 status
->value
.sig
= TARGET_SIGNAL_TRAP
;
520 timeout
= old_timeout
;
521 rombug_fetch_registers ();
524 pc
= read_register (PC_REGNUM
);
525 addr
= read_register (DATABASE_REG
);
526 obj_sec
= find_pc_section (pc
);
529 if (obj_sec
->objfile
!= symfile_objfile
)
530 new_symfile_objfile (obj_sec
->objfile
, 1, 0);
531 offs
= ((struct section_offsets
*)
532 alloca (sizeof (struct section_offsets
)
533 + (symfile_objfile
->num_sections
* sizeof (offs
->offsets
))));
534 memcpy (offs
, symfile_objfile
->section_offsets
,
535 (sizeof (struct section_offsets
) +
536 (symfile_objfile
->num_sections
* sizeof (offs
->offsets
))));
537 ANOFFSET (offs
, SECT_OFF_DATA
) = addr
;
538 ANOFFSET (offs
, SECT_OFF_BSS
) = addr
;
540 objfile_relocate (symfile_objfile
, offs
);
546 /* Return the name of register number regno in the form input and output by
547 monitor. Currently, register_names just happens to contain exactly what
548 monitor wants. Lets take advantage of that just as long as possible! */
563 for (p = REGISTER_NAME (regno); *p; p++)
567 p
= (char *) REGISTER_NAME (regno
);
574 /* read the remote registers into the block regs. */
577 rombug_fetch_registers ()
583 printf_monitor (GET_REG
);
594 for (regno
= 8; regno
<= 15; regno
++)
596 expect (REG_DELIM
, 1);
597 if (regno
>= 8 && regno
<= 13)
600 for (j
= 0; j
< 2; j
++)
603 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
604 val
= (val
<< 8) + b
;
606 val
= val
+ (b
<< (j
* 8));
611 if (regno
>= 9 && regno
<= 12)
615 supply_register (i
, (char *) &val
);
617 else if (regno
== 14)
619 get_hex_regs (1, PC_REGNUM
);
621 else if (regno
== 15)
628 supply_register (regno
, (char *) &val
);
635 /* Fetch register REGNO, or all registers if REGNO is -1.
636 Returns errno value. */
638 rombug_fetch_register (regno
)
646 fprintf (log_file
, "\nIn Fetch Register (reg=%s)\n", get_reg_name (regno
));
652 rombug_fetch_registers ();
656 char *name
= get_reg_name (regno
);
657 printf_monitor (GET_REG
);
658 if (regno
>= 10 && regno
<= 15)
663 expect (REG_DELIM
, 1);
665 for (j
= 0; j
< 2; j
++)
668 if (TARGET_BYTE_ORDER
== BIG_ENDIAN
)
669 val
= (val
<< 8) + b
;
671 val
= val
+ (b
<< (j
* 8));
673 supply_register (regno
, (char *) &val
);
675 else if (regno
== 8 || regno
== 9)
681 expect (REG_DELIM
, 1);
682 get_hex_regs (1, regno
);
687 expect (REG_DELIM
, 1);
703 /* Store the remote registers from the contents of the block REGS. */
706 rombug_store_registers ()
710 for (regno
= 0; regno
<= PC_REGNUM
; regno
++)
711 rombug_store_register (regno
);
713 registers_changed ();
716 /* Store register REGNO, or all if REGNO == 0.
717 return errno value. */
719 rombug_store_register (regno
)
725 fprintf (log_file
, "\nIn Store_register (regno=%d)\n", regno
);
728 rombug_store_registers ();
732 printf ("Setting register %s to 0x%x\n", get_reg_name (regno
), read_register (regno
));
734 name
= get_reg_name (regno
);
737 printf_monitor (SET_REG
, name
, read_register (regno
));
744 /* Get ready to modify the registers array. On machines which store
745 individual registers, this doesn't need to do anything. On machines
746 which store all the registers in one fell swoop, this makes sure
747 that registers contains all the registers from the program being
751 rombug_prepare_to_store ()
753 /* Do nothing, since we can store individual regs */
759 printf ("\tAttached to %s at %d baud.\n",
760 dev_name
, sr_get_baud_rate ());
763 /* Copy LEN bytes of data from debugger memory at MYADDR
764 to inferior's memory at MEMADDR. Returns length moved. */
766 rombug_write_inferior_memory (memaddr
, myaddr
, len
)
768 unsigned char *myaddr
;
775 fprintf (log_file
, "\nIn Write_inferior_memory (memaddr=%x, len=%d)\n", memaddr
, len
);
777 printf_monitor (MEM_SET_CMD
, memaddr
);
778 for (i
= 0; i
< len
; i
++)
780 expect (CMD_DELIM
, 1);
781 printf_monitor ("%x \r", myaddr
[i
]);
783 printf ("\nSet 0x%x to 0x%x\n", memaddr
+ i
, myaddr
[i
]);
785 expect (CMD_DELIM
, 1);
787 printf_monitor (CMD_END
);
796 /* Read LEN bytes from inferior memory at MEMADDR. Put the result
797 at debugger address MYADDR. Returns length moved. */
799 rombug_read_inferior_memory (memaddr
, myaddr
, len
)
806 /* Number of bytes read so far. */
809 /* Starting address of this pass. */
810 unsigned long startaddr
;
812 /* Number of bytes to read in this pass. */
816 fprintf (log_file
, "\nIn Read_inferior_memory (memaddr=%x, len=%d)\n", memaddr
, len
);
818 /* Note that this code works correctly if startaddr is just less
819 than UINT_MAX (well, really CORE_ADDR_MAX if there was such a
820 thing). That is, something like
821 rombug_read_bytes (CORE_ADDR_MAX - 4, foo, 4)
822 works--it never adds len To memaddr and gets 0. */
823 /* However, something like
824 rombug_read_bytes (CORE_ADDR_MAX - 3, foo, 4)
825 doesn't need to work. Detect it and give up if there's an attempt
827 if (((memaddr
- 1) + len
) < memaddr
)
832 if (bufaddr
<= memaddr
&& (memaddr
+ len
) <= (bufaddr
+ buflen
))
834 memcpy (myaddr
, &readbuf
[memaddr
- bufaddr
], len
);
843 if ((startaddr
% 16) != 0)
844 len_this_pass
-= startaddr
% 16;
845 if (len_this_pass
> (len
- count
))
846 len_this_pass
= (len
- count
);
848 printf ("\nDisplay %d bytes at %x\n", len_this_pass
, startaddr
);
850 printf_monitor (MEM_DIS_CMD
, startaddr
, 8);
852 for (i
= 0; i
< 16; i
++)
854 get_hex_byte (&readbuf
[i
]);
858 memcpy (&myaddr
[count
], readbuf
, len_this_pass
);
859 count
+= len_this_pass
;
860 startaddr
+= len_this_pass
;
861 expect (CMD_DELIM
, 1);
864 printf_monitor (CMD_END
);
871 /* FIXME-someday! merge these two. */
873 rombug_xfer_inferior_memory (memaddr
, myaddr
, len
, write
, target
)
878 struct target_ops
*target
; /* ignored */
881 return rombug_write_inferior_memory (memaddr
, myaddr
, len
);
883 return rombug_read_inferior_memory (memaddr
, myaddr
, len
);
887 rombug_kill (args
, from_tty
)
891 return; /* ignore attempts to kill target system */
894 /* Clean up when a program exits.
895 The program actually lives on in the remote processor's RAM, and may be
896 run again without a download. Don't leave it full of breakpoint
900 rombug_mourn_inferior ()
902 remove_breakpoints ();
903 generic_mourn_inferior (); /* Do all the proper things now */
906 #define MAX_MONITOR_BREAKPOINTS 16
908 static CORE_ADDR breakaddr
[MAX_MONITOR_BREAKPOINTS
] =
912 rombug_insert_breakpoint (addr
, shadow
)
917 CORE_ADDR bp_addr
= addr
;
921 fprintf (log_file
, "\nIn Insert_breakpoint (addr=%x)\n", addr
);
922 BREAKPOINT_FROM_PC (&bp_addr
, &bp_size
);
924 for (i
= 0; i
<= MAX_MONITOR_BREAKPOINTS
; i
++)
925 if (breakaddr
[i
] == 0)
929 printf ("Breakpoint at %x\n", addr
);
930 rombug_read_inferior_memory (bp_addr
, shadow
, bp_size
);
931 printf_monitor (SET_BREAK_CMD
, addr
);
937 fprintf (stderr
, "Too many breakpoints (> 16) for monitor\n");
942 * _remove_breakpoint -- Tell the monitor to remove a breakpoint
945 rombug_remove_breakpoint (addr
, shadow
)
952 fprintf (log_file
, "\nIn Remove_breakpoint (addr=%x)\n", addr
);
954 for (i
= 0; i
< MAX_MONITOR_BREAKPOINTS
; i
++)
955 if (breakaddr
[i
] == addr
)
958 printf_monitor (CLR_BREAK_CMD
, addr
);
964 fprintf (stderr
, "Can't find breakpoint associated with 0x%x\n", addr
);
968 /* Load a file. This is usually an srecord, which is ascii. No
969 protocol, just sent line by line. */
971 #define DOWNLOAD_LINE_SIZE 100
976 /* this part comment out for os9* */
979 char buf
[DOWNLOAD_LINE_SIZE
];
983 printf ("Loading %s to monitor\n", arg
);
985 download
= fopen (arg
, "r");
986 if (download
== NULL
)
988 error (sprintf (buf
, "%s Does not exist", arg
));
992 printf_monitor (LOAD_CMD
);
993 /* expect ("Waiting for S-records from host... ", 1); */
995 while (!feof (download
))
997 bytes_read
= fread (buf
, sizeof (char), DOWNLOAD_LINE_SIZE
, download
);
1004 if (SERIAL_WRITE (monitor_desc
, buf
, bytes_read
))
1006 fprintf (stderr
, "SERIAL_WRITE failed: (while downloading) %s\n", safe_strerror (errno
));
1010 while (i
++ <= 200000)
1012 }; /* Ugly HACK, probably needs flow control */
1013 if (bytes_read
< DOWNLOAD_LINE_SIZE
)
1015 if (!feof (download
))
1016 error ("Only read %d bytes\n", bytes_read
);
1025 if (!feof (download
))
1026 error ("Never got EOF while downloading");
1031 /* Put a command string, in args, out to MONITOR.
1032 Output from MONITOR is placed on the users terminal until the prompt
1036 rombug_command (args
, fromtty
)
1040 if (monitor_desc
== NULL
)
1041 error ("monitor target not open.");
1044 fprintf (log_file
, "\nIn command (args=%s)\n", args
);
1047 error ("Missing command.");
1049 printf_monitor ("%s\r", args
);
1054 /* Connect the user directly to MONITOR. This command acts just like the
1055 'cu' or 'tip' command. Use <CR>~. or <CR>~^D to break out. */
1057 static struct ttystate ttystate
;
1062 printf ("\r\n[Exiting connect mode]\r\n");
1063 /*SERIAL_RESTORE(0, &ttystate); */
1067 connect_command (args
, fromtty
)
1078 if (monitor_desc
== NULL
)
1079 error ("monitor target not open.");
1082 fprintf ("This command takes no args. They have been ignored.\n");
1084 printf ("[Entering connect mode. Use ~. or ~^D to escape]\n");
1086 serial_raw (0, &ttystate
);
1088 make_cleanup (cleanup_tty
, 0);
1096 FD_SET (0, &readfds
);
1097 FD_SET (monitor_desc
, &readfds
);
1098 numfds
= select (sizeof (readfds
) * 8, &readfds
, 0, 0, 0);
1100 while (numfds
== 0);
1103 perror_with_name ("select");
1105 if (FD_ISSET (0, &readfds
))
1106 { /* tty input, send to monitor */
1109 perror_with_name ("connect");
1111 printf_monitor ("%c", c
);
1125 if (c
== '.' || c
== '\004')
1132 if (FD_ISSET (monitor_desc
, &readfds
))
1148 * Define the monitor command strings. Since these are passed directly
1149 * through to a printf style function, we need can include formatting
1150 * strings. We also need a CR or LF on the end.
1152 #warning FIXME: monitor interface pattern strings, stale struct decl
1153 struct monitor_ops rombug_cmds
=
1155 "g \r", /* execute or usually GO command */
1156 "g \r", /* continue command */
1157 "t \r", /* single step */
1158 "b %x\r", /* set a breakpoint */
1159 "k %x\r", /* clear a breakpoint */
1160 "c %x\r", /* set memory to a value */
1161 "d %x %d\r", /* display memory */
1162 "$%08X", /* prompt memory commands use */
1163 ".%s %x\r", /* set a register */
1164 ":", /* delimiter between registers */
1165 ". \r", /* read a register */
1166 "mf \r", /* download command */
1167 "RomBug: ", /* monitor command prompt */
1168 ": ", /* end-of-command delimitor */
1169 ".\r" /* optional command terminator */
1172 struct target_ops rombug_ops
;
1175 init_rombug_ops (void)
1177 rombug_ops
.to_shortname
= "rombug";
1178 rombug_ops
.to_longname
= "Microware's ROMBUG debug monitor";
1179 rombug_ops
.to_doc
= "Use a remote computer running the ROMBUG debug monitor.\n\
1180 Specify the serial device it is connected to (e.g. /dev/ttya).",
1181 rombug_ops
.to_open
= rombug_open
;
1182 rombug_ops
.to_close
= rombug_close
;
1183 rombug_ops
.to_attach
= 0;
1184 rombug_ops
.to_post_attach
= NULL
;
1185 rombug_ops
.to_require_attach
= NULL
;
1186 rombug_ops
.to_detach
= rombug_detach
;
1187 rombug_ops
.to_require_detach
= NULL
;
1188 rombug_ops
.to_resume
= rombug_resume
;
1189 rombug_ops
.to_wait
= rombug_wait
;
1190 rombug_ops
.to_post_wait
= NULL
;
1191 rombug_ops
.to_fetch_registers
= rombug_fetch_register
;
1192 rombug_ops
.to_store_registers
= rombug_store_register
;
1193 rombug_ops
.to_prepare_to_store
= rombug_prepare_to_store
;
1194 rombug_ops
.to_xfer_memory
= rombug_xfer_inferior_memory
;
1195 rombug_ops
.to_files_info
= rombug_files_info
;
1196 rombug_ops
.to_insert_breakpoint
= rombug_insert_breakpoint
;
1197 rombug_ops
.to_remove_breakpoint
= rombug_remove_breakpoint
; /* Breakpoints */
1198 rombug_ops
.to_terminal_init
= 0;
1199 rombug_ops
.to_terminal_inferior
= 0;
1200 rombug_ops
.to_terminal_ours_for_output
= 0;
1201 rombug_ops
.to_terminal_ours
= 0;
1202 rombug_ops
.to_terminal_info
= 0; /* Terminal handling */
1203 rombug_ops
.to_kill
= rombug_kill
;
1204 rombug_ops
.to_load
= rombug_load
; /* load */
1205 rombug_ops
.to_lookup_symbol
= rombug_link
; /* lookup_symbol */
1206 rombug_ops
.to_create_inferior
= rombug_create_inferior
;
1207 rombug_ops
.to_post_startup_inferior
= NULL
;
1208 rombug_ops
.to_acknowledge_created_inferior
= NULL
;
1209 rombug_ops
.to_clone_and_follow_inferior
= NULL
;
1210 rombug_ops
.to_post_follow_inferior_by_clone
= NULL
;
1211 rombug_ops
.to_insert_fork_catchpoint
= NULL
;
1212 rombug_ops
.to_remove_fork_catchpoint
= NULL
;
1213 rombug_ops
.to_insert_vfork_catchpoint
= NULL
;
1214 rombug_ops
.to_remove_vfork_catchpoint
= NULL
;
1215 rombug_ops
.to_has_forked
= NULL
;
1216 rombug_ops
.to_has_vforked
= NULL
;
1217 rombug_ops
.to_can_follow_vfork_prior_to_exec
= NULL
;
1218 rombug_ops
.to_post_follow_vfork
= NULL
;
1219 rombug_ops
.to_insert_exec_catchpoint
= NULL
;
1220 rombug_ops
.to_remove_exec_catchpoint
= NULL
;
1221 rombug_ops
.to_has_execd
= NULL
;
1222 rombug_ops
.to_reported_exec_events_per_exec_call
= NULL
;
1223 rombug_ops
.to_has_exited
= NULL
;
1224 rombug_ops
.to_mourn_inferior
= rombug_mourn_inferior
;
1225 rombug_ops
.to_can_run
= 0; /* can_run */
1226 rombug_ops
.to_notice_signals
= 0; /* notice_signals */
1227 rombug_ops
.to_thread_alive
= 0;
1228 rombug_ops
.to_stop
= 0; /* to_stop */
1229 rombug_ops
.to_pid_to_exec_file
= NULL
;
1230 rombug_ops
.to_core_file_to_sym_file
= NULL
;
1231 rombug_ops
.to_stratum
= process_stratum
;
1232 rombug_ops
.DONT_USE
= 0; /* next */
1233 rombug_ops
.to_has_all_memory
= 1;
1234 rombug_ops
.to_has_memory
= 1;
1235 rombug_ops
.to_has_stack
= 1;
1236 rombug_ops
.to_has_registers
= 1;
1237 rombug_ops
.to_has_execution
= 1; /* has execution */
1238 rombug_ops
.to_sections
= 0;
1239 rombug_ops
.to_sections_end
= 0; /* Section pointers */
1240 rombug_ops
.to_magic
= OPS_MAGIC
; /* Always the last thing */
1244 _initialize_remote_os9k ()
1247 add_target (&rombug_ops
);
1250 add_set_cmd ("hash", no_class
, var_boolean
, (char *) &hashmark
,
1251 "Set display of activity while downloading a file.\nWhen enabled, a period \'.\' is displayed.",
1256 add_set_cmd ("timeout", no_class
, var_zinteger
,
1258 "Set timeout in seconds for remote MIPS serial I/O.",
1263 add_set_cmd ("remotelog", no_class
, var_zinteger
,
1264 (char *) &monitor_log
,
1265 "Set monitor activity log on(=1) or off(=0).",
1270 add_set_cmd ("remotexon", no_class
, var_zinteger
,
1272 "Set remote tty line XON control",
1277 add_set_cmd ("remotexoff", no_class
, var_zinteger
,
1279 "Set remote tty line XOFF control",
1283 add_com ("rombug <command>", class_obscure
, rombug_command
,
1284 "Send a command to the debug monitor.");
1286 add_com ("connect", class_obscure
, connect_command
,
1287 "Connect the terminal directly up to a serial based command monitor.\nUse <CR>~. or <CR>~^D to break out.");