This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] btrace: allow full memory and register access for non-replaying threads
- From: Markus Metzger <mmetzger at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 18 Sep 2015 12:35:23 -0000
- Subject: [binutils-gdb] btrace: allow full memory and register access for non-replaying threads
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4d10e986f499f330963c4641fd91046c57c94bd8
commit 4d10e986f499f330963c4641fd91046c57c94bd8
Author: Markus Metzger <markus.t.metzger@intel.com>
Date: Tue Sep 8 09:05:38 2015 +0200
btrace: allow full memory and register access for non-replaying threads
The record btrace target does not allow accessing memory and storing registers
while replaying. For multi-threaded applications, this prevents those
accesses also for threads that are at the end of their execution history as
long as at least one thread is replaying.
Change this to only check if the selected thread is replaying. This allows
threads that are at the end of their execution history to read and write
memory and to store registers.
Also change the error message to reflect this change.
gdb/
* record-btrace.c (record_btrace_xfer_partial)
(record_btrace_store_registers, record_btrace_prepare_to_store):
Call record_btrace_is_replaying with inferior_ptid instead of
minus_one_ptid.
(record_btrace_store_registers): Change error message.
Diff:
---
gdb/ChangeLog | 8 ++++++++
gdb/record-btrace.c | 8 ++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index db5386e..1c4922f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2015-09-18 Markus Metzger <markus.t.metzger@intel.com>
+ * record-btrace.c (record_btrace_xfer_partial)
+ (record_btrace_store_registers, record_btrace_prepare_to_store):
+ Call record_btrace_is_replaying with inferior_ptid instead of
+ minus_one_ptid.
+ (record_btrace_store_registers): Change error message.
+
+2015-09-18 Markus Metzger <markus.t.metzger@intel.com>
+
* record-btrace.c (record_btrace_is_replaying): Add ptid argument.
Update users to pass minus_one_ptid.
* record-full.c (record_full_is_replaying): Add ptid argument (ignored).
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 481d22d..b4e4560 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -1160,7 +1160,7 @@ record_btrace_xfer_partial (struct target_ops *ops, enum target_object object,
/* Filter out requests that don't make sense during replay. */
if (replay_memory_access == replay_memory_access_read_only
&& !record_btrace_generating_corefile
- && record_btrace_is_replaying (ops, minus_one_ptid))
+ && record_btrace_is_replaying (ops, inferior_ptid))
{
switch (object)
{
@@ -1314,8 +1314,8 @@ record_btrace_store_registers (struct target_ops *ops,
struct target_ops *t;
if (!record_btrace_generating_corefile
- && record_btrace_is_replaying (ops, minus_one_ptid))
- error (_("This record target does not allow writing registers."));
+ && record_btrace_is_replaying (ops, inferior_ptid))
+ error (_("Cannot write registers while replaying."));
gdb_assert (may_write_registers != 0);
@@ -1332,7 +1332,7 @@ record_btrace_prepare_to_store (struct target_ops *ops,
struct target_ops *t;
if (!record_btrace_generating_corefile
- && record_btrace_is_replaying (ops, minus_one_ptid))
+ && record_btrace_is_replaying (ops, inferior_ptid))
return;
t = ops->beneath;