Add set option "remote_timeout" for setting remote_timeout.
Add set option "use_hard_breakpoints" for setting hardware
.vs. memory breakpoints.
+Fri Jun 28 05:25:18 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * remote-e7000.c,remote.c,target.h,top.c:
+ Add set option "remote_timeout" for setting remote_timeout.
+ Add set option "use_hard_breakpoints" for setting hardware
+ .vs. memory breakpoints.
+
Fri Jun 28 04:32:18 1996 Dawn Perchik <dawn@cygnus.com>
* remote-e7000.c (e7000_parse_device): New function.
#include "command.h"
#include <signal.h>
#include "gdb_string.h"
+#include "gdbcmd.h"
#include <sys/types.h>
#include "serial.h"
#include "remote-utils.h"
#include "symfile.h"
#include <time.h>
-#if 0
-#define HARD_BREAKPOINTS
-#define BC_BREAKPOINTS 0
+#if 1
+#define HARD_BREAKPOINTS /* Now handled by set option. */
+#define BC_BREAKPOINTS use_hard_breakpoints
#endif
#define CTRLC 0x03
static serial_t e7000_desc;
+/* Allow user to chose between using hardware breakpoints or memory. */
+static int use_hard_breakpoints = 0; /* use sw breakpoints by default */
+
/* Nonzero if using the tcp serial driver. */
static int using_tcp; /* direct tcp connection to target */
static int ctrl_c;
-static int timeout = 5;
+static int timeout = 20;
/* Send data to e7000debug. */
char buf[200];
int oldtimeout = timeout;
- timeout = 10;
+ timeout = remote_timeout;
sprintf (buf, "ftp %s\r", machine);
puts_e7000debug (buf);
int nostart;
time_t start_time, end_time; /* Start and end times of download */
unsigned long data_count; /* Number of bytes transferred to memory */
+ int oldtimeout = timeout;
+
+ timeout = remote_timeout;
/* FIXME! change test to test for type of download */
report_transfer_performance (data_count, start_time, end_time);
do_cleanups (old_chain);
+ timeout = oldtimeout;
}
/* Clean up when a program exits.
generic_mourn_inferior (); /* Do all the proper things now */
}
+#define MAX_BREAKPOINTS 200
#ifdef HARD_BREAKPOINTS
-#define MAX_E7000DEBUG_BREAKPOINTS (BC_BREAKPOINTS ? 5 : 200)
+#define MAX_E7000DEBUG_BREAKPOINTS (BC_BREAKPOINTS ? 5 : MAX_BREAKPOINTS)
#else
-#define MAX_E7000DEBUG_BREAKPOINTS 200
+#define MAX_E7000DEBUG_BREAKPOINTS MAX_BREAKPOINTS
#endif
extern int memory_breakpoint_size;
-static CORE_ADDR breakaddr[MAX_E7000DEBUG_BREAKPOINTS] = {0};
+/* Since we can change to soft breakpoints dynamically, we must define
+ more than enough. Was breakaddr[MAX_E7000DEBUG_BREAKPOINTS]. */
+static CORE_ADDR breakaddr[MAX_BREAKPOINTS] = {0};
static int
e7000_insert_breakpoint (addr, shadow)
add_com ("drain", class_obscure, e7000_drain_command,
"Drain pending e7000 text buffers.");
+
+ add_show_from_set (add_set_cmd ("usehardbreakpoints", no_class,
+ var_integer, (char *)&use_hard_breakpoints,
+ "Set use of hardware breakpoints for all breakpoints.\n", &setlist),
+ &showlist);
}
#include "gdbcmd.h"
#include "objfiles.h"
#include "gdb-stabs.h"
-#include "thread.h"
+#include "gdbthread.h"
#include "dcache.h"
other form of hairy serial connection, I would think 2 seconds would
be plenty. */
-static int remote_timeout = 2;
+/* Changed to allow option to set timeout value.
+ was static int remote_timeout = 2; */
+extern int remote_timeout;
/* This variable chooses whether to send a ^C or a break when the user
requests program interruption. Although ^C is usually what remote
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (TARGET_H)
#define TARGET_H
void (*to_mourn_inferior) PARAMS ((void));
int (*to_can_run) PARAMS ((void));
void (*to_notice_signals) PARAMS ((int pid));
+ int (*to_thread_alive) PARAMS ((int pid));
void (*to_stop) PARAMS ((void));
enum strata to_stratum;
struct target_ops
#define target_notice_signals(pid) \
(*current_target.to_notice_signals) (pid)
+/* Check to see if a thread is still alive. */
+
+#define target_thread_alive(pid) \
+ (*current_target.to_thread_alive) (pid)
+
/* Make target stop in a continuable fashion. (For instance, under Unix, this
should act like SIGSTOP). This function is normally used by GUIs to
implement a stop button. */
extern char *normal_pid_to_str PARAMS ((int pid));
#endif
+#ifndef target_new_objfile
+#define target_new_objfile(OBJFILE)
+#endif
+
+/* Hook to call target-dependant code after reading in a new symbol table. */
+
+#ifndef TARGET_SYMFILE_POSTREAD
+#define TARGET_SYMFILE_POSTREAD(OBJFILE)
+#endif
+
+/* Hook to call target dependant code just after inferior target process has
+ started. */
+
+#ifndef TARGET_CREATE_INFERIOR_HOOK
+#define TARGET_CREATE_INFERIOR_HOOK(PID)
+#endif
+
/* Hardware watchpoint interfaces. */
/* Returns non-zero if we were stopped by a hardware watchpoint (memory read or
#define STOPPED_BY_WATCHPOINT(w) 0
#endif
+/* Provide defaults for systems that don't support hardware watchpoints. */
+
+#ifndef TARGET_HAS_HARDWARE_WATCHPOINTS
+
+/* Returns non-zero if we can set a hardware watchpoint of type TYPE. TYPE is
+ one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint, or
+ bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
+ (including this one?). OTHERTYPE is who knows what... */
+
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE,CNT,OTHERTYPE) 0
+
+/* Set/clear a hardware watchpoint starting at ADDR, for LEN bytes. TYPE is 1
+ for read and 2 for read/write accesses. Returns 0 for success, non-zero for
+ failure. */
+
+#define target_remove_watchpoint(ADDR,LEN,TYPE) -1
+#define target_insert_watchpoint(ADDR,LEN,TYPE) -1
+
+#endif /* TARGET_HAS_HARDWARE_WATCHPOINTS */
+
+#ifndef target_insert_hw_breakpoint
+#define target_remove_hw_breakpoint(ADDR,SHADOW) -1
+#define target_insert_hw_breakpoint(ADDR,SHADOW) -1
+#endif
+
+#ifndef target_stopped_data_address
+#define target_stopped_data_address() 0
+#endif
+
+/* If defined, then we need to decr pc by this much after a hardware break-
+ point. Presumably this overrides DECR_PC_AFTER_BREAK... */
+
+#ifndef DECR_PC_AFTER_HW_BREAK
+#define DECR_PC_AFTER_HW_BREAK 0
+#endif
+
/* Routines for maintenance of the target structures...
add_target: Add a target to the list of all possible targets.
/* Speed in bits per second, or -1 which means don't mess with the speed. */
extern int baud_rate;
+/* Timeout limit for response from target. */
+extern int remote_timeout;
\f
/* Functions for helping to write a native target. */
int baud_rate = -1;
+/* Timeout limit for response from target. */
+
+int remote_timeout = 20; /* Set default to 20 */
+
/* Non-zero tells remote* modules to output debugging info. */
int remote_debug = 0;
When enabled, each packet sent or received with the remote target\n\
is displayed.", &setlist),
&showlist);
+
+ add_show_from_set (
+ add_set_cmd ("remotetimeout", no_class, var_integer, (char *)&remote_timeout,
+ "Set timeout limit to wait for target to respond.\n\
+This value is used to set the time limit for gdb to wait for a response\n\
+from he target.", &setlist),
+ &showlist);
}