aboutsummaryrefslogtreecommitdiff
path: root/gdb/ctf.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ctf.c')
-rw-r--r--gdb/ctf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/ctf.c b/gdb/ctf.c
index 95fd31f..ebd40d6 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1377,6 +1377,7 @@ ctf_xfer_partial (struct target_ops *ops, enum target_object object,
{
struct bt_iter_pos *pos;
int i = 0;
+ enum target_xfer_status res;
gdb_assert (ctf_iter != NULL);
/* Save the current position. */
@@ -1466,7 +1467,20 @@ ctf_xfer_partial (struct target_ops *ops, enum target_object object,
/* Restore the position. */
bt_iter_set_pos (bt_ctf_get_iter (ctf_iter), pos);
- return exec_read_partial_read_only (readbuf, offset, len, xfered_len);
+ /* Requested memory is unavailable in the context of traceframes,
+ and this address falls within a read-only section, fallback
+ to reading from executable. */
+ res = exec_read_partial_read_only (readbuf, offset, len, xfered_len);
+
+ if (res == TARGET_XFER_OK)
+ return TARGET_XFER_OK;
+ else
+ {
+ /* No use trying further, we know some memory starting
+ at MEMADDR isn't available. */
+ *xfered_len = len;
+ return TARGET_XFER_UNAVAILABLE;
+ }
}
else
{