2014-02-24 Yao Qi <yao@codesourcery.com>
+ * target.h (enum target_xfer_status)
+ <TARGET_XFER_E_UNAVAILABLE>: Rename it to ...
+ <TARGET_XFER_UNAVAILABLE>: ... it with setting value 2
+ explicitly. New.
+ * corefile.c (memory_error_message): User updated.
+ * exec.c (section_table_read_available_memory): Likewise.
+ * record-btrace.c (record_btrace_xfer_partial): Likewise.
+ * target.c (target_xfer_status_to_string): Likewise.
+ (raw_memory_xfer_partial): Likewise.
+ (memory_xfer_partial_1, target_xfer_partial): Likewise.
+ * valops.c (read_value_memory): Likewise.
+ * exec.h: Update comments.
+
+2014-02-24 Yao Qi <yao@codesourcery.com>
+
* target.c (target_xfer_status_to_string): Rename argument err
to status.
* target.h (target_xfer_status_to_string): Update declaration.
bounds. */
return xstrprintf (_("Cannot access memory at address %s"),
paddress (gdbarch, memaddr));
- case TARGET_XFER_E_UNAVAILABLE:
+ case TARGET_XFER_UNAVAILABLE:
return xstrprintf (_("Memory at address %s unavailable."),
paddress (gdbarch, memaddr));
default:
case TARGET_XFER_E_IO:
exception = MEMORY_ERROR;
break;
- case TARGET_XFER_E_UNAVAILABLE:
+ case TARGET_XFER_UNAVAILABLE:
exception = NOT_AVAILABLE_ERROR;
break;
}
else
{
*xfered_len = r->start - offset;
- status = TARGET_XFER_E_UNAVAILABLE;
+ status = TARGET_XFER_UNAVAILABLE;
}
do_cleanups (old_chain);
return status;
do_cleanups (old_chain);
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
enum target_xfer_status
/* Read from mappable read-only sections of BFD executable files.
Similar to exec_read_partial_read_only, but return
- TARGET_XFER_E_UNAVAILABLE if data is unavailable. */
+ TARGET_XFER_UNAVAILABLE if data is unavailable. */
extern enum target_xfer_status
section_table_read_available_memory (gdb_byte *readbuf, ULONGEST offset,
if (writebuf != NULL)
{
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
/* We allow reading readonly memory. */
}
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
}
}
offset, len, xfered_len);
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
/* The to_insert_breakpoint method of target record-btrace. */
switch (status)
{
CASE(TARGET_XFER_E_IO);
- CASE(TARGET_XFER_E_UNAVAILABLE);
+ CASE(TARGET_XFER_UNAVAILABLE);
default:
return "<unknown>";
}
break;
/* Stop if the target reports that the memory is not available. */
- if (res == TARGET_XFER_E_UNAVAILABLE)
+ if (res == TARGET_XFER_UNAVAILABLE)
break;
/* We want to continue past core files to executables, but not
/* No use trying further, we know some memory starting
at MEMADDR isn't available. */
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
}
/* Check implementations of to_xfer_partial update *XFERED_LEN
properly. Do assertion after printing debug messages, so that we
can find more clues on assertion failure from debugging messages. */
- if (retval == TARGET_XFER_OK || retval == TARGET_XFER_E_UNAVAILABLE)
+ if (retval == TARGET_XFER_OK || retval == TARGET_XFER_UNAVAILABLE)
gdb_assert (*xfered_len > 0);
return retval;
/* No further transfer is possible. */
TARGET_XFER_EOF = 0,
+ /* The piece of the object requested is unavailable. */
+ TARGET_XFER_UNAVAILABLE = 2,
+
/* Generic I/O error. Note that it's important that this is '-1',
as we still have target_xfer-related code returning hardcoded
'-1' on error. */
TARGET_XFER_E_IO = -1,
- /* Transfer failed because the piece of the object requested is
- unavailable. */
- TARGET_XFER_E_UNAVAILABLE = -2,
-
/* Keep list in sync with target_xfer_status_to_string. */
};
'enum target_xfer_status' value). Save the number of bytes
actually transferred in *XFERED_LEN if transfer is successful
(TARGET_XFER_OK) or the number unavailable bytes if the requested
- data is unavailable (TARGET_XFER_E_UNAVAILABLE). *XFERED_LEN
+ data is unavailable (TARGET_XFER_UNAVAILABLE). *XFERED_LEN
smaller than LEN does not indicate the end of the object, only
the end of the transfer; higher level code should continue
transferring if desired. This is handled in target.c.
if (status == TARGET_XFER_OK)
/* nothing */;
- else if (status == TARGET_XFER_E_UNAVAILABLE)
+ else if (status == TARGET_XFER_UNAVAILABLE)
mark_value_bytes_unavailable (val, embedded_offset + xfered,
xfered_len);
else if (status == TARGET_XFER_EOF)