From 1456ad8e67b1dd1b2e46fbc6e926bd312330ea24 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 28 Jun 2001 20:03:10 +0000 Subject: [PATCH] From 2000-12-03 Stephane Carrez : * 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. --- gdb/ChangeLog | 11 +++++++++++ gdb/monitor.c | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c7197a45ed7..ae7934a41b5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2001-06-28 Andrew Cagney + + From 2000-12-03 Stephane Carrez : + * 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. + 2001-06-28 Andrew Cagney From 2000-06-14 John Marshall : 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"); -- 2.30.2