42#include "gdbsupport/gdb_obstack.h"
46#include "readline/tilde.h"
58#include "gdbsupport/byte-vector.h"
59#include "gdbsupport/pathstuff.h"
60#include "gdbsupport/selftest.h"
62#include "gdbsupport/forward-scope-exit.h"
63#include "gdbsupport/buildargv.h"
75 unsigned long section_sent,
76 unsigned long section_size,
77 unsigned long total_sent,
78 unsigned long total_size);
98 objfile_flags
flags, CORE_ADDR reloff);
132static std::vector<registered_sym_fns>
symtab_fns;
185scoped_restore_tmpl<int>
204 if (0 == (bfd_section_flags (sect) & (SEC_ALLOC | SEC_LOAD)))
208 else if (bfd_section_vma (*lowest) > bfd_section_vma (sect))
210 else if (bfd_section_vma (*lowest) == bfd_section_vma (sect)
211 && (bfd_section_size (*lowest) <= bfd_section_size (sect)))
225 struct bfd_section *asect = stp.the_bfd_section;
226 bfd *abfd = asect->owner;
228 if (bfd_section_flags (asect) & (SEC_ALLOC | SEC_LOAD)
229 && sap.size () < table.size ())
230 sap.emplace_back (stp.addr,
231 bfd_section_name (asect),
243 struct bfd_section *sec;
246 for (sec = abfd->sections; sec != NULL; sec = sec->next)
247 if (bfd_section_flags (sec) & (SEC_ALLOC | SEC_LOAD))
248 sap.emplace_back (bfd_section_vma (sec),
249 bfd_section_name (sec),
267 for (i = 0; i < sap.size (); i++)
269 int sectindex = sap[i].sectindex;
284 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".text");
288 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".data");
292 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".bss");
296 sect = bfd_get_section_by_name (
objfile->
obfd.get (),
".rodata");
344 CORE_ADDR start_addr;
346 ULONGEST align = ((ULONGEST) 1) << bfd_section_alignment (sect);
349 if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
357 start_addr = (lowest + align - 1) & -align;
364 for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
366 int indx = cur_sec->index;
373 if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
379 if (offsets[indx] == 0)
383 if (start_addr + bfd_section_size (sect) > offsets[indx]
384 && start_addr < offsets[indx] + bfd_section_size (cur_sec))
386 start_addr = offsets[indx] + bfd_section_size (cur_sec);
387 start_addr = (start_addr + align - 1) & -align;
398 lowest = start_addr + bfd_section_size (sect);
413 for (i = 0; i < addrs.size (); i++)
437 if (strcmp (s,
".dynbss") == 0)
439 if (strcmp (s,
".sdynbss") == 0)
465static std::vector<const struct other_sections *>
470 std::vector<const struct other_sections *> array (addrs.size ());
471 for (i = 0; i < addrs.size (); i++)
472 array[i] = &addrs[i];
486 asection *lower_sect;
487 CORE_ADDR lower_offset;
495 if (lower_sect == NULL)
497 warning (_(
"no loadable sections found in added symbol-file %s"),
498 bfd_get_filename (abfd));
502 lower_offset = bfd_section_vma (lower_sect);
514 std::vector<const struct other_sections *> addrs_sorted
518 std::vector<const struct other_sections *> abfd_addrs_sorted
524 std::vector<const struct other_sections *>
525 addrs_to_abfd_addrs (addrs->size (),
nullptr);
527 std::vector<const struct other_sections *>::iterator abfd_sorted_iter
528 = abfd_addrs_sorted.begin ();
533 while (abfd_sorted_iter != abfd_addrs_sorted.end ()
538 if (abfd_sorted_iter != abfd_addrs_sorted.end ()
545 index_in_addrs = sect - addrs->data ();
546 gdb_assert (addrs_to_abfd_addrs[index_in_addrs] == NULL);
547 addrs_to_abfd_addrs[index_in_addrs] = *abfd_sorted_iter;
564 for (i = 0; i < addrs->size (); i++)
573 if ((*addrs)[i].
addr != 0)
575 (*addrs)[i].addr -= sect->
addr;
576 lower_offset = (*addrs)[i].addr;
579 (*addrs)[i].addr = lower_offset;
584 const std::string §_name = (*addrs)[i].name;
600 if (!(sect_name ==
".gnu.liblist"
601 || sect_name ==
".gnu.conflict"
602 || (sect_name ==
".bss"
604 && (*addrs)[i - 1].
name ==
".dynbss"
605 && addrs_to_abfd_addrs[i - 1] != NULL)
606 || (sect_name ==
".sbss"
608 && (*addrs)[i - 1].
name ==
".sdynbss"
609 && addrs_to_abfd_addrs[i - 1] != NULL)))
610 warning (_(
"section %s not found in %s"), sect_name.c_str (),
611 bfd_get_filename (abfd));
613 (*addrs)[i].addr = 0;
614 (*addrs)[i].sectindex = -1;
637 if ((bfd_get_file_flags (
objfile->
obfd.get ()) & (EXEC_P | DYNAMIC)) == 0)
642 for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
645 if (bfd_section_vma (cur_sec) != 0)
654 CORE_ADDR lowest = 0;
685 for (cur_sec = abfd->sections; cur_sec != NULL;
686 cur_sec = cur_sec->next)
688 if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
691 bfd_set_section_vma (cur_sec, offsets[cur_sec->index]);
694 offsets[cur_sec->index]);
695 offsets[cur_sec->index] = 0;
721 if ((bfd_get_file_flags (abfd) & (EXEC_P | DYNAMIC)) == 0)
725 for (sect = abfd->sections; sect != NULL; sect = sect->next)
727 if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
735 low = bfd_section_vma (sect);
736 high = low + bfd_section_size (sect);
740 num_sections = bfd_count_sections (abfd);
743 data->segment_info.resize (num_sections);
745 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
749 if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
752 vma = bfd_section_vma (sect);
755 if (vma + bfd_section_size (sect) > high)
756 high = vma + bfd_section_size (sect);
758 data->segment_info[i] = 1;
761 data->segments.emplace_back (low, high - low);
811 if (bfd_get_file_flags (
objfile->
obfd.get ()) & EXEC_P)
818 else if (bfd_get_file_flags (
objfile->
obfd.get ()) & DYNAMIC
819 && bfd_get_start_address (
objfile->
obfd.get ()) != 0)
851 struct bfd_section *sect = osect->the_bfd_section;
853 if (entry_point >= bfd_section_vma (sect)
854 && entry_point < (bfd_section_vma (sect)
855 + bfd_section_size (sect)))
896 symfile_add_flags add_flags)
916 gdb::optional<clear_symtab_users_cleanup> defer_clear_users;
954 if (addrs->size () > 0)
970 objfile_holder.release ();
971 if (defer_clear_users)
972 defer_clear_users->release ();
981 symfile_add_flags add_flags)
1035 symfile_add_flags add_flags,
1050 add_flags &= ~SYMFILE_NO_READ;
1068 && !
query (_(
"Load new symbol table from \"%s\"? "),
name))
1069 error (_(
"Not confirmed."));
1083 gdb_printf (_(
"Reading symbols from %ps...\n"),
1096 gdb_printf (_(
"Expanding full symbols from %ps...\n"),
1108 gdb_printf (_(
"(No debugging symbols found in %ps)\n"),
1127 bfd_cache_close_all ();
1136 symfile_add_flags symfile_flags,
1145 (bfd,
name, symfile_flags, &sap,
1157 symfile_add_flags add_flags,
1194 objfile_flags
flags, CORE_ADDR reloff)
1216 ? !
query (_(
"Discard symbol table from `%s'? "),
1218 : !
query (_(
"Discard symbol table? "))))
1219 error (_(
"Not confirmed."));
1240 struct objfile *parent_objfile,
1243 unsigned long file_crc;
1245 struct stat parent_stat, abfd_stat;
1246 int verified_as_different;
1284 if (bfd_stat (abfd.get (), &abfd_stat) == 0
1285 && abfd_stat.st_ino != 0
1286 && bfd_stat (parent_objfile->
obfd.get (), &parent_stat) == 0)
1288 if (abfd_stat.st_dev == parent_stat.st_dev
1289 && abfd_stat.st_ino == parent_stat.st_ino)
1293 _(
" no, same file as the objfile.\n"));
1297 verified_as_different = 1;
1300 verified_as_different = 0;
1302 file_crc_p =
gdb_bfd_crc (abfd.get (), &file_crc);
1312 if (crc != file_crc)
1314 unsigned long parent_crc;
1320 if (!verified_as_different)
1326 _(
" no, error computing CRC.\n"));
1332 if (verified_as_different || parent_crc != file_crc)
1336 " does not match \"%s\" (CRC mismatch).\n",
1338 warnings->
warn (_(
"the debug information found in \"%ps\""
1339 " does not match \"%ps\" (CRC mismatch)."),
1361 _(
"The directory where separate debug "
1362 "symbols are searched for is \"%s\".\n"),
1366#if ! defined (DEBUG_SUBDIRECTORY)
1367#define DEBUG_SUBDIRECTORY ".debug"
1386 const char *canon_dir,
1387 const char *debuglink,
1393 _(
"\nLooking for separate debug info (debug link) for "
1397 std::string debugfile = dir;
1398 debugfile += debuglink;
1407 debugfile += debuglink;
1417 bool target_prefix = startswith (dir,
"target:");
1418 const char *dir_notarget = target_prefix ? dir + strlen (
"target:") : dir;
1419 std::vector<gdb::unique_xmalloc_ptr<char>> debugdir_vec
1421 gdb::unique_xmalloc_ptr<char> canon_sysroot
1439 if (HAS_DRIVE_SPEC (dir_notarget))
1441 drive = dir_notarget[0];
1442 dir_notarget = STRIP_DRIVE_SPEC (dir_notarget);
1445 for (
const gdb::unique_xmalloc_ptr<char> &debugdir : debugdir_vec)
1447 debugfile = target_prefix ?
"target:" :
"";
1448 debugfile += debugdir;
1451 debugfile += dir_notarget;
1452 debugfile += debuglink;
1457 const char *base_path = NULL;
1458 if (canon_dir != NULL)
1460 if (canon_sysroot.get () != NULL)
1461 base_path = child_path (canon_sysroot.get (), canon_dir);
1463 base_path = child_path (
gdb_sysroot.c_str (), canon_dir);
1465 if (base_path != NULL)
1469 debugfile = target_prefix ?
"target:" :
"";
1470 debugfile += debugdir;
1472 debugfile += base_path;
1474 debugfile += debuglink;
1487 debugfile = target_prefix ?
"target:" :
"";
1490 std::string root =
gdb_sysroot.substr (strlen (
"target:"));
1491 gdb_assert (!root.empty ());
1496 debugfile += debugdir;
1498 debugfile += base_path;
1500 debugfile += debuglink;
1509 return std::string ();
1523 for (i = strlen(path) - 1; i >= 0; i--)
1524 if (IS_DIR_SEPARATOR (path[i]))
1539 gdb::unique_xmalloc_ptr<char> debuglink
1540 (bfd_get_debug_link_info (
objfile->
obfd.get (), &crc32));
1542 if (debuglink == NULL)
1546 return std::string ();
1551 gdb::unique_xmalloc_ptr<char> canon_dir (lrealpath (dir.c_str ()));
1553 std::string debugfile
1555 debuglink.get (), crc32,
objfile,
1558 if (debugfile.empty ())
1566 && S_ISLNK (st_buf.st_mode))
1568 gdb::unique_xmalloc_ptr<char> symlink_dir
1570 if (symlink_dir != NULL)
1573 if (dir != symlink_dir.get ())
1597 error (_(
"-readnow and -readnever cannot be used simultaneously"));
1626 symfile_add_flags add_flags = 0;
1628 bool stop_processing_options =
false;
1629 CORE_ADDR offset = 0;
1636 gdb_argv built_argv (args);
1637 for (arg = built_argv[0], idx = 0; arg != NULL; arg = built_argv[++idx])
1639 if (stop_processing_options || *arg !=
'-')
1644 error (_(
"Unrecognized argument \"%s\""), arg);
1646 else if (strcmp (arg,
"-readnow") == 0)
1648 else if (strcmp (arg,
"-readnever") == 0)
1650 else if (strcmp (arg,
"-o") == 0)
1652 arg = built_argv[++idx];
1654 error (_(
"Missing argument to -o"));
1658 else if (strcmp (arg,
"--") == 0)
1659 stop_processing_options =
true;
1661 error (_(
"Unrecognized argument \"%s\""), arg);
1665 error (_(
"no symbol file name was specified"));
1712 lang = default_lang;
1729 gdb::unique_xmalloc_ptr<char> absolute_name;
1732 gdb::unique_xmalloc_ptr<char> expanded_name (tilde_expand (
name));
1735 desc =
openp (getenv (
"PATH"),
1737 expanded_name.get (), O_RDONLY |
O_BINARY, &absolute_name);
1738#if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
1741 char *exename = (
char *) alloca (strlen (expanded_name.get ()) + 5);
1743 strcat (strcpy (exename, expanded_name.get ()),
".exe");
1744 desc =
openp (getenv (
"PATH"),
1746 exename, O_RDONLY |
O_BINARY, &absolute_name);
1750 perror_with_name (expanded_name.get ());
1752 name = absolute_name.get ();
1756 if (sym_bfd == NULL)
1757 error (_(
"`%s': can't open to read symbols: %s."),
name,
1758 bfd_errmsg (bfd_get_error ()));
1760 if (!bfd_check_format (sym_bfd.get (), bfd_object))
1761 error (_(
"`%s': can't read symbols: %s."),
name,
1762 bfd_errmsg (bfd_get_error ()));
1776 catch (
const gdb_exception_error &
err)
1778 warning (
"%s",
err.what ());
1790 asection *sect = bfd_get_section_by_name (
objfile->
obfd.get (), section_name);
1818 enum bfd_flavour our_flavour = bfd_get_flavour (abfd);
1820 if (our_flavour == bfd_target_srec_flavour
1821 || our_flavour == bfd_target_ihex_flavour
1822 || our_flavour == bfd_target_tekhex_flavour)
1826 if (our_flavour == rsf.sym_flavour)
1829 error (_(
"I'm sorry, Dave, I can't do that. Symbol format `%s' unknown."),
1830 bfd_get_target (abfd));
1849 const char *parg, *prev;
1856 while ((parg = strpbrk (parg,
"\\\"'\t ")))
1858 temp.append (prev, parg - prev);
1860 temp.push_back (
'\\');
1867 arg = temp.c_str ();
1902 const char *section_name_, ULONGEST section_size_,
1903 CORE_ADDR lma_, gdb_byte *buffer_)
1929 xfree (request.data);
1936 std::vector<struct memory_write_request>
requests;
1953 totals = args->cumulative;
1955 if (bytes == 0 && args->section_sent == 0)
1959 current_uiout->message (
"Loading section %s, size %s lma %s\n",
1961 hex_string (args->section_size),
1975 gdb::byte_vector
check (bytes);
1978 error (_(
"Download verify read failed at %s"),
1980 if (memcmp (args->buffer,
check.data (), bytes) != 0)
1981 error (_(
"Download verify compare failed at %s"),
1986 args->buffer += bytes;
1988 args->section_sent += bytes;
1992 args->section_sent)))
1993 error (_(
"Canceled the download"));
2009 bfd_size_type
size = bfd_section_size (asec);
2010 const char *sect_name = bfd_section_name (asec);
2012 if ((bfd_section_flags (asec) & SEC_LOAD) == 0)
2018 ULONGEST begin = bfd_section_lma (asec) + args->load_offset;
2019 ULONGEST end = begin +
size;
2021 bfd_get_section_contents (abfd, asec, buffer, 0,
size);
2027 args->requests.emplace_back (begin, end, buffer, section_data);
2033 std::chrono::steady_clock::duration d);
2047 gdb_argv argv (args);
2049 gdb::unique_xmalloc_ptr<char> filename (tilde_expand (argv[0]));
2051 if (argv[1] != NULL)
2055 cbdata.
load_offset = strtoulst (argv[1], &endptr, 0);
2059 if (argv[1] == endptr)
2060 error (_(
"Invalid download offset:%s."), argv[1]);
2062 if (argv[2] != NULL)
2063 error (_(
"Too many parameters."));
2068 if (loadfile_bfd == NULL)
2069 perror_with_name (filename.get ());
2071 if (!bfd_check_format (loadfile_bfd.get (), bfd_object))
2073 error (_(
"\"%s\" is not an object file: %s"), filename.get (),
2074 bfd_errmsg (bfd_get_error ()));
2078 total_progress.
total_size += bfd_section_size (asec);
2083 using namespace std::chrono;
2085 steady_clock::time_point start_time = steady_clock::now ();
2089 error (_(
"Load failed"));
2091 steady_clock::time_point end_time = steady_clock::now ();
2093 CORE_ADDR entry = bfd_get_start_address (loadfile_bfd.get ());
2095 uiout->
text (
"Start address ");
2097 uiout->
text (
", load size ");
2114 end_time - start_time);
2125 unsigned long data_count,
2126 unsigned long write_count,
2127 std::chrono::steady_clock::duration time)
2129 using namespace std::chrono;
2132 milliseconds ms = duration_cast<milliseconds> (time);
2134 uiout->
text (
"Transfer rate: ");
2135 if (ms.count () > 0)
2137 unsigned long rate = ((ULONGEST) data_count * 1000) / ms.count ();
2142 uiout->
text (
" bits/sec");
2144 else if (
rate < 1024)
2147 uiout->
text (
" bytes/sec");
2152 uiout->
text (
" KB/sec");
2158 uiout->
text (
" bits in <1 sec");
2160 if (write_count > 0)
2164 uiout->
text (
" bytes/write");
2166 uiout->
text (
".\n");
2183 std::vector<const struct other_sections *> addrs_sorted
2188 std::vector<const struct other_sections *> objf_addrs_sorted
2199 std::vector<const struct other_sections *>::iterator addrs_sorted_iter
2200 = addrs_sorted.begin ();
2206 while (cmp < 0 && addrs_sorted_iter != addrs_sorted.end ())
2210 cmp = strcmp (sect_name, objf_name);
2212 ++addrs_sorted_iter;
2216 offsets[objf_sect->sectindex] = 0;
2230 gdb::unique_xmalloc_ptr<char> filename;
2235 symfile_add_flags add_flags = 0;
2246 std::vector<sect_opt> sect_opts = { {
".text", NULL } };
2247 bool stop_processing_options =
false;
2248 CORE_ADDR offset = 0;
2253 error (_(
"add-symbol-file takes a file name and an address"));
2255 bool seen_addr =
false;
2256 bool seen_offset =
false;
2257 gdb_argv argv (args);
2259 for (arg = argv[0], argcnt = 0; arg != NULL; arg = argv[++argcnt])
2261 if (stop_processing_options || *arg !=
'-')
2263 if (filename == NULL)
2266 filename.reset (tilde_expand (arg));
2268 else if (!seen_addr)
2272 sect_opts[0].value = arg;
2276 error (_(
"Unrecognized argument \"%s\""), arg);
2278 else if (strcmp (arg,
"-readnow") == 0)
2280 else if (strcmp (arg,
"-readnever") == 0)
2282 else if (strcmp (arg,
"-s") == 0)
2284 if (argv[argcnt + 1] == NULL)
2285 error (_(
"Missing section name after \"-s\""));
2286 else if (argv[argcnt + 2] == NULL)
2287 error (_(
"Missing section address after \"-s\""));
2289 sect_opt sect = { argv[argcnt + 1], argv[argcnt + 2] };
2291 sect_opts.push_back (sect);
2294 else if (strcmp (arg,
"-o") == 0)
2296 arg = argv[++argcnt];
2298 error (_(
"Missing argument to -o"));
2303 else if (strcmp (arg,
"--") == 0)
2304 stop_processing_options =
true;
2306 error (_(
"Unrecognized argument \"%s\""), arg);
2309 if (filename == NULL)
2310 error (_(
"You must provide a filename to be loaded."));
2320 gdb_printf (_(
"add symbol table from file \"%ps\""),
2323 std::vector<sect_opt>::const_iterator it = sect_opts.begin ();
2326 for (; it != sect_opts.end (); ++it)
2329 const char *val = it->value;
2330 const char *sec = it->name;
2332 if (section_addrs.empty ())
2342 section_addrs.emplace_back (addr, sec, section_addrs.size ());
2354 (section_addrs.empty ()
2355 ? _(
" with all sections")
2356 : _(
"with other sections")),
2358 else if (section_addrs.empty ())
2361 if (from_tty && (!
query (
"%s",
"")))
2362 error (_(
"Not confirmed."));
2367 warning (_(
"newly-added symbol file \"%ps\" does not provide any symbols"),
2392 error (_(
"remove-symbol-file: no symbol file provided"));
2394 gdb_argv argv (args);
2396 if (strcmp (argv[0],
"-a") == 0)
2401 if (argv[1] == NULL)
2402 error (_(
"Missing address argument"));
2404 if (argv[2] != NULL)
2405 error (_(
"Junk after %s"), argv[1]);
2421 else if (argv[0] != NULL)
2425 if (argv[1] != NULL)
2426 error (_(
"Junk after %s"), argv[0]);
2428 gdb::unique_xmalloc_ptr<char> filename (tilde_expand (argv[0]));
2444 error (_(
"No symbol file found"));
2447 && !
query (_(
"Remove symbol table from file \"%s\"? "),
2449 error (_(
"Not confirmed."));
2460 std::vector<struct objfile *> new_objfiles;
2490 struct stat new_statbuf;
2491 int res = bfd_stat (
objfile->
obfd.get (), &new_statbuf);
2498 const char *filename;
2500 filename = bfd_get_filename (
objfile->
obfd->my_archive);
2504 warning (_(
"`%ps' has disappeared; keeping its symbols."),
2508 time_t new_modtime = new_statbuf.st_mtime;
2511 gdb_printf (_(
"`%ps' has changed; re-reading symbols.\n"),
2559 const char *obfd_filename;
2561 obfd_filename = bfd_get_filename (
objfile->
obfd.get ());
2567 error (_(
"Can't open %s to read symbols."), obfd_filename);
2573 if (!bfd_check_format (
objfile->
obfd.get (), bfd_object))
2575 bfd_errmsg (bfd_get_error ()));
2652 gdb_printf (_(
"Expanding full symbols from %ps...\n"),
2662 gdb_printf (_(
"(no debugging symbols found)\n"));
2675 objfile_holder.release ();
2676 defer_clear_users.release ();
2684 new_objfiles.push_back (
objfile);
2688 if (!new_objfiles.empty ())
2695 for (
auto iter : new_objfiles)
2718 gdb_assert (ext !=
nullptr);
2728 _(
"Mapping between filename extension "
2729 "and source language is \"%s\".\n"),
2737 const char *begin =
ext_args.c_str ();
2738 const char *end =
ext_args.c_str ();
2742 error (_(
"'%s': Filename extension must begin with '.'"),
ext_args.c_str ());
2745 while (*end !=
'\0' && !isspace (*end))
2749 error (_(
"'%s': two arguments required -- "
2750 "filename extension and language"),
2754 std::string extension =
ext_args.substr (0, end - begin);
2757 begin = skip_spaces (end);
2760 error (_(
"'%s': two arguments required -- "
2761 "filename extension and language"),
2771 if (it->ext == extension)
2795 gdb_printf (_(
"Filename extensions and the languages they represent:"));
2798 gdb_printf (
"\t%s\t- %s\n", entry.ext.c_str (),
2807 if (filename != NULL)
2808 if ((cp = strrchr (filename,
'.')) != NULL)
2811 if (entry.ext == cp)
2840 static std::string last_objfile_name;
2843 if (last_objfile_name.empty () || last_objfile_name != this_objfile_name)
2845 last_objfile_name = this_objfile_name;
2848 (
"creating one or more symtabs for objfile %s", this_objfile_name);
2873 const char *saved_name;
2880 saved_name = lbasename (
name);
2886 host_address_to_string (cu),
2990 if (bfd_section_lma (bfd_section) != 0
2991 && bfd_section_lma (bfd_section) != bfd_section_vma (bfd_section))
3007 sect->ovly_mapped = -1;
3063 bfd_vma
size = bfd_section_size (bfd_section);
3064 CORE_ADDR offset = section->
offset ();
3066 if (bfd_section_lma (bfd_section) + offset <= pc
3067 && pc < bfd_section_lma (bfd_section) + offset +
size)
3082 if (section->
addr () <= pc
3083 && pc < section->endaddr ())
3096 CORE_ADDR a_start = a->
addr ();
3097 CORE_ADDR a_end = a->
endaddr ();
3098 CORE_ADDR b_start = b->
addr ();
3099 CORE_ADDR b_end = b->
endaddr ();
3101 return (a_start < b_end && b_start < a_end);
3115 return (pc + bfd_section_lma (bfd_section)
3116 - bfd_section_vma (bfd_section));
3133 return (pc + bfd_section_vma (bfd_section)
3134 - bfd_section_lma (bfd_section));
3236 vma = bfd_section_vma (osect->the_bfd_section);
3237 lma = bfd_section_lma (osect->the_bfd_section);
3238 size = bfd_section_size (osect->the_bfd_section);
3239 name = bfd_section_name (osect->the_bfd_section);
3265 error (_(
"Overlay debugging not enabled. Use "
3266 "either the 'overlay auto' or\n"
3267 "the 'overlay manual' command."));
3269 if (args == 0 || *args == 0)
3270 error (_(
"Argument required: name of an overlay section"));
3275 if (!strcmp (bfd_section_name (sec->the_bfd_section), args))
3282 sec->ovly_mapped = 1;
3292 gdb_printf (_(
"Note: section %s unmapped by overlap\n"),
3293 bfd_section_name (sec2->the_bfd_section));
3294 sec2->ovly_mapped = 0;
3298 error (_(
"No overlay section called %s"), args);
3309 error (_(
"Overlay debugging not enabled. "
3310 "Use either the 'overlay auto' or\n"
3311 "the 'overlay manual' command."));
3313 if (args == 0 || *args == 0)
3314 error (_(
"Argument required: name of an overlay section"));
3319 if (!strcmp (bfd_section_name (sec->the_bfd_section), args))
3321 if (!sec->ovly_mapped)
3322 error (_(
"Section %s is not mapped"), args);
3323 sec->ovly_mapped = 0;
3326 error (_(
"No overlay section called %s"), args);
3339 gdb_printf (_(
"Automatic overlay debugging enabled."));
3352 gdb_printf (_(
"Overlay debugging enabled."));
3365 gdb_printf (_(
"Overlay debugging disabled."));
3376 error (_(
"This target does not know how to read its overlay state."));
3440 int len,
int size,
enum bfd_endian byte_order)
3443 gdb_byte *buf = (gdb_byte *) alloca (len *
size);
3447 for (i = 0; i < len; i++)
3461 enum bfd_endian byte_order;
3465 if (! novlys_msym.
minsym)
3467 error (_(
"Error reading inferior's overlay table: "
3468 "couldn't find `_novlys' variable\n"
3469 "in inferior. Use `overlay manual' mode."));
3474 if (! ovly_table_msym.
minsym)
3476 error (_(
"Error reading inferior's overlay table: couldn't find "
3477 "`_ovly_table' array\n"
3478 "in inferior. Use `overlay manual' mode."));
3521 4, word_size, byte_order);
3555 if (
minsym.minsym == NULL)
3556 error (_(
"Error reading inferior's overlay table: couldn't "
3557 "find `_ovly_table' array\n"
3558 "in inferior. Use `overlay manual' mode."));
3581 asection *bsect = sect->the_bfd_section;
3601 bfd *abfd = sectp->owner;
3605 if ((sectp->flags & SEC_RELOC) == 0)
3612 sect->output_section = sect;
3613 sect->output_offset = 0;
3616 return bfd_simple_get_relocated_section_contents (abfd, sectp, buf, NULL);
3635 asection *sectp, bfd_byte *buf)
3672 int num_segment_bases,
3673 const CORE_ADDR *segment_bases)
3680 gdb_assert (num_segment_bases > 0);
3684 gdb_assert (data != NULL);
3685 gdb_assert (data->segments.size () > 0);
3687 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
3689 int which = data->segment_info[i];
3691 gdb_assert (0 <= which && which <= data->segments.size ());
3700 if (which > num_segment_bases)
3701 which = num_segment_bases;
3703 offsets[i] = segment_bases[which - 1] - data->segments[which - 1].base;
3720 if (data->segments.size () != 1 && data->segments.size () != 2)
3723 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
3725 int which = data->segment_info[i];
3735 else if (which == 2)
3761 (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
3763 gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
3764 gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
3765 block_search_flags search_flags,
3797static void test_filename_language ()
3817test_set_ext_lang_command ()
3841 SELF_CHECK (size_before == size_after);
3857#define READNOW_READNEVER_HELP \
3858 "The '-readnow' option will cause GDB to read the entire symbol file\n\
3859immediately. This makes the command slower, but may make future operations\n\
3861The '-readnever' option will prevent GDB from reading the symbol file's\n\
3862symbolic debug information."
3865Load symbol table from executable file FILE.\n\
3866Usage: symbol-file [-readnow | -readnever] [-o OFF] FILE\n\
3867OFF is an optional offset which is added to each section address.\n\
3868The `file' command can also load symbol tables, as well as setting the file\n\
3873Load symbols from FILE, assuming FILE has been dynamically loaded.\n\
3874Usage: add-symbol-file FILE [-readnow | -readnever] [-o OFF] [ADDR] \
3875[-s SECT-NAME SECT-ADDR]...\n\
3876ADDR is the starting address of the file's text.\n\
3877Each '-s' argument provides a section name and address, and\n\
3878should be specified if the data and bss segments are not contiguous\n\
3879with the text. SECT-NAME is a section name to be loaded at SECT-ADDR.\n\
3880OFF is an optional offset which is added to the default load addresses\n\
3881of all sections for which no other address was specified.\n"
3888Remove a symbol file added via the add-symbol-file command.\n\
3889Usage: remove-symbol-file FILENAME\n\
3890 remove-symbol-file -a ADDRESS\n\
3891The file to remove can be identified by its filename or by an address\n\
3892that lies within the boundaries of this symbol file in memory."),
3896Dynamically load FILE into the running program.\n\
3897FILE symbols are recorded for access from GDB.\n\
3898Usage: load [FILE] [OFFSET]\n\
3899An optional load OFFSET may also be given as a literal address.\n\
3900When OFFSET is provided, FILE must also be provided. FILE can be provided\n\
3906 _(
"Commands for debugging overlays."), &
overlaylist,
3913 _(
"Assert that an overlay section is mapped."), &
overlaylist);
3916 _(
"Assert that an overlay section is unmapped."), &
overlaylist);
3919 _(
"List mappings of overlay sections."), &
overlaylist);
3926 _(
"Enable automatic overlay debugging."), &
overlaylist);
3928 _(
"Read the overlay mapping state from the target."), &
overlaylist);
3933Set mapping between filename extension and source language."), _(
"\
3934Show mapping between filename extension and source language."), _(
"\
3935Usage: set extension-language .foo bar"),
3941 _(
"All filename extensions associated with a source language."));
3945Set the directories where separate debug symbols are searched for."), _(
"\
3946Show the directories where separate debug symbols are searched for."), _(
"\
3947Separate debug symbols are first searched for in the same\n\
3949and lastly at the path of the directory of the binary with\n\
3950each global debug-file-directory component prepended."),
3958Set printing of symbol loading messages."), _(
"\
3959Show printing of symbol loading messages."), _(
"\
3960off == turn all messages off\n\
3961brief == print messages for the executable,\n\
3962 and brief messages for shared libraries\n\
3963full == print messages for the executable,\n\
3964 and messages for each shared library."),
3971Set printing of separate debug info file search debug."), _(
"\
3972Show printing of separate debug info file search debug."), _(
"\
3973When on, GDB prints the searched locations while looking for separate debug \
3977 selftests::register_test
3978 (
"filename_language", selftests::filename_language::test_filename_language);
3979 selftests::register_test
3980 (
"set_ext_lang_command",
3981 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 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_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 mach_port_t name mach_port_t mach_port_t name kern_return_t err
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)
static void set_language(const char *language)
const char * language_str(enum language lang)
const struct language_defn * current_language
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< struct objfile * > new_objfile
observable< program_space * > all_objfiles_removed
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
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
void warn(const char *format,...) ATTRIBUTE_PRINTF(2
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
struct obj_section * sections_start
const char * original_name
iterator_range< section_iterator > sections()
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)
objfile(gdb_bfd_ref_ptr, const char *, objfile_flags)
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 int separate_debug_file_exists(const std::string &name, unsigned long crc, struct objfile *parent_objfile, deferred_warnings *warnings)
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
static std::string find_separate_debug_file(const char *dir, const char *canon_dir, const char *debuglink, unsigned long crc32, struct objfile *objfile, deferred_warnings *warnings)
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)
std::string find_separate_debug_file_by_debuglink(struct objfile *objfile, deferred_warnings *warnings)
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)
bool pc_in_unmapped_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 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)
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
bool pc_in_mapped_range(CORE_ADDR pc, struct obj_section *section)
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)
gdb_bfd_ref_ptr symfile_bfd_open_no_error(const char *name) noexcept
static void set_objfile_default_section_offset(struct objfile *objf, const section_addr_info &addrs, CORE_ADDR offset)
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
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={})
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)