#include "cp-support.h"
#include "gdb_obstack.h"
#include <ctype.h>
+#include "exceptions.h"
extern void _initialize_c_language (void);
}
else
{
- err = read_string (value_as_address (value), *length, width, fetchlimit,
- byte_order, buffer, length);
+ CORE_ADDR addr = value_as_address (value);
+
+ err = read_string (addr, *length, width, fetchlimit,
+ byte_order, buffer, length);
if (err)
{
xfree (*buffer);
- error (_("Error reading string from inferior: %s"),
- safe_strerror (err));
+ if (err == EIO)
+ throw_error (MEMORY_ERROR, "Address %s out of bounds",
+ paddress (get_type_arch (type), addr));
+ else
+ error (_("Error reading string from inferior: %s"),
+ safe_strerror (err));
}
}
are delegated to evaluate_subexp_standard; see that function for a
description of the arguments. */
-static struct value *
+struct value *
evaluate_subexp_c (struct type *expect_type, struct expression *exp,
int *pos, enum noside noside)
{