summaryrefslogtreecommitdiff
path: root/gdb/monitor.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-06-28 20:03:10 +0000
committerAndrew Cagney <cagney@redhat.com>2001-06-28 20:03:10 +0000
commit6a185e8e986acbfd02bd3ae34a9d538254e2c31d (patch)
tree09d800d05cc699dd5ecd35834960f8e02ba03832 /gdb/monitor.c
parent03a6838dd3cde4562bb00ba14d31722546938818 (diff)
downloadgdb-6a185e8e986acbfd02bd3ae34a9d538254e2c31d.tar.gz
From 2000-12-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
* monitor.c (setmem_resp_delim_pattern): New regexp pattern. (setreg_resp_delim_pattern): Likewise. (setmem_resp_delim_fastmap): New buffer. (setreg_resp_delim_fastmap): Likewise. (monitor_open): Initialize above regexp if they are defined. (monitor_write_memory): Use regexp to check the result of write. (monitor_store_register): Likewise to check result of register set.
Diffstat (limited to 'gdb/monitor.c')
-rw-r--r--gdb/monitor.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 4abb782bf21..1174dd9ff45 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -129,6 +129,12 @@ static char register_fastmap[256];
static struct re_pattern_buffer getmem_resp_delim_pattern;
static char getmem_resp_delim_fastmap[256];
+static struct re_pattern_buffer setmem_resp_delim_pattern;
+static char setmem_resp_delim_fastmap[256];
+
+static struct re_pattern_buffer setreg_resp_delim_pattern;
+static char setreg_resp_delim_fastmap[256];
+
static int dump_reg_flag; /* Non-zero means do a dump_registers cmd when
monitor_wait wakes up. */
@@ -752,6 +758,14 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
compile_pattern (mon_ops->getmem.resp_delim, &getmem_resp_delim_pattern,
getmem_resp_delim_fastmap);
+ if (mon_ops->setmem.resp_delim)
+ compile_pattern (mon_ops->setmem.resp_delim, &setmem_resp_delim_pattern,
+ setmem_resp_delim_fastmap);
+
+ if (mon_ops->setreg.resp_delim)
+ compile_pattern (mon_ops->setreg.resp_delim, &setreg_resp_delim_pattern,
+ setreg_resp_delim_fastmap);
+
unpush_target (targ_ops);
if (dev_name)
@@ -1340,6 +1354,13 @@ monitor_store_register (int regno)
else
monitor_printf (current_monitor->setreg.cmd, name, val);
+ if (current_monitor->setreg.resp_delim)
+ {
+ monitor_debug ("EXP setreg.resp_delim\n");
+ monitor_expect_regexp (&setreg_resp_delim_pattern, NULL, 0);
+ if (current_monitor->flags & MO_SETREG_INTERACTIVE)
+ monitor_printf ("%s\r", paddr_nz (val));
+ }
if (current_monitor->setreg.term)
{
monitor_debug ("EXP setreg.term\n");
@@ -1466,6 +1487,12 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
monitor_printf_noecho (cmd, memaddr);
+ if (current_monitor->setmem.resp_delim)
+ {
+ monitor_debug ("EXP setmem.resp_delim");
+ monitor_expect_regexp (&setmem_resp_delim_pattern, NULL, 0);
+ monitor_printf ("%x\r", val);
+ }
if (current_monitor->setmem.term)
{
monitor_debug ("EXP setmem.term");