From: "Frank Ch. Eigler" <fche@redhat.com>
To: sid@sources.redhat.com
Subject: gdb-interface component patch
Date: Mon, 30 Jul 2001 09:11:00 -0000 [thread overview]
Message-ID: <20010730121153.C19631@redhat.com> (raw)
Hi -
I'm about to commit the following patch to sid/component/gdb. It adds
a new attribute "Z-packet-pc-mask", which allows Z packets coming from
gdb to be executable-level addresses as opposed to PC register values.
There is often a difference for Harvard architectures, where insn/data
address spaces are encoded into bits of the executable-level symbol
addresses. This new mask parameter is there to allow these bits to
be excluded from PC-watchpoint calculations.
- FChE
2001-07-30 Frank Ch. Eigler <fche@redhat.com>
* gdb.h (gdb::hw_breakpoint_pc_mask): New member variable.
* gdb.cxx (gdb ctor): Expose it as `Z-packet-pc-mask' attribute.
(remove_hw_breakpoint, add_hw_breakpoint): Respect it.
Index: gdb.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/gdb/gdb.cxx,v
retrieving revision 1.4
diff -u -r1.4 gdb.cxx
--- gdb.cxx 2001/07/20 11:41:42 1.4
+++ gdb.cxx 2001/07/30 16:09:03
@@ -1,6 +1,6 @@
// 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.
@@ -885,11 +885,25 @@
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)
@@ -922,11 +936,26 @@
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)
@@ -1158,6 +1187,7 @@
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");
@@ -1166,6 +1196,7 @@
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");
}
Index: gdb.h
===================================================================
RCS file: /cvs/src/src/sid/component/gdb/gdb.h,v
retrieving revision 1.2
diff -u -r1.2 gdb.h
--- gdb.h 2001/01/04 01:00:11 1.2
+++ gdb.h 2001/07/30 16:09:03
@@ -121,6 +121,7 @@
// hw breakpoint tracking
typedef map<host_int_8,int> hw_breakpoints_t;
hw_breakpoints_t hw_breakpoints; // address -> insertion-count
+ host_int_8 hw_breakpoint_pc_mask; // 0=disabled
bool add_hw_breakpoint (host_int_8);
bool remove_hw_breakpoint (host_int_8);
bool remove_all_hw_breakpoints ();
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7ZYdJVZbdDOm/ZT0RAixjAJ90GhpAHkIuAxR2+m9txPWzY21+awCeOG3n
pjV+wxIRyoTIIV/IGIuSOrw=
=F1xQ
-----END PGP SIGNATURE-----
reply other threads:[~2001-07-30 9:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010730121153.C19631@redhat.com \
--to=fche@redhat.com \
--cc=sid@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).