mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-05 21:50:21 +08:00
Use ui_file_as_string in gdb/xtensa-tdep.c
gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * xtensa-tdep.c (xtensa_verify_config): Use ui_file_as_string and std::string.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2016-11-08 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* xtensa-tdep.c (xtensa_verify_config): Use ui_file_as_string and
|
||||
std::string.
|
||||
|
||||
2016-11-08 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* dwarf2read.c (dwarf2_compute_name): Use ui_file_as_string and
|
||||
|
@ -3066,8 +3066,6 @@ xtensa_verify_config (struct gdbarch *gdbarch)
|
||||
struct ui_file *log;
|
||||
struct cleanup *cleanups;
|
||||
struct gdbarch_tdep *tdep;
|
||||
long length;
|
||||
char *buf;
|
||||
|
||||
tdep = gdbarch_tdep (gdbarch);
|
||||
log = mem_fileopen ();
|
||||
@ -3099,11 +3097,10 @@ xtensa_verify_config (struct gdbarch *gdbarch)
|
||||
if (tdep->a0_base == -1)
|
||||
fprintf_unfiltered (log, _("\n\ta0_base: No Ax registers"));
|
||||
|
||||
buf = ui_file_xstrdup (log, &length);
|
||||
make_cleanup (xfree, buf);
|
||||
if (length > 0)
|
||||
std::string buf = ui_file_as_string (log);
|
||||
if (!buf.empty ())
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("the following are invalid: %s"), buf);
|
||||
_("the following are invalid: %s"), buf.c_str ());
|
||||
do_cleanups (cleanups);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user