mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
Return std::string from memory_error_message
This changes memory_error_message to return a std::string and fixes up the callers. This removes some cleanups. ChangeLog 2017-09-03 Tom Tromey <tom@tromey.com> * valprint.c (val_print_string): Update. * gdbcore.h (memory_error_message): Return std::string. * corefile.c (memory_error_message): Return std::string. (memory_error): Update. * breakpoint.c (insert_bp_location): Update.
This commit is contained in:
@@ -2988,13 +2988,10 @@ val_print_string (struct type *elttype, const char *encoding,
|
||||
|
||||
if (err != 0)
|
||||
{
|
||||
char *str;
|
||||
|
||||
str = memory_error_message (TARGET_XFER_E_IO, gdbarch, addr);
|
||||
make_cleanup (xfree, str);
|
||||
std::string str = memory_error_message (TARGET_XFER_E_IO, gdbarch, addr);
|
||||
|
||||
fprintf_filtered (stream, "<error: ");
|
||||
fputs_filtered (str, stream);
|
||||
fputs_filtered (str.c_str (), stream);
|
||||
fprintf_filtered (stream, ">");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user