43#include "gdbsupport/gdb_obstack.h"
47#include "readline/tilde.h"
59#include "gdbsupport/byte-vector.h"
60#include "gdbsupport/pathstuff.h"
61#include "gdbsupport/selftest.h"
63#include "gdbsupport/forward-scope-exit.h"
64#include "gdbsupport/buildargv.h"
76 unsigned long section_sent,
77 unsigned long section_size,
78 unsigned long total_sent,
79 unsigned long total_size);
99 objfile_flags
flags, CORE_ADDR reloff);
186scoped_restore_tmpl<int>
205 if (0 == (bfd_section_flags (sect) & (SEC_ALLOC | SEC_LOAD)))
209 else if (bfd_section_vma (*lowest) > bfd_section_vma (sect))
211 else if (bfd_section_vma (*lowest) == bfd_section_vma (sect)
212 && (bfd_section_size (*lowest) <= bfd_section_size (sect)))
226 struct bfd_section *asect = stp.the_bfd_section;
227 bfd *abfd = asect->owner;
229 if (bfd_section_flags (asect) & (SEC_ALLOC | SEC_LOAD)
230 && sap.size () < table.size ())
231 sap.emplace_back (stp.addr,
232 bfd_section_name (asect),
244 struct bfd_section *sec;
247 for (sec = abfd->sections; sec != NULL; sec = sec->next)
248 if (bfd_section_flags (sec) & (SEC_ALLOC | SEC_LOAD))
249 sap.emplace_back (bfd_section_vma (sec),
250 bfd_section_name (sec),
268 for (i = 0; i < sap.size (); i++)
270 int sectindex = sap[i].sectindex;
285 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".text");
289 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".data");
293 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".bss");
297 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".rodata");
345 CORE_ADDR start_addr;
347 ULONGEST align = ((ULONGEST) 1) << bfd_section_alignment (sect);
350 if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
358 start_addr = (lowest + align - 1) & -align;
365 for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
367 int indx = cur_sec->index;
374 if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
380 if (offsets[indx] == 0)
384 if (start_addr + bfd_section_size (sect) > offsets[indx]
385 && start_addr < offsets[indx] + bfd_section_size (cur_sec))
387 start_addr = offsets[indx] + bfd_section_size (cur_sec);
388 start_addr = (start_addr + align - 1) & -align;
399 lowest = start_addr + bfd_section_size (sect);
414 for (i = 0; i < addrs.size (); i++)
438 if (strcmp (s,
".dynbss") == 0)
440 if (strcmp (s,
".sdynbss") == 0)
466static std::vector<const struct other_sections *>
471 std::vector<const struct other_sections *> array (addrs.size ());
472 for (i = 0; i < addrs.size (); i++)
473 array[i] = &addrs[i];
487 asection *lower_sect;
488 CORE_ADDR lower_offset;
496 if (lower_sect == NULL)
498 warning (_(
"no loadable sections found in added symbol-file %s"),
499 bfd_get_filename (abfd));
503 lower_offset = bfd_section_vma (lower_sect);
515 std::vector<const struct other_sections *> addrs_sorted
519 std::vector<const struct other_sections *> abfd_addrs_sorted
525 std::vector<const struct other_sections *>
526 addrs_to_abfd_addrs (addrs->size (),
nullptr);
528 std::vector<const struct other_sections *>::iterator abfd_sorted_iter
529 = abfd_addrs_sorted.begin ();
534 while (abfd_sorted_iter != abfd_addrs_sorted.end ()
539 if (abfd_sorted_iter != abfd_addrs_sorted.end ()
546 index_in_addrs = sect - addrs->data ();
547 gdb_assert (addrs_to_abfd_addrs[index_in_addrs] == NULL);
548 addrs_to_abfd_addrs[index_in_addrs] = *abfd_sorted_iter;
565 for (i = 0; i < addrs->size (); i++)
574 if ((*addrs)[i].
addr != 0)
576 (*addrs)[i].addr -= sect->
addr;
577 lower_offset = (*addrs)[i].addr;
580 (*addrs)[i].addr = lower_offset;
585 const std::string §_name = (*addrs)[i].name;
601 if (!(sect_name ==
".gnu.liblist"
602 || sect_name ==
".gnu.conflict"
603 || (sect_name ==
".bss"
605 && (*addrs)[i - 1].
name ==
".dynbss"
606 && addrs_to_abfd_addrs[i - 1] != NULL)
607 || (sect_name ==
".sbss"
609 && (*addrs)[i - 1].
name ==
".sdynbss"
610 && addrs_to_abfd_addrs[i - 1] != NULL)))
611 warning (_(
"section %s not found in %s"), sect_name.c_str (),
612 bfd_get_filename (abfd));
614 (*addrs)[i].addr = 0;
615 (*addrs)[i].sectindex = -1;
638 if ((bfd_get_file_flags (
objfile->
obfd.get ()) & (EXEC_P | DYNAMIC)) == 0)
643 for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
646 if (bfd_section_vma (cur_sec) != 0)
655 CORE_ADDR lowest = 0;
686 for (cur_sec = abfd->sections; cur_sec != NULL;
687 cur_sec = cur_sec->next)
689 if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
692 bfd_set_section_vma (cur_sec, offsets[cur_sec->index]);
695 offsets[cur_sec->index]);
696 offsets[cur_sec->index] = 0;
722 if ((bfd_get_file_flags (abfd) & (EXEC_P | DYNAMIC)) == 0)
726 for (sect = abfd->sections; sect != NULL; sect = sect->next)
728 if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
736 low = bfd_section_vma (sect);
737 high = low + bfd_section_size (sect);
741 num_sections = bfd_count_sections (abfd);
744 data->segment_info.resize (num_sections);
746 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
750 if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
753 vma = bfd_section_vma (sect);
756 if (vma + bfd_section_size (sect) > high)
757 high = vma + bfd_section_size (sect);
759 data->segment_info[i] = 1;
762 data->segments.emplace_back (low, high - low);
812 if (bfd_get_file_flags (
objfile->
obfd.get ()) & EXEC_P)
819 else if (bfd_get_file_flags (
objfile->
obfd.get ()) & DYNAMIC
820 && bfd_get_start_address (
objfile->
obfd.get ()) != 0)
855 if (entry_point >= bfd_section_vma (sect)
856 && entry_point < (bfd_section_vma (sect)
857 + bfd_section_size (sect)))
898 symfile_add_flags add_flags)
918 gdb::optional<clear_symtab_users_cleanup> defer_clear_users;
956 if (addrs->size () > 0)
972 objfile_holder.release ();
973 if (defer_clear_users)
974 defer_clear_users->release ();
983 symfile_add_flags add_flags)
1037 symfile_add_flags add_flags,
1052 add_flags &= ~SYMFILE_NO_READ;
1070 && !
query (_(
"Load new symbol table from \"%s\"? "),
name))
1071 error (_(
"Not confirmed."));
1085 gdb_printf (_(
"Reading symbols from %ps...\n"),
1098 gdb_printf (_(
"Expanding full symbols from %ps...\n"),
1110 gdb_printf (_(
"(No debugging symbols found in %ps)\n"),
1134 bfd_cache_close_all ();
1143 symfile_add_flags symfile_flags,
1152 (bfd,
name, symfile_flags, &sap,
1164 symfile_add_flags add_flags,
1201 objfile_flags
flags, CORE_ADDR reloff)
1223 ? !
query (_(
"Discard symbol table from `%s'? "),
1225 : !
query (_(
"Discard symbol table? "))))
1226 error (_(
"Not confirmed."));
1247 struct objfile *parent_objfile)
1249 unsigned long file_crc;
1251 struct stat parent_stat, abfd_stat;
1252 int verified_as_different;
1290 if (bfd_stat (abfd.get (), &abfd_stat) == 0
1291 && abfd_stat.st_ino != 0
1292 && bfd_stat (parent_objfile->
obfd.get (), &parent_stat) == 0)
1294 if (abfd_stat.st_dev == parent_stat.st_dev
1295 && abfd_stat.st_ino == parent_stat.st_ino)
1299 _(
" no, same file as the objfile.\n"));
1303 verified_as_different = 1;
1306 verified_as_different = 0;
1308 file_crc_p =
gdb_bfd_crc (abfd.get (), &file_crc);
1318 if (crc != file_crc)
1320 unsigned long parent_crc;
1326 if (!verified_as_different)
1332 _(
" no, error computing CRC.\n"));
1338 if (verified_as_different || parent_crc != file_crc)
1339 warning (_(
"the debug information found in \"%s\""
1340 " does not match \"%s\" (CRC mismatch).\n"),
1361 _(
"The directory where separate debug "
1362 "symbols are searched for is \"%s\".\n"),
1366#if ! defined (DEBUG_SUBDIRECTORY)
1367#define DEBUG_SUBDIRECTORY ".debug"
1380 const char *canon_dir,
1381 const char *debuglink,
1386 _(
"\nLooking for separate debug info (debug link) for "
1390 std::string debugfile = dir;
1391 debugfile += debuglink;
1400 debugfile += debuglink;
1410 bool target_prefix = startswith (dir,
"target:");
1411 const char *dir_notarget = target_prefix ? dir + strlen (
"target:") : dir;
1412 std::vector<gdb::unique_xmalloc_ptr<char>> debugdir_vec
1414 gdb::unique_xmalloc_ptr<char> canon_sysroot
1432 if (HAS_DRIVE_SPEC (dir_notarget))
1434 drive = dir_notarget[0];
1435 dir_notarget = STRIP_DRIVE_SPEC (dir_notarget);
1438 for (
const gdb::unique_xmalloc_ptr<char> &debugdir : debugdir_vec)
1440 debugfile = target_prefix ?
"target:" :
"";
1441 debugfile += debugdir;
1444 debugfile += dir_notarget;
1445 debugfile += debuglink;
1450 const char *base_path = NULL;
1451 if (canon_dir != NULL)
1453 if (canon_sysroot.get () != NULL)
1454 base_path = child_path (canon_sysroot.get (), canon_dir);
1456 base_path = child_path (
gdb_sysroot.c_str (), canon_dir);
1458 if (base_path != NULL)
1462 debugfile = target_prefix ?
"target:" :
"";
1463 debugfile += debugdir;
1465 debugfile += base_path;
1467 debugfile += debuglink;
1474 debugfile = target_prefix ?
"target:" :
"";
1476 debugfile += debugdir;
1478 debugfile += base_path;
1480 debugfile += debuglink;
1488 return std::string ();
1502 for (i = strlen(path) - 1; i >= 0; i--)
1503 if (IS_DIR_SEPARATOR (path[i]))
1516 unsigned long crc32;
1518 gdb::unique_xmalloc_ptr<char> debuglink
1519 (bfd_get_debug_link_info (
objfile->
obfd.get (), &crc32));
1521 if (debuglink == NULL)
1525 return std::string ();
1530 gdb::unique_xmalloc_ptr<char> canon_dir (lrealpath (dir.c_str ()));
1532 std::string debugfile
1534 debuglink.get (), crc32,
objfile);
1536 if (debugfile.empty ())
1544 && S_ISLNK (st_buf.st_mode))
1546 gdb::unique_xmalloc_ptr<char> symlink_dir
1548 if (symlink_dir != NULL)
1551 if (dir != symlink_dir.get ())
1574 error (_(
"-readnow and -readnever cannot be used simultaneously"));
1603 symfile_add_flags add_flags = 0;
1605 bool stop_processing_options =
false;
1606 CORE_ADDR offset = 0;
1613 gdb_argv built_argv (args);
1614 for (arg = built_argv[0], idx = 0; arg != NULL; arg = built_argv[++idx])
1616 if (stop_processing_options || *arg !=
'-')
1621 error (_(
"Unrecognized argument \"%s\""), arg);
1623 else if (strcmp (arg,
"-readnow") == 0)
1625 else if (strcmp (arg,
"-readnever") == 0)
1627 else if (strcmp (arg,
"-o") == 0)
1629 arg = built_argv[++idx];
1631 error (_(
"Missing argument to -o"));
1635 else if (strcmp (arg,
"--") == 0)
1636 stop_processing_options =
true;
1638 error (_(
"Unrecognized argument \"%s\""), arg);
1642 error (_(
"no symbol file name was specified"));
1689 lang = default_lang;
1706 gdb::unique_xmalloc_ptr<char> absolute_name;
1709 gdb::unique_xmalloc_ptr<char> expanded_name (tilde_expand (
name));
1712 desc =
openp (getenv (
"PATH"),
1714 expanded_name.get (), O_RDONLY |
O_BINARY, &absolute_name);
1715#if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
1718 char *exename = (
char *) alloca (strlen (expanded_name.get ()) + 5);
1720 strcat (strcpy (exename, expanded_name.get ()),
".exe");
1721 desc =
openp (getenv (
"PATH"),
1723 exename, O_RDONLY |
O_BINARY, &absolute_name);
1729 name = absolute_name.get ();
1733 if (sym_bfd == NULL)
1734 error (_(
"`%s': can't open to read symbols: %s."),
name,
1735 bfd_errmsg (bfd_get_error ()));
1738 bfd_set_cacheable (sym_bfd.get (), 1);
1740 if (!bfd_check_format (sym_bfd.get (), bfd_object))
1741 error (_(
"`%s': can't read symbols: %s."),
name,
1742 bfd_errmsg (bfd_get_error ()));
1753 asection *sect = bfd_get_section_by_name (
objfile->
obfd.get (), section_name);
1781 enum bfd_flavour our_flavour = bfd_get_flavour (abfd);
1783 if (our_flavour == bfd_target_srec_flavour
1784 || our_flavour == bfd_target_ihex_flavour
1785 || our_flavour == bfd_target_tekhex_flavour)
1789 if (our_flavour == rsf.sym_flavour)
1792 error (_(
"I'm sorry, Dave, I can't do that. Symbol format `%s' unknown."),
1793 bfd_get_target (abfd));
1812 const char *parg, *prev;
1819 while ((parg = strpbrk (parg,
"\\\"'\t ")))
1821 temp.append (prev, parg - prev);
1823 temp.push_back (
'\\');
1830 arg = temp.c_str ();
1865 const char *section_name_, ULONGEST section_size_,
1866 CORE_ADDR lma_, gdb_byte *buffer_)
1892 xfree (request.data);
1916 totals = args->cumulative;
1918 if (bytes == 0 && args->section_sent == 0)
1922 current_uiout->message (
"Loading section %s, size %s lma %s\n",
1924 hex_string (args->section_size),
1938 gdb::byte_vector
check (bytes);
1941 error (_(
"Download verify read failed at %s"),
1943 if (memcmp (args->buffer,
check.data (), bytes) != 0)
1944 error (_(
"Download verify compare failed at %s"),
1949 args->buffer += bytes;
1951 args->section_sent += bytes;
1955 args->section_sent)))
1956 error (_(
"Canceled the download"));
1972 bfd_size_type
size = bfd_section_size (asec);
1973 const char *sect_name = bfd_section_name (asec);
1975 if ((bfd_section_flags (asec) & SEC_LOAD) == 0)
1981 ULONGEST begin = bfd_section_lma (asec) + args->load_offset;
1982 ULONGEST end = begin +
size;
1984 bfd_get_section_contents (abfd, asec, buffer, 0,
size);
1990 args->requests.emplace_back (begin, end, buffer, section_data);
1996 std::chrono::steady_clock::duration d);
2010 gdb_argv argv (args);
2012 gdb::unique_xmalloc_ptr<char> filename (tilde_expand (argv[0]));
2014 if (argv[1] != NULL)
2018 cbdata.
load_offset = strtoulst (argv[1], &endptr, 0);
2022 if (argv[1] == endptr)
2023 error (_(
"Invalid download offset:%s."), argv[1]);
2025 if (argv[2] != NULL)
2026 error (_(
"Too many parameters."));
2031 if (loadfile_bfd == NULL)
2034 if (!bfd_check_format (loadfile_bfd.get (), bfd_object))
2036 error (_(
"\"%s\" is not an object file: %s"), filename.get (),
2037 bfd_errmsg (bfd_get_error ()));
2041 total_progress.
total_size += bfd_section_size (asec);
2046 using namespace std::chrono;
2048 steady_clock::time_point start_time = steady_clock::now ();
2052 error (_(
"Load failed"));
2054 steady_clock::time_point end_time = steady_clock::now ();
2056 CORE_ADDR entry = bfd_get_start_address (loadfile_bfd.get ());
2058 uiout->
text (
"Start address ");
2060 uiout->
text (
", load size ");
2077 end_time - start_time);
2088 unsigned long data_count,
2089 unsigned long write_count,
2090 std::chrono::steady_clock::duration time)
2092 using namespace std::chrono;
2095 milliseconds ms = duration_cast<milliseconds> (time);
2097 uiout->
text (
"Transfer rate: ");
2098 if (ms.count () > 0)
2100 unsigned long rate = ((ULONGEST) data_count * 1000) / ms.count ();
2105 uiout->
text (
" bits/sec");
2107 else if (
rate < 1024)
2110 uiout->
text (
" bytes/sec");
2115 uiout->
text (
" KB/sec");
2121 uiout->
text (
" bits in <1 sec");
2123 if (write_count > 0)
2127 uiout->
text (
" bytes/write");
2129 uiout->
text (
".\n");
2146 std::vector<const struct other_sections *> addrs_sorted
2151 std::vector<const struct other_sections *> objf_addrs_sorted
2162 std::vector<const struct other_sections *>::iterator addrs_sorted_iter
2163 = addrs_sorted.begin ();
2169 while (cmp < 0 && addrs_sorted_iter != addrs_sorted.end ())
2173 cmp = strcmp (sect_name, objf_name);
2175 ++addrs_sorted_iter;
2179 offsets[objf_sect->sectindex] = 0;
2193 gdb::unique_xmalloc_ptr<char> filename;
2198 symfile_add_flags add_flags = 0;
2209 std::vector<sect_opt> sect_opts = { {
".text", NULL } };
2210 bool stop_processing_options =
false;
2211 CORE_ADDR offset = 0;
2216 error (_(
"add-symbol-file takes a file name and an address"));
2218 bool seen_addr =
false;
2219 bool seen_offset =
false;
2220 gdb_argv argv (args);
2222 for (arg = argv[0], argcnt = 0; arg != NULL; arg = argv[++argcnt])
2224 if (stop_processing_options || *arg !=
'-')
2226 if (filename == NULL)
2229 filename.reset (tilde_expand (arg));
2231 else if (!seen_addr)
2235 sect_opts[0].value = arg;
2239 error (_(
"Unrecognized argument \"%s\""), arg);
2241 else if (strcmp (arg,
"-readnow") == 0)
2243 else if (strcmp (arg,
"-readnever") == 0)
2245 else if (strcmp (arg,
"-s") == 0)
2247 if (argv[argcnt + 1] == NULL)
2248 error (_(
"Missing section name after \"-s\""));
2249 else if (argv[argcnt + 2] == NULL)
2250 error (_(
"Missing section address after \"-s\""));
2252 sect_opt sect = { argv[argcnt + 1], argv[argcnt + 2] };
2254 sect_opts.push_back (sect);
2257 else if (strcmp (arg,
"-o") == 0)
2259 arg = argv[++argcnt];
2261 error (_(
"Missing argument to -o"));
2266 else if (strcmp (arg,
"--") == 0)
2267 stop_processing_options =
true;
2269 error (_(
"Unrecognized argument \"%s\""), arg);
2272 if (filename == NULL)
2273 error (_(
"You must provide a filename to be loaded."));
2283 gdb_printf (_(
"add symbol table from file \"%s\""),
2286 std::vector<sect_opt>::const_iterator it = sect_opts.begin ();
2289 for (; it != sect_opts.end (); ++it)
2292 const char *val = it->value;
2293 const char *sec = it->name;
2295 if (section_addrs.empty ())
2305 section_addrs.emplace_back (addr, sec, section_addrs.size ());
2317 (section_addrs.empty ()
2318 ? _(
" with all sections")
2319 : _(
"with other sections")),
2321 else if (section_addrs.empty ())
2324 if (from_tty && (!
query (
"%s",
"")))
2325 error (_(
"Not confirmed."));
2330 warning (_(
"newly-added symbol file \"%s\" does not provide any symbols"),
2355 error (_(
"remove-symbol-file: no symbol file provided"));
2357 gdb_argv argv (args);
2359 if (strcmp (argv[0],
"-a") == 0)
2364 if (argv[1] == NULL)
2365 error (_(
"Missing address argument"));
2367 if (argv[2] != NULL)
2368 error (_(
"Junk after %s"), argv[1]);
2384 else if (argv[0] != NULL)
2388 if (argv[1] != NULL)
2389 error (_(
"Junk after %s"), argv[0]);
2391 gdb::unique_xmalloc_ptr<char> filename (tilde_expand (argv[0]));
2407 error (_(
"No symbol file found"));
2410 && !
query (_(
"Remove symbol table from file \"%s\"? "),
2412 error (_(
"Not confirmed."));
2424 struct stat new_statbuf;
2426 std::vector<struct objfile *> new_objfiles;
2442 res = stat (bfd_get_filename (
objfile->
obfd->my_archive), &new_statbuf);
2448 gdb_printf (_(
"`%s' has disappeared; keeping its symbols.\n"),
2452 new_modtime = new_statbuf.st_mtime;
2455 gdb_printf (_(
"`%s' has changed; re-reading symbols.\n"),
2474 && filename_cmp (bfd_get_filename (
objfile->
obfd.get ()),
2511 const char *obfd_filename;
2513 obfd_filename = bfd_get_filename (
objfile->
obfd.get ());
2519 error (_(
"Can't open %s to read symbols."), obfd_filename);
2525 if (!bfd_check_format (
objfile->
obfd.get (), bfd_object))
2527 bfd_errmsg (bfd_get_error ()));
2604 gdb_printf (_(
"Expanding full symbols from %ps...\n"),
2614 gdb_printf (_(
"(no debugging symbols found)\n"));
2627 objfile_holder.release ();
2628 defer_clear_users.release ();
2636 new_objfiles.push_back (
objfile);
2640 if (!new_objfiles.empty ())
2647 for (
auto iter : new_objfiles)
2674 gdb_assert (ext !=
nullptr);
2684 _(
"Mapping between filename extension "
2685 "and source language is \"%s\".\n"),
2693 const char *begin =
ext_args.c_str ();
2694 const char *end =
ext_args.c_str ();
2698 error (_(
"'%s': Filename extension must begin with '.'"),
ext_args.c_str ());
2701 while (*end !=
'\0' && !isspace (*end))
2705 error (_(
"'%s': two arguments required -- "
2706 "filename extension and language"),
2710 std::string extension =
ext_args.substr (0, end - begin);
2713 begin = skip_spaces (end);
2716 error (_(
"'%s': two arguments required -- "
2717 "filename extension and language"),
2727 if (it->ext == extension)
2751 gdb_printf (_(
"Filename extensions and the languages they represent:"));
2754 gdb_printf (
"\t%s\t- %s\n", entry.ext.c_str (),
2763 if (filename != NULL)
2764 if ((cp = strrchr (filename,
'.')) != NULL)
2767 if (entry.ext == cp)
2796 static std::string last_objfile_name;
2799 if (last_objfile_name.empty () || last_objfile_name != this_objfile_name)
2801 last_objfile_name = this_objfile_name;
2804 (
"creating one or more symtabs for objfile %s", this_objfile_name);
2829 const char *saved_name;
2836 saved_name = lbasename (
name);
2842 host_address_to_string (cu),
2946 if (bfd_section_lma (bfd_section) != 0
2947 && bfd_section_lma (bfd_section) != bfd_section_vma (bfd_section))
3021 bfd_vma
size = bfd_section_size (bfd_section);
3022 CORE_ADDR offset = section->
offset ();
3024 if (bfd_section_lma (bfd_section) + offset <= pc
3025 && pc < bfd_section_lma (bfd_section) + offset +
size)
3040 if (section->
addr () <= pc
3041 && pc < section->endaddr ())
3054 CORE_ADDR a_start = a->
addr ();
3055 CORE_ADDR a_end = a->
endaddr ();
3056 CORE_ADDR b_start = b->
addr ();
3057 CORE_ADDR b_end = b->
endaddr ();
3059 return (a_start < b_end && b_start < a_end);
3073 return (pc + bfd_section_lma (bfd_section)
3074 - bfd_section_vma (bfd_section));
3091 return (pc + bfd_section_vma (bfd_section)
3092 - bfd_section_lma (bfd_section));
3228 error (_(
"Overlay debugging not enabled. Use "
3229 "either the 'overlay auto' or\n"
3230 "the 'overlay manual' command."));
3232 if (args == 0 || *args == 0)
3233 error (_(
"Argument required: name of an overlay section"));
3255 gdb_printf (_(
"Note: section %s unmapped by overlap\n"),
3261 error (_(
"No overlay section called %s"), args);
3274 error (_(
"Overlay debugging not enabled. "
3275 "Use either the 'overlay auto' or\n"
3276 "the 'overlay manual' command."));
3278 if (args == 0 || *args == 0)
3279 error (_(
"Argument required: name of an overlay section"));
3287 error (_(
"Section %s is not mapped"), args);
3291 error (_(
"No overlay section called %s"), args);
3304 gdb_printf (_(
"Automatic overlay debugging enabled."));
3317 gdb_printf (_(
"Overlay debugging enabled."));
3330 gdb_printf (_(
"Overlay debugging disabled."));
3341 error (_(
"This target does not know how to read its overlay state."));
3405 int len,
int size,
enum bfd_endian byte_order)
3408 gdb_byte *buf = (gdb_byte *) alloca (len *
size);
3412 for (i = 0; i < len; i++)
3426 enum bfd_endian byte_order;
3430 if (! novlys_msym.
minsym)
3432 error (_(
"Error reading inferior's overlay table: "
3433 "couldn't find `_novlys' variable\n"
3434 "in inferior. Use `overlay manual' mode."));
3439 if (! ovly_table_msym.
minsym)
3441 error (_(
"Error reading inferior's overlay table: couldn't find "
3442 "`_ovly_table' array\n"
3443 "in inferior. Use `overlay manual' mode."));
3486 4, word_size, byte_order);
3520 if (
minsym.minsym == NULL)
3521 error (_(
"Error reading inferior's overlay table: couldn't "
3522 "find `_ovly_table' array\n"
3523 "in inferior. Use `overlay manual' mode."));
3566 bfd *abfd = sectp->owner;
3570 if ((sectp->flags & SEC_RELOC) == 0)
3577 sect->output_section = sect;
3578 sect->output_offset = 0;
3581 return bfd_simple_get_relocated_section_contents (abfd, sectp, buf, NULL);
3600 asection *sectp, bfd_byte *buf)
3637 int num_segment_bases,
3638 const CORE_ADDR *segment_bases)
3645 gdb_assert (num_segment_bases > 0);
3649 gdb_assert (data != NULL);
3650 gdb_assert (data->segments.size () > 0);
3652 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
3654 int which = data->segment_info[i];
3656 gdb_assert (0 <= which && which <= data->segments.size ());
3665 if (which > num_segment_bases)
3666 which = num_segment_bases;
3668 offsets[i] = segment_bases[which - 1] - data->segments[which - 1].base;
3685 if (data->segments.size () != 1 && data->segments.size () != 2)
3688 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
3690 int which = data->segment_info[i];
3700 else if (which == 2)
3727 (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
3729 gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
3730 gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
3731 block_search_flags search_flags,
3763static void test_filename_language ()
3783test_set_ext_lang_command ()
3807 SELF_CHECK (size_before == size_after);
3823#define READNOW_READNEVER_HELP \
3824 "The '-readnow' option will cause GDB to read the entire symbol file\n\
3825immediately. This makes the command slower, but may make future operations\n\
3827The '-readnever' option will prevent GDB from reading the symbol file's\n\
3828symbolic debug information."
3831Load symbol table from executable file FILE.\n\
3832Usage: symbol-file [-readnow | -readnever] [-o OFF] FILE\n\
3833OFF is an optional offset which is added to each section address.\n\
3834The `file' command can also load symbol tables, as well as setting the file\n\
3839Load symbols from FILE, assuming FILE has been dynamically loaded.\n\
3840Usage: add-symbol-file FILE [-readnow | -readnever] [-o OFF] [ADDR] \
3841[-s SECT-NAME SECT-ADDR]...\n\
3842ADDR is the starting address of the file's text.\n\
3843Each '-s' argument provides a section name and address, and\n\
3844should be specified if the data and bss segments are not contiguous\n\
3845with the text. SECT-NAME is a section name to be loaded at SECT-ADDR.\n\
3846OFF is an optional offset which is added to the default load addresses\n\
3847of all sections for which no other address was specified.\n"
3854Remove a symbol file added via the add-symbol-file command.\n\
3855Usage: remove-symbol-file FILENAME\n\
3856 remove-symbol-file -a ADDRESS\n\
3857The file to remove can be identified by its filename or by an address\n\
3858that lies within the boundaries of this symbol file in memory."),
3862Dynamically load FILE into the running program.\n\
3863FILE symbols are recorded for access from GDB.\n\
3864Usage: load [FILE] [OFFSET]\n\
3865An optional load OFFSET may also be given as a literal address.\n\
3866When OFFSET is provided, FILE must also be provided. FILE can be provided\n\
3872 _(
"Commands for debugging overlays."), &
overlaylist,
3879 _(
"Assert that an overlay section is mapped."), &
overlaylist);
3882 _(
"Assert that an overlay section is unmapped."), &
overlaylist);
3885 _(
"List mappings of overlay sections."), &
overlaylist);
3892 _(
"Enable automatic overlay debugging."), &
overlaylist);
3894 _(
"Read the overlay mapping state from the target."), &
overlaylist);
3899Set mapping between filename extension and source language."), _(
"\
3900Show mapping between filename extension and source language."), _(
"\
3901Usage: set extension-language .foo bar"),
3907 _(
"All filename extensions associated with a source language."));
3911Set the directories where separate debug symbols are searched for."), _(
"\
3912Show the directories where separate debug symbols are searched for."), _(
"\
3913Separate debug symbols are first searched for in the same\n\
3915and lastly at the path of the directory of the binary with\n\
3916each global debug-file-directory component prepended."),
3924Set printing of symbol loading messages."), _(
"\
3925Show printing of symbol loading messages."), _(
"\
3926off == turn all messages off\n\
3927brief == print messages for the executable,\n\
3928 and brief messages for shared libraries\n\
3929full == print messages for the executable,\n\
3930 and messages for each shared library."),
3937Set printing of separate debug info file search debug."), _(
"\
3938Show printing of separate debug info file search debug."), _(
"\
3939When on, GDB prints the searched locations while looking for separate debug \
3943 selftests::register_test
3944 (
"filename_language", selftests::filename_language::test_filename_language);
3945 selftests::register_test
3946 (
"set_ext_lang_command",
3947 selftests::filename_language::test_set_ext_lang_command);
struct gdbarch * get_current_arch(void)
struct gdbarch * target_gdbarch(void)
void clear_pc_function_cache(void)
void breakpoint_re_set(void)
void disable_overlay_breakpoints(void)
void enable_overlay_breakpoints(void)
void clear_displays(void)
ui_file_style style() const
symfile_add_flags symfile_flags
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
void text(const char *string)
bool is_mi_like_p() const
void field_unsigned(const char *fldname, ULONGEST value)
struct cmd_list_element * showlist
struct cmd_list_element * showprintlist
void error_no_arg(const char *why)
struct cmd_list_element * cmdlist
struct cmd_list_element * setprintlist
struct cmd_list_element * setlist
struct cmd_list_element * showdebuglist
struct cmd_list_element * setdebuglist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
cmd_list_element * add_com_alias(const char *name, cmd_list_element *target, command_class theclass, int abbrev_flag)
set_show_commands add_setshow_optional_filename_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
set_show_commands add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_string_noescape_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_basic_prefix_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
cli_style_option file_name_style
void filename_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
void reopen_exec_file(void)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
const char * get_exec_file(int err)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
int check_quit_flag(void)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
CORE_ADDR parse_and_eval_address(const char *exp)
void exec_set_section_address(const char *filename, int index, CORE_ADDR address)
void exec_file_attach(const char *filename, int from_tty)
void reinit_frame_cache(void)
int gdb_bfd_crc(struct bfd *abfd, unsigned long *crc_out)
int gdb_bfd_section_index(bfd *abfd, asection *section)
int gdb_bfd_has_target_filename(struct bfd *abfd)
int gdb_bfd_count_sections(bfd *abfd)
int is_target_filename(const char *name)
gdb_bfd_ref_ptr gdb_bfd_open(const char *name, const char *target, int fd, bool warn_if_slow)
gdb::ref_ptr< struct bfd, gdb_bfd_ref_policy > gdb_bfd_ref_ptr
static gdb_bfd_section_range gdb_bfd_sections(bfd *abfd)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
bool gdbarch_overlay_update_p(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
int gdbarch_long_bit(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
void gdbarch_overlay_update(struct gdbarch *gdbarch, struct obj_section *osect)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
struct inferior * current_inferior(void)
enum language language_enum(const char *str)
const char * language_str(enum language lang)
const struct language_defn * current_language
enum language set_language(enum language lang)
const struct language_defn * expected_language
static void validate_readnow_readnever()
gdb_bfd_ref_ptr find_separate_debug_file_in_section(struct objfile *objfile)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
observable< struct objfile * > free_objfile
observable executable_changed
observable< struct objfile * > new_objfile
void objfiles_changed(void)
int objfile_has_symbols(struct objfile *objfile)
void objfile_relocate(struct objfile *objfile, const section_offsets &new_offsets)
bool is_addr_in_objfile(CORE_ADDR addr, const struct objfile *objfile)
void objfile_rebase(struct objfile *objfile, CORE_ADDR slide)
int have_partial_symbols(void)
void free_objfile_separate_debug(struct objfile *objfile)
const char * objfile_name(const struct objfile *objfile)
int have_full_symbols(void)
void build_objfile_section_table(struct objfile *objfile)
void set_objfile_per_bfd(struct objfile *objfile)
void objfile_set_sym_fns(struct objfile *objfile, const struct sym_fns *sf)
#define SECT_OFF_TEXT(objfile)
std::unique_ptr< objfile, objfile_deleter > objfile_up
#define ALL_OBJFILE_OSECTIONS(objfile, osect)
struct program_space * current_program_space
void regcache_write_pc(struct regcache *regcache, CORE_ADDR pc)
struct regcache * get_current_regcache(void)
void solib_create_inferior_hook(int from_tty)
void no_shared_libraries(const char *ignored, int from_tty)
int openp(const char *path, openp_flags opts, const char *string, int mode, gdb::unique_xmalloc_ptr< char > *filename_opened)
void clear_current_source_symtab_and_line(void)
void forget_cached_source_info(void)
void clear_last_displayed_sal(void)
CORE_ADDR value_address() const
struct minimal_symbol * minsym
struct compunit_symtab * next
void add_filetab(symtab *filetab)
void set_objfile(struct objfile *objfile)
void set_debugformat(const char *debugformat)
struct objfile * objfile() const
int the_bfd_section_index
filename_language(const std::string &ext_, enum language lang_)
enum language language() const
unsigned long write_count
load_progress_section_data(load_progress_data *cumulative_, const char *section_name_, ULONGEST section_size_, CORE_ADDR lma_, gdb_byte *buffer_)
struct load_progress_data * cumulative
const char * section_name
load_section_data(load_progress_data *progress_data_)
struct load_progress_data * progress_data
std::vector< struct memory_write_request > requests
CORE_ADDR value_address(objfile *objfile) const
CORE_ADDR endaddr() const
struct bfd_section * the_bfd_section
const char * original_name
const struct sym_fns * sf
struct compunit_symtab * compunit_symtabs
struct objfile * separate_debug_objfile_backlink
struct program_space * pspace
struct objfile * separate_debug_objfile
registry< objfile > registry_fields
struct gdbarch * arch() const
struct objfile_per_bfd_storage * per_bfd
bool expand_symtabs_matching(gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info *lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, block_search_flags search_flags, domain_enum domain, enum search_domain kind)
static objfile * make(gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_, objfile *parent=nullptr)
struct obj_section * sections
void expand_all_symtabs()
void require_partial_symbols(bool verbose)
const char * intern(const char *str)
auto_obstack objfile_obstack
std::forward_list< quick_symbol_functions_up > qf
struct symbol * template_symbols
::section_offsets section_offsets
void map_symbol_filenames(gdb::function_view< symbol_filename_ftype > fun, bool need_fullname)
bool has_partial_symbols()
void remove_target_sections(void *owner)
void add_target_sections(void *owner, const target_section_table §ions)
objfiles_range objfiles()
struct objfile * symfile_object_file
registered_sym_fns(bfd_flavour sym_flavour_, const struct sym_fns *sym_fns_)
const struct sym_fns * sym_fns
enum bfd_flavour sym_flavour
bfd_byte *(* sym_relocate)(struct objfile *, asection *sectp, bfd_byte *buf)
void(* sym_read)(struct objfile *, symfile_add_flags)
void(* sym_new_init)(struct objfile *)
void(* sym_init)(struct objfile *)
symfile_segment_data_up(* sym_segments)(bfd *abfd)
void(* sym_offsets)(struct objfile *, const section_addr_info &)
void(* sym_finish)(struct objfile *)
const char * filename_for_id
void set_language(enum language language)
void set_compunit(struct compunit_symtab *compunit)
static void add_symbol_file_command(const char *args, int from_tty)
gdb_bfd_ref_ptr symfile_bfd_open(const char *name)
static std::vector< registered_sym_fns > symtab_fns
bool separate_debug_file_debug
void add_filename_language(const char *ext, enum language lang)
struct obj_section * find_pc_overlay(CORE_ADDR pc)
enum language deduce_language_from_filename(const char *filename)
static void map_overlay_command(const char *args, int from_tty)
static CORE_ADDR cache_ovly_table_base
void(* deprecated_post_add_symbol_hook)(void)
static void overlay_manual_command(const char *args, int from_tty)
static void find_lowest_section(asection *sect, asection **lowest)
static void remove_symbol_file_command(const char *args, int from_tty)
static const struct sym_fns * find_sym_fns(bfd *)
bfd_byte * symfile_relocate_debug_section(struct objfile *objfile, asection *sectp, bfd_byte *buf)
static void place_section(bfd *abfd, asection *sect, section_offsets &offsets, CORE_ADDR &lowest)
static void list_overlays_command(const char *args, int from_tty)
void add_symtab_fns(enum bfd_flavour flavour, const struct sym_fns *sf)
int get_section_index(struct objfile *objfile, const char *section_name)
CORE_ADDR overlay_unmapped_address(CORE_ADDR pc, struct obj_section *section)
section_addr_info build_section_addr_info_from_objfile(const struct objfile *objfile)
std::string debug_file_directory
int section_is_mapped(struct obj_section *osect)
static const char * print_symbol_loading_enums[]
static void finish_new_objfile(struct objfile *objfile, symfile_add_flags add_flags)
void symbol_file_clear(int from_tty)
void add_compunit_symtab_to_objfile(struct compunit_symtab *cu)
void _initialize_symfile()
static std::vector< const struct other_sections * > addrs_section_sort(const section_addr_info &addrs)
static section_addr_info build_section_addr_info_from_bfd(bfd *abfd)
void symbol_file_command(const char *args, int from_tty)
static void symfile_free_objfile(struct objfile *objfile)
const char print_symbol_loading_brief[]
static void load_one_section(bfd *abfd, asection *asec, struct load_section_data *args)
static void overlay_load_command(const char *args, int from_tty)
CORE_ADDR pc_in_mapped_range(CORE_ADDR pc, struct obj_section *section)
static int simple_read_overlay_table(void)
static void terminate_after_last_dir_separator(char *path)
static std::string find_separate_debug_file(const char *dir, const char *canon_dir, const char *debuglink, unsigned long crc32, struct objfile *objfile)
static const char * addr_section_name(const char *s)
static void overlay_off_command(const char *args, int from_tty)
void reread_symbols(int from_tty)
#define DEBUG_SUBDIRECTORY
void symbol_file_add_main(const char *args, symfile_add_flags add_flags)
void set_initial_language(void)
section_addr_info build_section_addr_info_from_section_table(const target_section_table &table)
static void symbol_file_add_main_1(const char *args, symfile_add_flags add_flags, objfile_flags flags, CORE_ADDR reloff)
CORE_ADDR overlay_mapped_address(CORE_ADDR pc, struct obj_section *section)
static void show_debug_file_directory(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void default_symfile_offsets(struct objfile *objfile, const section_addr_info &addrs)
static struct objfile * symbol_file_add_with_addrs(const gdb_bfd_ref_ptr &abfd, const char *name, symfile_add_flags add_flags, section_addr_info *addrs, objfile_flags flags, struct objfile *parent)
static void print_transfer_performance(struct ui_file *stream, unsigned long data_count, unsigned long write_count, std::chrono::steady_clock::duration d)
struct obj_section * find_pc_mapped_section(CORE_ADDR pc)
int print_symbol_loading_p(int from_tty, int exec, int full)
bool expand_symtabs_matching(gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info &lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, block_search_flags search_flags, enum search_domain kind)
void(* deprecated_show_load_progress)(const char *section, unsigned long section_sent, unsigned long section_size, unsigned long total_sent, unsigned long total_size)
struct symtab * allocate_symtab(struct compunit_symtab *cust, const char *filename, const char *filename_for_id)
static void simple_free_overlay_table(void)
const char print_symbol_loading_off[]
int readnever_symbol_files
void generic_load(const char *args, int from_tty)
static unsigned(* cache_ovly_table)[4]
void addr_info_make_relative(section_addr_info *addrs, bfd *abfd)
CORE_ADDR pc_in_unmapped_range(CORE_ADDR pc, struct obj_section *section)
struct compunit_symtab * allocate_compunit_symtab(struct objfile *objfile, const char *name)
int(* deprecated_ui_load_progress_hook)(const char *section, unsigned long num)
int overlay_cache_invalid
static void init_entry_point_info(struct objfile *objfile)
static const char * print_symbol_loading
static void overlay_auto_command(const char *args, int from_tty)
FORWARD_SCOPE_EXIT(clear_symtab_users) clear_symtab_users_cleanup
symfile_segment_data_up get_symfile_segment_data(bfd *abfd)
void relative_addr_info_to_section_offsets(section_offsets §ion_offsets, const section_addr_info &addrs)
int symfile_map_offsets_to_segments(bfd *abfd, const struct symfile_segment_data *data, section_offsets &offsets, int num_segment_bases, const CORE_ADDR *segment_bases)
symfile_segment_data_up default_symfile_segments(bfd *abfd)
static void load_progress(ULONGEST bytes, void *untyped_arg)
static int simple_overlay_update_1(struct obj_section *)
void simple_overlay_update(struct obj_section *osect)
static bool addrs_section_compar(const struct other_sections *a, const struct other_sections *b)
static std::vector< filename_language > filename_language_table
void(* deprecated_pre_add_symbol_hook)(const char *)
static std::string ext_args
static void show_ext_args(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void set_ext_lang_command(const char *args, int from_tty, struct cmd_list_element *e)
void map_symbol_filenames(gdb::function_view< symbol_filename_ftype > fun, bool need_fullname)
void symbol_file_add_separate(const gdb_bfd_ref_ptr &bfd, const char *name, symfile_add_flags symfile_flags, struct objfile *objfile)
struct objfile * symbol_file_add_from_bfd(const gdb_bfd_ref_ptr &abfd, const char *name, symfile_add_flags add_flags, section_addr_info *addrs, objfile_flags flags, struct objfile *parent)
static void set_objfile_default_section_offset(struct objfile *objf, const section_addr_info &addrs, CORE_ADDR offset)
static int separate_debug_file_exists(const std::string &name, unsigned long crc, struct objfile *parent_objfile)
int section_is_overlay(struct obj_section *section)
struct objfile * symbol_file_add(const char *name, symfile_add_flags add_flags, section_addr_info *addrs, objfile_flags flags)
static unsigned cache_novlys
static void read_symbols(struct objfile *objfile, symfile_add_flags add_flags)
enum overlay_debugging_state overlay_debugging
std::string find_separate_debug_file_by_debuglink(struct objfile *objfile)
static void info_ext_lang_command(const char *args, int from_tty)
static void init_objfile_sect_indices(struct objfile *objfile)
#define READNOW_READNEVER_HELP
static int validate_download
static struct cmd_list_element * overlaylist
static void symfile_find_segment_sections(struct objfile *objfile)
static void read_target_long_array(CORE_ADDR, unsigned int *, int, int, enum bfd_endian)
int currently_reading_symtab
static void syms_from_objfile_1(struct objfile *objfile, section_addr_info *addrs, symfile_add_flags add_flags)
const char print_symbol_loading_full[]
CORE_ADDR symbol_overlayed_address(CORE_ADDR address, struct obj_section *section)
static int sections_overlap(struct obj_section *a, struct obj_section *b)
static void load_command(const char *arg, int from_tty)
void clear_symtab_users(symfile_add_flags add_flags)
scoped_restore_tmpl< int > increment_reading_symtab(void)
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
static void unmap_overlay_command(const char *args, int from_tty)
static void overlay_invalidate_all(void)
static void syms_from_objfile(struct objfile *objfile, section_addr_info *addrs, symfile_add_flags add_flags)
std::unique_ptr< symfile_segment_data > symfile_segment_data_up
std::vector< other_sections > section_addr_info
struct block_symbol lookup_symbol_in_language(const char *name, const struct block *block, const domain_enum domain, enum language lang, struct field_of_this_result *is_a_field_of_this)
enum language main_language(void)
unsigned int symtab_create_debug
#define symtab_create_debug_printf_v(fmt,...)
std::vector< CORE_ADDR > section_offsets
int target_write_memory_blocks(const std::vector< memory_write_request > &requests, enum flash_preserve_mode preserve_flash_p, void(*progress_cb)(ULONGEST, void *))
std::vector< target_section > target_section_table
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void target_load(const char *arg, int from_tty)
static styled_string_s * styled_string(const ui_file_style &style, const char *str, styled_string_s &&tmp={})
void perror_with_name(const char *string)
int query(const char *ctlstr,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_flush(struct ui_file *stream)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
void preserve_values(struct objfile *objfile)
static void check(BOOL ok, const char *file, int line)