41 #include "filenames.h"
47 #include "readline/readline.h"
60 #include <sys/types.h>
72 unsigned long section_sent,
73 unsigned long section_size,
74 unsigned long total_sent,
75 unsigned long total_size);
134 enum bfd_flavour sym_flavour;
146 const char print_symbol_loading_off[] =
"off";
147 const char print_symbol_loading_brief[] =
"brief";
148 const char print_symbol_loading_full[] =
"full";
149 static const char *print_symbol_loading_enums[] =
151 print_symbol_loading_off,
152 print_symbol_loading_brief,
153 print_symbol_loading_full,
230 asection **lowest = (asection **) obj;
232 if (0 == (bfd_get_section_flags (abfd, sect) & (SEC_ALLOC | SEC_LOAD)))
236 else if (bfd_section_vma (abfd, *lowest) > bfd_section_vma (abfd, sect))
238 else if (bfd_section_vma (abfd, *lowest) == bfd_section_vma (abfd, sect)
239 && (bfd_section_size (abfd, (*lowest))
240 <= bfd_section_size (abfd, sect)))
255 + sizeof (struct other_sections) * (num_sections - 1));
257 memset (sap, 0, size);
275 for (stp = start, oidx = 0; stp != end; stp++)
278 bfd *abfd = asect->owner;
280 if (bfd_get_section_flags (abfd, asect) & (SEC_ALLOC | SEC_LOAD)
281 && oidx < end - start)
284 sap->
other[oidx].
name = xstrdup (bfd_section_name (abfd, asect));
302 struct bfd_section *sec;
305 for (i = 0, sec = abfd->sections; sec != NULL; sec = sec->next)
306 if (bfd_get_section_flags (abfd, sec) & (SEC_ALLOC | SEC_LOAD))
308 sap->
other[i].
addr = bfd_get_section_vma (abfd, sec);
309 sap->
other[i].
name = xstrdup (bfd_get_section_name (abfd, sec));
360 sect = bfd_get_section_by_name (objfile->
obfd,
".text");
364 sect = bfd_get_section_by_name (objfile->
obfd,
".data");
368 sect = bfd_get_section_by_name (objfile->
obfd,
".bss");
372 sect = bfd_get_section_by_name (objfile->
obfd,
".rodata");
433 if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
441 start_addr = (arg->
lowest + align - 1) & -align;
448 for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
450 int indx = cur_sec->index;
457 if ((bfd_get_section_flags (abfd, cur_sec) & SEC_ALLOC) == 0)
463 if (offsets[indx] == 0)
467 if (start_addr + bfd_get_section_size (sect) > offsets[indx]
468 && start_addr < offsets[indx] + bfd_get_section_size (cur_sec))
470 start_addr = offsets[indx] + bfd_get_section_size (cur_sec);
471 start_addr = (start_addr + align - 1) & -align;
482 arg->
lowest = start_addr + bfd_get_section_size (sect);
503 osp = &addrs->
other[i];
523 if (strcmp (s,
".dynbss") == 0)
525 if (strcmp (s,
".sdynbss") == 0)
560 array[i] = &addrs->
other[i];
575 asection *lower_sect;
587 if (lower_sect == NULL)
589 warning (
_(
"no loadable sections found in added symbol-file %s"),
590 bfd_get_filename (abfd));
594 lower_offset = bfd_section_vma (bfd_get_filename (abfd), lower_sect);
617 addrs_to_abfd_addrs =
xzalloc (
sizeof (*addrs_to_abfd_addrs)
621 while (*addrs_sorted)
625 while (*abfd_addrs_sorted
630 if (*abfd_addrs_sorted
637 index_in_addrs = *addrs_sorted - addrs->
other;
638 gdb_assert (addrs_to_abfd_addrs[index_in_addrs] == NULL);
639 addrs_to_abfd_addrs[index_in_addrs] = *abfd_addrs_sorted;
678 const char *sect_name = addrs->
other[i].
name;
694 if (!(strcmp (sect_name,
".gnu.liblist") == 0
695 || strcmp (sect_name,
".gnu.conflict") == 0
696 || (strcmp (sect_name,
".bss") == 0
698 && strcmp (addrs->
other[i - 1].
name,
".dynbss") == 0
699 && addrs_to_abfd_addrs[i - 1] != NULL)
700 || (strcmp (sect_name,
".sbss") == 0
702 && strcmp (addrs->
other[i - 1].
name,
".sdynbss") == 0
703 && addrs_to_abfd_addrs[i - 1] != NULL)))
704 warning (
_(
"section %s not found in %s"), sect_name,
705 bfd_get_filename (abfd));
737 if ((bfd_get_file_flags (objfile->
obfd) & (EXEC_P | DYNAMIC)) == 0)
740 bfd *abfd = objfile->
obfd;
743 for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
746 if (bfd_section_vma (abfd, cur_sec) != 0)
785 for (cur_sec = abfd->sections; cur_sec != NULL;
786 cur_sec = cur_sec->next)
788 if ((bfd_get_section_flags (abfd, cur_sec) & SEC_ALLOC) == 0)
791 bfd_set_section_vma (abfd, cur_sec, offsets[cur_sec->index]);
794 offsets[cur_sec->index]);
795 offsets[cur_sec->index] = 0;
822 if ((bfd_get_file_flags (abfd) & (EXEC_P | DYNAMIC)) == 0)
826 for (sect = abfd->sections; sect != NULL; sect = sect->next)
828 if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
836 low = bfd_get_section_vma (abfd, sect);
837 high = low + bfd_get_section_size (sect);
844 num_sections = bfd_count_sections (abfd);
847 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
851 if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
854 vma = bfd_get_section_vma (abfd, sect);
857 if (vma + bfd_get_section_size (sect) > high)
858 high = vma + bfd_get_section_size (sect);
875 (*objfile->
sf->
sym_read) (objfile, add_flags);
917 if (bfd_get_file_flags (objfile->
obfd) & EXEC_P)
924 else if (bfd_get_file_flags (objfile->
obfd) & DYNAMIC
925 && bfd_get_start_address (objfile->
obfd) != 0)
962 if (entry_point >= bfd_get_section_vma (objfile->
obfd, sect)
963 && entry_point < (bfd_get_section_vma (objfile->
obfd, sect)
964 + bfd_get_section_size (sect)))
1010 if (objfile->
sf == NULL)
1168 && !
query (
_(
"Load new symbol table from \"%s\"? "),
name))
1169 error (
_(
"Not confirmed."));
1231 if (objfile->
sf == NULL)
1241 bfd_cache_close_all ();
1263 (bfd, name, symfile_flags, sap,
1336 ? !
query (
_(
"Discard symbol table from `%s'? "),
1338 : !
query (
_(
"Discard symbol table? "))))
1339 error (
_(
"Not confirmed."));
1354 struct objfile *parent_objfile)
1356 unsigned long file_crc;
1359 struct stat parent_stat, abfd_stat;
1360 int verified_as_different;
1368 if (filename_cmp (name,
objfile_name (parent_objfile)) == 0)
1387 if (bfd_stat (abfd, &abfd_stat) == 0
1388 && abfd_stat.st_ino != 0
1389 && bfd_stat (parent_objfile->
obfd, &parent_stat) == 0)
1391 if (abfd_stat.st_dev == parent_stat.st_dev
1392 && abfd_stat.st_ino == parent_stat.st_ino)
1397 verified_as_different = 1;
1400 verified_as_different = 0;
1409 if (crc != file_crc)
1411 unsigned long parent_crc;
1417 if (!verified_as_different)
1423 if (verified_as_different || parent_crc != file_crc)
1424 warning (
_(
"the debug information found in \"%s\""
1425 " does not match \"%s\" (CRC mismatch).\n"),
1440 _(
"The directory where separate debug "
1441 "symbols are searched for is \"%s\".\n"),
1445 #if ! defined (DEBUG_SUBDIRECTORY)
1446 #define DEBUG_SUBDIRECTORY ".debug"
1458 const char *canon_dir,
1459 const char *debuglink,
1471 if (canon_dir != NULL && strlen (canon_dir) > i)
1472 i = strlen (canon_dir);
1478 + strlen (debuglink)
1482 strcpy (debugfile, dir);
1483 strcat (debugfile, debuglink);
1489 strcpy (debugfile, dir);
1491 strcat (debugfile,
"/");
1492 strcat (debugfile, debuglink);
1507 strcpy (debugfile, debugdir);
1508 strcat (debugfile,
"/");
1509 strcat (debugfile, dir);
1510 strcat (debugfile, debuglink);
1520 if (canon_dir != NULL
1523 && IS_DIR_SEPARATOR (canon_dir[strlen (
gdb_sysroot)]))
1525 strcpy (debugfile, debugdir);
1526 strcat (debugfile, canon_dir + strlen (
gdb_sysroot));
1527 strcat (debugfile,
"/");
1528 strcat (debugfile, debuglink);
1554 for (i = strlen(path) - 1; i >= 0; i--)
1555 if (IS_DIR_SEPARATOR (path[i]))
1569 char *dir, *canon_dir;
1571 unsigned long crc32;
1574 debuglink = bfd_get_debug_link_info (objfile->
obfd, &crc32);
1576 if (debuglink == NULL)
1587 canon_dir = lrealpath (dir);
1593 if (debugfile == NULL)
1601 && S_ISLNK (st_buf.st_mode))
1606 if (symlink_dir != NULL)
1610 if (strcmp (dir, symlink_dir) != 0)
1658 while (*argv != NULL)
1660 if (strcmp (*argv,
"-readnow") == 0)
1662 else if (**argv ==
'-')
1663 error (
_(
"unknown option `%s'"), *argv);
1674 error (
_(
"no symbol file name was specified"));
1729 char *expanded_name, *absolute_name;
1731 expanded_name = tilde_expand (name);
1734 desc =
openp (getenv (
"PATH"),
1736 expanded_name, O_RDONLY |
O_BINARY, &absolute_name);
1737 #if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
1740 char *exename = alloca (strlen (expanded_name) + 5);
1742 strcat (strcpy (exename, expanded_name),
".exe");
1743 desc =
openp (getenv (
"PATH"),
1745 exename, O_RDONLY |
O_BINARY, &absolute_name);
1754 xfree (expanded_name);
1756 name = absolute_name;
1761 error (
_(
"`%s': can't open to read symbols: %s."), name,
1762 bfd_errmsg (bfd_get_error ()));
1765 bfd_set_cacheable (sym_bfd, 1);
1767 if (!bfd_check_format (sym_bfd, bfd_object))
1770 error (
_(
"`%s': can't read symbols: %s."), name,
1771 bfd_errmsg (bfd_get_error ()));
1785 asection *sect = bfd_get_section_by_name (objfile->
obfd, section_name);
1816 enum bfd_flavour our_flavour = bfd_get_flavour (abfd);
1819 if (our_flavour == bfd_target_srec_flavour
1820 || our_flavour == bfd_target_ihex_flavour
1821 || our_flavour == bfd_target_tekhex_flavour)
1828 error (
_(
"I'm sorry, Dave, I can't do that. Symbol format `%s' unknown."),
1829 bfd_get_target (abfd));
1855 while ((parg = strpbrk (parg,
"\\\"'\t ")))
1864 char *temp =
xmalloc (strlen (arg) + count + 1 );
1871 while ((parg = strpbrk (parg,
"\\\"'\t ")))
1873 strncpy (ptemp, prev, parg - prev);
1874 ptemp += parg - prev;
1878 strcpy (ptemp, prev);
1909 bfd_size_type *sum = data;
1911 *sum += bfd_get_section_size (asec);
1979 error (
_(
"Download verify read failed at %s"),
1981 if (memcmp (args->
buffer, check, bytes) != 0)
1982 error (
_(
"Download verify compare failed at %s"),
1995 error (
_(
"Canceled the download"));
2013 bfd_size_type
size = bfd_get_section_size (asec);
2015 const char *sect_name = bfd_get_section_name (abfd, asec);
2017 if ((bfd_get_section_flags (abfd, asec) & SEC_LOAD) == 0)
2024 args->requests, NULL);
2031 new_request->
baton = section_data;
2033 buffer = new_request->
data;
2038 section_data->
lma = new_request->
begin;
2041 bfd_get_section_contents (abfd, asec, buffer, 0, size);
2067 struct timeval start_time, end_time;
2077 memset (&cbdata, 0,
sizeof (cbdata));
2078 memset (&total_progress, 0,
sizeof (total_progress));
2089 filename = tilde_expand (argv[0]);
2092 if (argv[1] != NULL)
2100 if (argv[1] == endptr)
2101 error (
_(
"Invalid download offset:%s."), argv[1]);
2103 if (argv[2] != NULL)
2104 error (
_(
"Too many parameters."));
2109 if (loadfile_bfd == NULL)
2117 if (!bfd_check_format (loadfile_bfd, bfd_object))
2119 error (
_(
"\"%s\" is not an object file: %s"), filename,
2120 bfd_errmsg (bfd_get_error ()));
2128 gettimeofday (&start_time, NULL);
2132 error (
_(
"Load failed"));
2134 gettimeofday (&end_time, NULL);
2136 entry = bfd_get_start_address (loadfile_bfd);
2165 &start_time, &end_time);
2174 unsigned long data_count,
2175 unsigned long write_count,
2176 const struct timeval *start_time,
2177 const struct timeval *end_time)
2184 time_count = (end_time->tv_sec - start_time->tv_sec) * 1000;
2185 time_count += (end_time->tv_usec - start_time->tv_usec) / 1000;
2190 unsigned long rate = ((
ULONGEST) data_count * 1000) / time_count;
2197 else if (rate < 1024)
2213 if (write_count > 0)
2235 char *filename = NULL;
2238 int section_index = 0;
2242 int expecting_sec_name = 0;
2243 int expecting_sec_addr = 0;
2254 struct sect_opt *sect_opts = NULL;
2255 size_t num_sect_opts = 0;
2259 sect_opts = (
struct sect_opt *)
xmalloc (num_sect_opts
2260 *
sizeof (
struct sect_opt));
2265 error (
_(
"add-symbol-file takes a file name and an address"));
2270 for (arg = argv[0], argcnt = 0; arg != NULL; arg = argv[++argcnt])
2276 filename = tilde_expand (arg);
2279 else if (argcnt == 1)
2283 sect_opts[section_index].name =
".text";
2284 sect_opts[section_index].value = arg;
2285 if (++section_index >= num_sect_opts)
2288 sect_opts = ((
struct sect_opt *)
2291 *
sizeof (
struct sect_opt)));
2298 if (expecting_sec_name)
2300 sect_opts[section_index].name = arg;
2301 expecting_sec_name = 0;
2303 else if (expecting_sec_addr)
2305 sect_opts[section_index].value = arg;
2306 expecting_sec_addr = 0;
2307 if (++section_index >= num_sect_opts)
2310 sect_opts = ((
struct sect_opt *)
2313 *
sizeof (
struct sect_opt)));
2316 else if (strcmp (arg,
"-readnow") == 0)
2318 else if (strcmp (arg,
"-s") == 0)
2320 expecting_sec_name = 1;
2321 expecting_sec_addr = 1;
2324 error (
_(
"USAGE: add-symbol-file <filename> <textaddress>"
2325 " [-readnow] [-s <secname> <addr>]*"));
2333 if (section_index < 1)
2334 error (
_(
"The address where %s has been loaded is missing"), filename);
2345 for (i = 0; i < section_index; i++)
2348 char *val = sect_opts[i].value;
2349 char *sec = sect_opts[i].name;
2355 section_addrs->
other[sec_num].
name = sec;
2356 section_addrs->
other[sec_num].
addr = addr;
2369 if (from_tty && (!
query (
"%s",
"")))
2370 error (
_(
"Not confirmed."));
2373 section_addrs, flags);
2398 error (
_(
"remove-symbol-file: no symbol file provided"));
2404 if (strcmp (argv[0],
"-a") == 0)
2409 if (argv[1] == NULL)
2410 error (
_(
"Missing address argument"));
2412 if (argv[2] != NULL)
2413 error (
_(
"Junk after %s"), argv[1]);
2425 else if (argv[0] != NULL)
2430 if (argv[1] != NULL)
2431 error (
_(
"Junk after %s"), argv[0]);
2433 filename = tilde_expand (argv[0]);
2440 && objf->
pspace == pspace
2447 error (
_(
"No symbol file found"));
2450 && !
query (
_(
"Remove symbol table from file \"%s\"? "),
2452 error (
_(
"Not confirmed."));
2471 struct stat new_statbuf;
2473 VEC (objfilep) *new_objfiles = NULL;
2486 if (objfile->
obfd == NULL)
2497 if (objfile->
obfd->my_archive)
2498 res = stat (objfile->
obfd->my_archive->filename, &new_statbuf);
2508 new_modtime = new_statbuf.st_mtime;
2509 if (new_modtime != objfile->
mtime)
2514 char *original_name;
2534 && filename_cmp (bfd_get_filename (objfile->
obfd),
2558 if (objfile->
sf != NULL)
2563 clear_objfile_data (objfile);
2567 struct bfd *obfd = objfile->
obfd;
2568 char *obfd_filename;
2570 obfd_filename = bfd_get_filename (objfile->
obfd);
2574 if (objfile->
obfd == NULL)
2580 error (
_(
"Can't open %s to read symbols."), obfd_filename);
2589 if (!bfd_check_format (objfile->
obfd, bfd_object))
2591 bfd_errmsg (bfd_get_error ()));
2636 strlen (original_name));
2690 objfile->
mtime = new_modtime;
2709 for (ix = 0;
VEC_iterate (objfilep, new_objfiles, ix, objfile); ix++)
2737 filename_language_table =
2753 _(
"Mapping between filename extension "
2754 "and source language is \"%s\".\n"),
2767 error (
_(
"'%s': Filename extension must begin with '.'"),
ext_args);
2770 while (*cp && !isspace (*cp))
2774 error (
_(
"'%s': two arguments required -- "
2775 "filename extension and language"),
2785 error (
_(
"'%s': two arguments required -- "
2786 "filename extension and language"),
2794 if (0 == strcmp (
ext_args, filename_language_table[i].ext))
2797 if (i >= fl_table_next)
2810 xfree (filename_language_table[i].ext);
2811 filename_language_table[i].
ext = xstrdup (
ext_args);
2812 filename_language_table[i].
lang = lang;
2821 printf_filtered (
_(
"Filename extensions and the languages they represent:"));
2825 filename_language_table[i].ext,
2836 filename_language_table =
2885 if (filename != NULL)
2886 if ((cp = strrchr (filename,
'.')) != NULL)
2888 if (strcmp (cp, filename_language_table[i].ext) == 0)
2889 return filename_language_table[i].
lang;
2915 static char *last_objfile_name = NULL;
2917 if (last_objfile_name == NULL
2918 || strcmp (last_objfile_name,
objfile_name (objfile)) != 0)
2920 xfree (last_objfile_name);
2923 "Creating one or more symtabs for objfile %s ...\n",
2927 "Created symtab %s for module %s.\n",
2958 const char *saved_name;
2965 saved_name = lbasename (name);
2967 strlen (saved_name));
2974 "Created compunit symtab %s for %s.\n",
3096 if (bfd_section_lma (abfd, bfd_section) != 0
3097 && bfd_section_lma (abfd, bfd_section)
3098 != bfd_section_vma (abfd, bfd_section))
3173 bfd_vma
size = bfd_get_section_size (bfd_section);
3176 if (bfd_get_section_lma (abfd, bfd_section) + offset <= pc
3177 && pc < bfd_get_section_lma (abfd, bfd_section) + offset + size)
3211 return (a_start < b_end && b_start < a_end);
3226 return pc + bfd_section_lma (abfd, bfd_section)
3227 - bfd_section_vma (abfd, bfd_section);
3245 return pc + bfd_section_vma (abfd, bfd_section)
3246 - bfd_section_lma (abfd, bfd_section);
3377 error (
_(
"Overlay debugging not enabled. Use "
3378 "either the 'overlay auto' or\n"
3379 "the 'overlay manual' command."));
3381 if (args == 0 || *args == 0)
3382 error (
_(
"Argument required: name of an overlay section"));
3402 bfd_section_name (objfile->
obfd,
3408 error (
_(
"No overlay section called %s"), args);
3422 error (
_(
"Overlay debugging not enabled. "
3423 "Use either the 'overlay auto' or\n"
3424 "the 'overlay manual' command."));
3426 if (args == 0 || *args == 0)
3427 error (
_(
"Argument required: name of an overlay section"));
3434 error (
_(
"Section %s is not mapped"), args);
3438 error (
_(
"No overlay section called %s"), args);
3488 error (
_(
"This target does not know how to read its overlay state."));
3501 (
"\"overlay\" must be followed by the name of an overlay command.\n");
3564 int len,
int size,
enum bfd_endian byte_order)
3567 gdb_byte *buf = alloca (len * size);
3571 for (i = 0; i <
len; i++)
3589 if (! novlys_msym.
minsym)
3591 error (
_(
"Error reading inferior's overlay table: "
3592 "couldn't find `_novlys' variable\n"
3593 "in inferior. Use `overlay manual' mode."));
3598 if (! ovly_table_msym.
minsym)
3600 error (
_(
"Error reading inferior's overlay table: couldn't find "
3601 "`_ovly_table' array\n"
3602 "in inferior. Use `overlay manual' mode."));
3648 4, word_size, byte_order);
3685 if (minsym.
minsym == NULL)
3686 error (
_(
"Error reading inferior's overlay table: couldn't "
3687 "find `_ovly_table' array\n"
3688 "in inferior. Use `overlay manual' mode."));
3713 size = bfd_get_section_size (bsect);
3733 sectp->output_section = sectp;
3734 sectp->output_offset = 0;
3745 bfd *abfd = sectp->owner;
3749 if ((sectp->flags & SEC_RELOC) == 0)
3756 return bfd_simple_get_relocated_section_contents (abfd, sectp, buf, NULL);
3775 asection *sectp, bfd_byte *buf)
3821 int num_segment_bases,
3836 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
3840 gdb_assert (0 <= which && which <= data->num_segments);
3849 if (which > num_segment_bases)
3850 which = num_segment_bases;
3852 offsets->
offsets[i] = (segment_bases[which - 1]
3862 bfd *abfd = objfile->
obfd;
3877 for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
3889 else if (which == 2)
3908 if (objfile != NULL)
3930 expansion_notify, kind,
3961 Load symbol table from executable file FILE.\n\
3962 The `file' command can also load symbol tables, as well as setting the file\n\
3967 Load symbols from FILE, assuming FILE has been dynamically loaded.\n\
3968 Usage: add-symbol-file FILE ADDR [-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR>\
3969 ...]\nADDR is the starting address of the file's text.\n\
3970 The optional arguments are section-name section-address pairs and\n\
3971 should be specified if the data and bss segments are not contiguous\n\
3972 with the text. SECT is a section name to be loaded at SECT_ADDR."),
3978 Remove a symbol file added via the add-symbol-file command.\n\
3979 Usage: remove-symbol-file FILENAME\n\
3980 remove-symbol-file -a ADDRESS\n\
3981 The file to remove can be identified by its filename or by an address\n\
3982 that lies within the boundaries of this symbol file in memory."),
3986 Dynamically load FILE into the running program, and record its symbols\n\
3987 for access from GDB.\n\
3988 A load OFFSET may also be given."), &
cmdlist);
3992 _(
"Commands for debugging overlays."), &overlaylist,
3999 _(
"Assert that an overlay section is mapped."), &overlaylist);
4002 _(
"Assert that an overlay section is unmapped."), &overlaylist);
4005 _(
"List mappings of overlay sections."), &overlaylist);
4008 _(
"Enable overlay debugging."), &overlaylist);
4010 _(
"Disable overlay debugging."), &overlaylist);
4012 _(
"Enable automatic overlay debugging."), &overlaylist);
4014 _(
"Read the overlay mapping state from the target."), &overlaylist);
4020 Set mapping between filename extension and source language."),
_(
"\
4021 Show mapping between filename extension and source language."),
_(
"\
4022 Usage: set extension-language .foo bar"),
4028 _(
"All filename extensions associated with a source language."));
4032 Set the directories where separate debug symbols are searched for."),
_(
"\
4033 Show the directories where separate debug symbols are searched for."),
_(
"\
4034 Separate debug symbols are first searched for in the same\n\
4036 and lastly at the path of the directory of the binary with\n\
4037 each global debug-file-directory component prepended."),
4045 Set printing of symbol loading messages."),
_(
"\
4046 Show printing of symbol loading messages."),
_(
"\
4047 off == turn all messages off\n\
4048 brief == print messages for the executable,\n\
4049 and brief messages for shared libraries\n\
4050 full == print messages for the executable,\n\
4051 and messages for each shared library."),
static void place_section(bfd *abfd, asection *sect, void *obj)
void error_no_arg(const char *why)
struct gdbarch * target_gdbarch(void)
void objfiles_changed(void)
struct psymbol_allocation_list static_psymbols
enum language language_enum(char *str)
struct cleanup * make_cleanup_freeargv(char **arg)
bfd_byte * symfile_relocate_debug_section(struct objfile *objfile, asection *sectp, bfd_byte *buf)
static void remove_symbol_file_command(char *args, int from_tty)
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
char * hex_string(LONGEST num)
enum language main_language(void)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
static void show_debug_file_directory(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void reopen_exec_file(void)
const void * bcache(const void *addr, int length, struct bcache *cache)
static void symfile_free_objfile(struct objfile *objfile)
void addr_info_make_relative(struct section_addr_info *addrs, bfd *abfd)
void enable_overlay_breakpoints(void)
void objfile_set_sym_fns(struct objfile *objfile, const struct sym_fns *sf)
#define SECT_OFF_TEXT(objfile)
static void init_entry_point_info(struct objfile *objfile)
static void map_overlay_command(char *args, int from_tty)
struct psymbol_bcache * psymbol_bcache_init(void)
struct observer * observer_attach_free_objfile(observer_free_objfile_ftype *f)
#define COMPUNIT_DEBUGFORMAT(cust)
static int simple_read_overlay_table(void)
static void read_target_long_array(CORE_ADDR, unsigned int *, int, int, enum bfd_endian)
void(* deprecated_pre_add_symbol_hook)(const char *)
void(* expand_symtabs_matching)(struct objfile *objfile, expand_symtabs_file_matcher_ftype *file_matcher, expand_symtabs_symbol_matcher_ftype *symbol_matcher, expand_symtabs_exp_notify_ftype *expansion_notify, enum search_domain kind, void *data)
void psymbol_bcache_free(struct psymbol_bcache *bcache)
int gdb_bfd_section_index(bfd *abfd, asection *section)
void free_all_objfiles(void)
struct objfile * separate_debug_objfile_backlink
const char * section_name
int section_is_overlay(struct obj_section *section)
void no_shared_libraries(char *ignored, int from_tty)
struct objfile * symbol_file_add_from_bfd(bfd *abfd, const char *name, int add_flags, struct section_addr_info *addrs, int flags, struct objfile *parent)
static void load_command(char *, int)
void 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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct bfd_section * the_bfd_section
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void relative_addr_info_to_section_offsets(struct section_offsets *section_offsets, int num_sections, const struct section_addr_info *addrs)
void warning(const char *fmt,...)
CORE_ADDR * segment_bases
struct psymbol_allocation_list global_psymbols
#define obj_section_offset(s)
int query(const char *ctlstr,...)
int objfile_has_symbols(struct objfile *objfile)
struct program_space * pspace
void map_symbol_filenames(symbol_filename_ftype *fun, void *data, int need_fullname)
enum language set_language(enum language lang)
static const char * print_symbol_loading
struct compunit_symtab * allocate_compunit_symtab(struct objfile *objfile, const char *name)
struct symfile_segment_data *(* sym_segments)(bfd *abfd)
struct ui_file * gdb_stdout
int currently_reading_symtab
void clear_complaints(struct complaints **c, int less_verbose, int noisy)
void( expand_symtabs_exp_notify_ftype)(struct compunit_symtab *symtab, void *data)
void add_symtab_fns(enum bfd_flavour flavour, const struct sym_fns *sf)
#define obj_section_endaddr(s)
static CORE_ADDR cache_ovly_table_base
int target_write_memory_blocks(VEC(memory_write_request_s)*requests, enum flash_preserve_mode preserve_flash_p, void(*progress_cb)(ULONGEST, void *))
int ui_out_is_mi_like_p(struct ui_out *uiout)
static struct objfile * symbol_file_add_with_addrs(bfd *abfd, const char *name, int add_flags, struct section_addr_info *addrs, int flags, struct objfile *parent)
static void simple_free_overlay_table(void)
struct section_addr_info * build_section_addr_info_from_objfile(const struct objfile *objfile)
struct symfile_segment_data * default_symfile_segments(bfd *abfd)
#define ALL_OBJSECTIONS(objfile, osect)
void generic_load(const char *args, int from_tty)
void set_initial_language(void)
int gdbarch_long_bit(struct gdbarch *gdbarch)
void reread_symbols(void)
const struct block * innermost_block
int have_partial_symbols(void)
#define ALL_OBJFILE_OSECTIONS(objfile, osect)
#define VEC_safe_push(T, V, O)
void observer_notify_executable_changed(void)
struct cmd_list_element * cmdlist
char * debug_file_directory
char * skip_spaces(char *chp)
void varobj_invalidate(void)
static int sections_overlap(struct obj_section *a, struct obj_section *b)
struct bfd * gdb_bfd_open(const char *name, const char *target, int fd)
static void overlay_command(char *, int)
void regcache_write_pc(struct regcache *regcache, CORE_ADDR pc)
void free_section_addr_info(struct section_addr_info *sap)
static void symbol_file_add_main_1(const char *args, int from_tty, int flags)
void ui_out_field_fmt(struct ui_out *uiout, const char *fldname, const char *format,...)
struct objfile_per_bfd_storage * per_bfd
static unsigned(* cache_ovly_table)[4]
struct regcache * get_current_regcache(void)
struct symbol * template_symbols
void ui_out_text(struct ui_out *uiout, const char *string)
int is_addr_in_objfile(CORE_ADDR addr, const struct objfile *objfile)
int gdb_bfd_crc(struct bfd *abfd, unsigned long *crc_out)
void(* sym_read)(struct objfile *, int)
void printf_filtered(const char *format,...)
void set_objfile_per_bfd(struct objfile *objfile)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static void finish_new_objfile(struct objfile *objfile, int add_flags)
struct obj_section * find_pc_overlay(CORE_ADDR pc)
struct cmd_list_element * add_setshow_string_noescape_cmd(const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void symbol_file_command(char *args, int from_tty)
struct cleanup * all_cleanups(void)
#define obj_section_addr(s)
struct obstack objfile_obstack
mach_port_t kern_return_t mach_port_t msgports 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
void null_cleanup(void *arg)
static void add_symbol_file_command(char *, int)
#define SIZEOF_N_SECTION_OFFSETS(n)
int objfile_has_partial_symbols(struct objfile *objfile)
struct cmd_list_element * setlist
#define ALL_OBJFILES(obj)
bfd * find_separate_debug_file_in_section(struct objfile *objfile)
static void clear_memory_write_data(void *arg)
struct objfile * symbol_file_add(const char *name, int add_flags, struct section_addr_info *addrs, int flags)
#define VEC_iterate(T, V, I, P)
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
static void init_filename_language_table(void)
void breakpoint_re_set(void)
CORE_ADDR pc_in_mapped_range(CORE_ADDR pc, struct obj_section *section)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
static int separate_debug_file_exists(const char *name, unsigned long crc, struct objfile *parent_objfile)
#define OPF_TRY_CWD_FIRST
static const char * addr_section_name(const char *s)
void target_load(const char *arg, int from_tty)
#define DEBUG_SUBDIRECTORY
void free_objfile_separate_debug(struct objfile *objfile)
void free_objfile(struct objfile *objfile)
static int simple_overlay_update_1(struct obj_section *)
struct cleanup * make_cleanup_free_objfile(struct objfile *obj)
void clear_current_source_symtab_and_line(void)
struct target_ops current_target
void gdb_bfd_unref(struct bfd *abfd)
CORE_ADDR gdbarch_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
int get_section_index(struct objfile *objfile, char *section_name)
void symbol_file_add_separate(bfd *bfd, const char *name, int symfile_flags, struct objfile *objfile)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
int openp(const char *, int, const char *, int, char **)
static void decrement_reading_symtab(void *)
struct symfile_segment_data * get_symfile_segment_data(bfd *abfd)
void * xzalloc(size_t size)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
static void unmap_overlay_command(char *args, int from_tty)
void find_lowest_section(bfd *abfd, asection *sect, void *obj)
void(* deprecated_show_load_progress)(const char *section, unsigned long section_sent, unsigned long section_size, unsigned long total_sent, unsigned long total_size)
static void info_ext_lang_command(char *args, int from_tty)
void remove_target_sections(void *owner)
DEF_VEC_O(registered_sym_fns)
void _initialize_symfile(void)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
static const struct sym_fns * find_sym_fns(bfd *)
struct cmd_list_element * showlist
void preserve_values(struct objfile *objfile)
void ui_out_message(struct ui_out *uiout, int verbosity, const char *format,...)
struct cmd_list_element * add_com_alias(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
void add_separate_debug_objfile(struct objfile *objfile, struct objfile *parent)
void puts_filtered(const char *string)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
const struct sym_fns * sf
void build_objfile_section_table(struct objfile *objfile)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
int( expand_symtabs_symbol_matcher_ftype)(const char *name, void *data)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
#define ANOFFSET(secoff, whichone)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
struct obj_section * sections
static char * find_separate_debug_file(const char *dir, const char *canon_dir, const char *debuglink, unsigned long crc32, struct objfile *objfile)
const char * language_str(enum language lang)
void add_compunit_symtab_to_objfile(struct compunit_symtab *cu)
static void overlay_load_command(char *, int)
struct cleanup * make_cleanup_free_char_ptr_vec(VEC(char_ptr)*char_ptr_vec)
void(* sym_new_init)(struct objfile *)
struct objfile * objfilep
CORE_ADDR symbol_overlayed_address(CORE_ADDR address, struct obj_section *section)
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
struct objfile * separate_debug_objfile
struct gdbarch * get_current_arch(void)
char * find_separate_debug_file_by_debuglink(struct objfile *objfile)
int overlay_cache_invalid
void(* expand_all_symtabs)(struct objfile *objfile)
struct compunit_symtab * compunit_symtabs
void expand_symtabs_matching(expand_symtabs_file_matcher_ftype *file_matcher, expand_symtabs_symbol_matcher_ftype *symbol_matcher, expand_symtabs_exp_notify_ftype *expansion_notify, enum search_domain kind, void *data)
struct load_progress_data * cumulative
enum bfd_flavour sym_flavour
static void new_objfile(struct objfile *objfile)
void simple_overlay_update(struct obj_section *osect)
int gdbarch_overlay_update_p(struct gdbarch *gdbarch)
struct compunit_symtab * next
static void terminate_after_last_dir_separator(char *path)
ULONGEST strtoulst(const char *num, const char **trailer, int base)
struct cmd_list_element * setprintlist
void wrap_here(char *indent)
void(* sym_offsets)(struct objfile *, const struct section_addr_info *)
void printf_unfiltered(const char *format,...)
int section_is_mapped(struct obj_section *osect)
int(* deprecated_ui_load_progress_hook)(const char *section, unsigned long num)
void(* sym_finish)(struct objfile *)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct bfd_section * the_bfd_section
void clear_displays(void)
const char * objfile_name(const struct objfile *objfile)
static void add_section_size_callback(bfd *abfd, asection *asec, void *data)
struct cleanup * make_cleanup_bfd_unref(bfd *abfd)
struct ui_file * gdb_stdlog
bfd * symfile_bfd_open(const char *name)
static void overlay_manual_command(char *, int)
static void list_overlays_command(char *args, int from_tty)
struct symtab * last_filetab
void symbol_file_add_main(const char *args, int from_tty)
void exec_set_section_address(const char *filename, int index, CORE_ADDR address)
struct bcache * filename_cache
void(* deprecated_post_add_symbol_hook)(void)
void clear_pc_function_cache(void)
PTR xrealloc(PTR ptr, size_t size)
static filename_language * filename_language_table
static int validate_download
unsigned int minsyms_read
void clear_symtab_users(int add_flags)
#define OBJF_PSYMTABS_READ
const char const char int
void exec_file_attach(const char *filename, int from_tty)
static void clear_symtab_users_cleanup(void *ignore)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
void discard_cleanups(struct cleanup *old_chain)
const struct language_defn * current_language
struct obj_section * find_pc_mapped_section(CORE_ADDR pc)
static void load_section_callback(bfd *abfd, asection *asec, void *data)
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
CORE_ADDR overlay_unmapped_address(CORE_ADDR pc, struct obj_section *section)
const struct sym_fns * sym_fns
static VEC(registered_sym_fns)
int( expand_symtabs_file_matcher_ftype)(const char *filename, void *data, int basenames)
static void check(BOOL ok, const char *file, int line)
enum language deduce_language_from_filename(const char *filename)
static void syms_from_objfile_1(struct objfile *objfile, struct section_addr_info *addrs, int add_flags)
CORE_ADDR parse_and_eval_address(const char *exp)
int check_quit_flag(void)
static struct other_sections ** addrs_section_sort(struct section_addr_info *addrs)
static struct section_addr_info * build_section_addr_info_from_bfd(bfd *abfd)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct complaints * symfile_complaints
struct minimal_symbol * minsym
int gdb_bfd_count_sections(bfd *abfd)
static void read_symbols(struct objfile *objfile, int add_flags)
const char * host_address_to_string(const void *addr)
static void show_ext_args(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
const struct language_defn * expected_language
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
void observer_notify_new_objfile(struct objfile *objfile)
struct symtab * allocate_symtab(struct compunit_symtab *cust, const char *filename)
#define OPF_RETURN_REALPATH
int print_symbol_loading_p(int from_tty, int exec, int full)
static void load_progress(ULONGEST bytes, void *untyped_arg)
#define SYMBOL_LANGUAGE(symbol)
struct section_addr_info * build_section_addr_info_from_section_table(const struct target_section *start, const struct target_section *end)
char ** gdb_buildargv(const char *s)
void default_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
struct compunit_symtab * compunit_symtab
struct partial_symtab * free_psymtabs
int the_bfd_section_index
static void symfile_find_segment_sections(struct objfile *objfile)
int have_full_symbols(void)
struct objfile * allocate_objfile(bfd *abfd, const char *name, int flags)
unsigned long write_count
struct cmd_list_element * showprintlist
void disable_overlay_breakpoints(void)
struct other_sections other[1]
static void syms_from_objfile(struct objfile *objfile, struct section_addr_info *addrs, int add_flags)
struct partial_symbol ** list
struct inferior * current_inferior(void)
const struct block * expression_context_block
enum overlay_debugging_state overlay_debugging
struct program_space * current_program_space
unsigned int symtab_create_debug
char * get_exec_file(int err)
unsigned long long ULONGEST
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
struct cleanup * increment_reading_symtab(void)
struct addrmap * psymtabs_addrmap
static void symfile_dummy_outputs(bfd *abfd, asection *sectp, void *dummy)
static void overlay_invalidate_all(void)
void print_transfer_performance(struct ui_file *stream, unsigned long data_count, unsigned long write_count, const struct timeval *start_time, const struct timeval *end_time)
static void overlay_off_command(char *, int)
static int addrs_section_compar(const void *ap, const void *bp)
CORE_ADDR overlay_mapped_address(CORE_ADDR pc, struct obj_section *section)
void add_target_sections_of_objfile(struct objfile *objfile)
void free_symfile_segment_data(struct symfile_segment_data *data)
#define OBSTACK_ZALLOC(OBSTACK, TYPE)
static void init_objfile_sect_indices(struct objfile *objfile)
void reinit_frame_cache(void)
struct section_offsets * section_offsets
void gdb_flush(struct ui_file *file)
struct cleanup * make_cleanup_free_section_addr_info(struct section_addr_info *addrs)
void terminate_minimal_symbol_table(struct objfile *objfile)
struct ui_out * current_uiout
void(* sym_init)(struct objfile *)
const struct quick_symbol_functions * qf
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
PTR xcalloc(size_t number, size_t size)
CORE_ADDR * segment_sizes
CORE_ADDR pc_in_unmapped_range(CORE_ADDR pc, struct obj_section *section)
enum bfd_endian byte_order
int is_target_filename(const char *name)
static void set_ext_lang_command(char *args, int from_tty, struct cmd_list_element *e)
struct psymbol_bcache * psymbol_cache
static struct cmd_list_element * overlaylist
bfd_byte *(* sym_relocate)(struct objfile *, asection *sectp, bfd_byte *buf)
void error(const char *fmt,...)
void gdbarch_overlay_update(struct gdbarch *gdbarch, struct obj_section *osect)
int symfile_map_offsets_to_segments(bfd *abfd, const struct symfile_segment_data *data, struct section_offsets *offsets, int num_segment_bases, const CORE_ADDR *segment_bases)
struct objfile * require_partial_symbols(struct objfile *objfile, int verbose)
struct load_progress_data * progress_data
void add_setshow_optional_filename_cmd(const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void( symbol_filename_ftype)(const char *filename, const char *fullname, void *data)
void do_cleanups(struct cleanup *old_chain)
struct section_offsets * offsets
static void overlay_auto_command(char *, int)
struct partial_symtab * psymtabs
struct section_addr_info * alloc_section_addr_info(size_t num_sections)
static unsigned cache_novlys
static void add_filename_language(char *ext, enum language lang)
int gdb_bfd_has_target_filename(struct bfd *abfd)
void clear_last_displayed_sal(void)
void symbol_file_clear(int from_tty)
const ULONGEST const LONGEST len
void(* map_symbol_filenames)(struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname)