diff options
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index 1a9215a..7956455 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -486,6 +486,16 @@ solib_map_sections (struct so_list *so) /* Leave bfd open, core_xfer_memory and "info files" need it. */ so->abfd = abfd; + /* Copy the full path name into so_name, allowing symbol_file_add + to find it later. This also affects the =library-loaded GDB/MI + event, and in particular the part of that notification providing + the library's host-side path. If we let the target dictate + that objfile's path, and the target is different from the host, + GDB/MI will not provide the correct host-side path. */ + if (strlen (bfd_get_filename (abfd)) >= SO_NAME_MAX_PATH_SIZE) + error (_("Shared library file name is too long.")); + strcpy (so->so_name, bfd_get_filename (abfd)); + if (build_section_table (abfd, &so->sections, &so->sections_end)) { error (_("Can't find the file sections in `%s': %s"), |