mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
Return std::string from gdb_bfd_errmsg
This changes gdb_bfd_errmsg to return a std::string, removing a cleanup. This approach may be slightly less efficient than the previous code, but I don't believe this is very important in this situation. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> * utils.h (gdb_bfd_errmsg): Return std::string. * exec.c (exec_file_attach): Update. * compile/compile-object-load.c (compile_object_load): Update. * utils.c (gdb_bfd_errmsg): Return std::string.
This commit is contained in:
@@ -638,7 +638,8 @@ compile_object_load (const compile_file_names &file_names,
|
||||
|
||||
if (!bfd_check_format_matches (abfd.get (), bfd_object, &matching))
|
||||
error (_("\"%s\": not in loadable format: %s"),
|
||||
filename.get (), gdb_bfd_errmsg (bfd_get_error (), matching));
|
||||
filename.get (),
|
||||
gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
|
||||
|
||||
if ((bfd_get_file_flags (abfd.get ()) & (EXEC_P | DYNAMIC)) != 0)
|
||||
error (_("\"%s\": not in object format."), filename.get ());
|
||||
|
||||
Reference in New Issue
Block a user