aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-frv.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-06-15 06:28:09 -0600
committerTom Tromey <tromey@adacore.com>2020-06-15 06:28:10 -0600
commit669203174311c5be76744a879563c697cd479853 (patch)
tree77b21ddbec4501e2cf04dafd9987a347d66e8cc2 /gdb/solib-frv.c
parenta5d871ddaf2aa8462922ed25b0c0dc7f02128cb9 (diff)
downloadfsf-binutils-gdb-669203174311c5be76744a879563c697cd479853.zip
fsf-binutils-gdb-669203174311c5be76744a879563c697cd479853.tar.gz
fsf-binutils-gdb-669203174311c5be76744a879563c697cd479853.tar.bz2
Change target_read_string API
This simplifies the target_read_string API a bit. Note that some code was using safe_strerror on the error codes returned by target_read_string. It seems to me that this is incorrect (if it was ever correct, it must have been quite a long time ago). gdb/ChangeLog 2020-06-15 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat::handle_output_debug_string): Update. (windows_nat::handle_ms_vc_exception): Update. * target.h (target_read_string): Change API. * target.c (target_read_string): Change API. * solib-svr4.c (open_symbol_file_object, svr4_read_so_list): Update. * solib-frv.c (frv_current_sos): Update. * solib-dsbt.c (dsbt_current_sos): Update. * solib-darwin.c (darwin_current_sos): Update. * linux-thread-db.c (inferior_has_bug): Update. * expprint.c (print_subexp_standard): Update. * ada-lang.c (ada_main_name, ada_tag_name_from_tsd) (ada_exception_message_1): Update.
Diffstat (limited to 'gdb/solib-frv.c')
-rw-r--r--gdb/solib-frv.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 62e7b05..bce33a3 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -376,8 +376,6 @@ frv_current_sos (void)
this in the list of shared objects. */
if (got_addr != mgot)
{
- int errcode;
- gdb::unique_xmalloc_ptr<char> name_buf;
struct int_elf32_fdpic_loadmap *loadmap;
struct so_list *sop;
CORE_ADDR addr;
@@ -404,16 +402,15 @@ frv_current_sos (void)
addr = extract_unsigned_integer (lm_buf.l_name,
sizeof (lm_buf.l_name),
byte_order);
- target_read_string (addr, &name_buf, SO_NAME_MAX_PATH_SIZE - 1,
- &errcode);
+ gdb::unique_xmalloc_ptr<char> name_buf
+ = target_read_string (addr, SO_NAME_MAX_PATH_SIZE - 1);
if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog, "current_sos: name = %s\n",
name_buf.get ());
- if (errcode != 0)
- warning (_("Can't read pathname for link map entry: %s."),
- safe_strerror (errcode));
+ if (name_buf == nullptr)
+ warning (_("Can't read pathname for link map entry."));
else
{
strncpy (sop->so_name, name_buf.get (),