// gdb.cxx - GDB stub implementation. -*- C++ -*-
-// Copyright (C) 1999, 2000, 2001 Red Hat.
+// Copyright (C) 1999-2001 Red Hat.
// This file is part of SID and is licensed under the GPL.
// See the file COPYING.SID for conditions for redistribution.
return false;
}
- string watcher_name =
- string("watch:") +
- map_watchable_name ("gdb-register-pc") +
- string(":value:") +
- make_numeric_attribute (address);
+ string watcher_name;
+ if (this->hw_breakpoint_pc_mask)
+ {
+ watcher_name =
+ string ("watch:") +
+ map_watchable_name ("gdb-register-pc") + string (":") +
+ string ("mask/value:") +
+ make_numeric_attribute (this->hw_breakpoint_pc_mask) + string (":") +
+ make_numeric_attribute (address);
+ }
+ else
+ {
+ watcher_name =
+ string ("watch:") +
+ map_watchable_name ("gdb-register-pc") + string (":") +
+ string ("value:") +
+ make_numeric_attribute (address);
+ }
+ // see also ::add_hw_breakpoint()
this->hw_breakpoints[address] --;
if (this->hw_breakpoints[address] == 0)
bool
gdb::add_hw_breakpoint (host_int_8 address)
{
- string watcher_name =
- string("watch:") +
- map_watchable_name ("gdb-register-pc") +
- string(":value:") +
- make_numeric_attribute (address);
+ string watcher_name;
+ if (this->hw_breakpoint_pc_mask)
+ {
+ watcher_name =
+ string ("watch:") +
+ map_watchable_name ("gdb-register-pc") + string (":") +
+ string ("mask/value:") +
+ make_numeric_attribute (this->hw_breakpoint_pc_mask) + string (":") +
+ make_numeric_attribute (address);
+ }
+ else
+ {
+ watcher_name =
+ string ("watch:") +
+ map_watchable_name ("gdb-register-pc") + string (":") +
+ string ("value:") +
+ make_numeric_attribute (address);
+ }
+ // see also ::remove_hw_breakpoint()
+
this->hw_breakpoints[address] ++;
if (this->hw_breakpoints[address] == 1)
exit_on_detach = false;
enable_Z_packet = true;
operating_mode_p = true;
+ hw_breakpoint_pc_mask = 0;
add_attribute_notify ("trace-gdbserv?", & trace_gdbserv,
this, & gdb::update_trace_flags, "setting");
add_attribute ("exit-on-detach?", & exit_on_detach, "setting");
add_attribute ("enable-Z-packet?", & enable_Z_packet, "setting");
add_attribute ("operating-mode?", & operating_mode_p, "setting");
+ add_attribute ("Z-packet-pc-mask", & hw_breakpoint_pc_mask, "setting");
}