aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 7e74856..7f891c9 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -2737,7 +2737,7 @@ val_print_string (struct type *elttype, const char *encoding,
const struct value_print_options *options)
{
int force_ellipsis = 0; /* Force ellipsis to be printed if nonzero. */
- int errcode; /* Errno returned from bad reads. */
+ int err; /* Non-zero if we got a bad read. */
int found_nul; /* Non-zero if we found the nul char. */
unsigned int fetchlimit; /* Maximum number of chars to print. */
int bytes_read;
@@ -2758,8 +2758,8 @@ val_print_string (struct type *elttype, const char *encoding,
fetchlimit = (len == -1 ? options->print_max : min (len,
options->print_max));
- errcode = read_string (addr, len, width, fetchlimit, byte_order,
- &buffer, &bytes_read);
+ err = read_string (addr, len, width, fetchlimit, byte_order,
+ &buffer, &bytes_read);
old_chain = make_cleanup (xfree, buffer);
addr += bytes_read;
@@ -2787,7 +2787,7 @@ val_print_string (struct type *elttype, const char *encoding,
&& extract_unsigned_integer (peekbuf, width, byte_order) != 0)
force_ellipsis = 1;
}
- else if ((len >= 0 && errcode != 0) || (len > bytes_read / width))
+ else if ((len >= 0 && err != 0) || (len > bytes_read / width))
{
/* Getting an error when we have a requested length, or fetching less
than the number of characters actually requested, always make us
@@ -2798,17 +2798,17 @@ val_print_string (struct type *elttype, const char *encoding,
/* If we get an error before fetching anything, don't print a string.
But if we fetch something and then get an error, print the string
and then the error message. */
- if (errcode == 0 || bytes_read > 0)
+ if (err == 0 || bytes_read > 0)
{
LA_PRINT_STRING (stream, elttype, buffer, bytes_read / width,
encoding, force_ellipsis, options);
}
- if (errcode != 0)
+ if (err != 0)
{
char *str;
- str = memory_error_message (errcode, gdbarch, addr);
+ str = memory_error_message (TARGET_XFER_E_IO, gdbarch, addr);
make_cleanup (xfree, str);
fprintf_filtered (stream, "<error: ");