diff options
Diffstat (limited to 'gdb/ctf.c')
-rw-r--r-- | gdb/ctf.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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 { |