projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdb/
[deliverable/binutils-gdb.git]
/
gdb
/
symfile.c
diff --git
a/gdb/symfile.c
b/gdb/symfile.c
index c182faac5d1654a0c99b624de9b16e63bfde0089..75cb0f8e999b6b1c38c263dd4cbbbf52db305a49 100644
(file)
--- a/
gdb/symfile.c
+++ b/
gdb/symfile.c
@@
-171,13
+171,6
@@
Dynamic symbol table reloading multiple times in one run is %s.\n"),
value);
}
value);
}
-/* If non-zero, gdb will notify the user when it is loading symbols
- from a file. This is almost always what users will want to have happen;
- but for programs with lots of dynamically linked libraries, the output
- can be more noise than signal. */
-
-int print_symbol_loading = 1;
-
/* If non-zero, shared library symbols will be added automatically
when the inferior is created, new libraries are loaded, or when
attaching to the inferior. This is almost always what users will
/* If non-zero, shared library symbols will be added automatically
when the inferior is created, new libraries are loaded, or when
attaching to the inferior. This is almost always what users will
@@
-793,7
+786,7
@@
syms_from_objfile (struct objfile *objfile,
if (symfile_objfile != NULL)
{
free_objfile (symfile_objfile);
if (symfile_objfile != NULL)
{
free_objfile (symfile_objfile);
-
symfile_objfile = NULL
;
+
gdb_assert (symfile_objfile == NULL)
;
}
/* Currently we keep symbols from the add-symbol-file command.
}
/* Currently we keep symbols from the add-symbol-file command.
@@
-989,12
+982,9
@@
symbol_file_add_with_addrs_or_offsets (bfd *abfd,
deprecated_pre_add_symbol_hook (name);
else
{
deprecated_pre_add_symbol_hook (name);
else
{
- if (print_symbol_loading)
- {
- printf_unfiltered (_("Reading symbols from %s..."), name);
- wrap_here ("");
- gdb_flush (gdb_stdout);
- }
+ printf_unfiltered (_("Reading symbols from %s..."), name);
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
}
}
syms_from_objfile (objfile, addrs, offsets, num_offsets,
}
}
syms_from_objfile (objfile, addrs, offsets, num_offsets,
@@
-1007,7
+997,7
@@
symbol_file_add_with_addrs_or_offsets (bfd *abfd,
if ((flags & OBJF_READNOW) || readnow_symbol_files)
{
if ((flags & OBJF_READNOW) || readnow_symbol_files)
{
- if (
(from_tty || info_verbose) && print_symbol_loading
)
+ if (
from_tty || info_verbose
)
{
printf_unfiltered (_("expanding to full symbols..."));
wrap_here ("");
{
printf_unfiltered (_("expanding to full symbols..."));
wrap_here ("");
@@
-1049,15
+1039,11
@@
symbol_file_add_with_addrs_or_offsets (bfd *abfd,
xfree (debugfile);
}
xfree (debugfile);
}
- if (
!have_partial_symbols () && !have_full_symbols (
)
- &&
print_symbol_loading
)
+ if (
(from_tty || info_verbose
)
+ &&
!objfile_has_symbols (objfile)
)
{
wrap_here ("");
{
wrap_here ("");
- printf_unfiltered (_("(no debugging symbols found)"));
- if (from_tty || info_verbose)
- printf_unfiltered ("...");
- else
- printf_unfiltered ("\n");
+ printf_unfiltered (_("(no debugging symbols found)..."));
wrap_here ("");
}
wrap_here ("");
}
@@
-1066,10
+1052,7
@@
symbol_file_add_with_addrs_or_offsets (bfd *abfd,
if (deprecated_post_add_symbol_hook)
deprecated_post_add_symbol_hook ();
else
if (deprecated_post_add_symbol_hook)
deprecated_post_add_symbol_hook ();
else
- {
- if (print_symbol_loading)
- printf_unfiltered (_("done.\n"));
- }
+ printf_unfiltered (_("done.\n"));
}
/* We print some messages regardless of whether 'from_tty ||
}
/* We print some messages regardless of whether 'from_tty ||
@@
-1166,7
+1149,7
@@
symbol_file_clear (int from_tty)
descriptors as well. */
no_shared_libraries (NULL, from_tty);
descriptors as well. */
no_shared_libraries (NULL, from_tty);
-
symfile_objfile = NULL
;
+
gdb_assert (symfile_objfile == NULL)
;
if (from_tty)
printf_unfiltered (_("No symbol file now.\n"));
}
if (from_tty)
printf_unfiltered (_("No symbol file now.\n"));
}
@@
-1300,7
+1283,8
@@
get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out)
}
static int
}
static int
-separate_debug_file_exists (const char *name, unsigned long crc)
+separate_debug_file_exists (const char *name, unsigned long crc,
+ const char *parent_name)
{
unsigned long file_crc = 0;
bfd *abfd;
{
unsigned long file_crc = 0;
bfd *abfd;
@@
-1320,7
+1304,15
@@
separate_debug_file_exists (const char *name, unsigned long crc)
bfd_close (abfd);
bfd_close (abfd);
- return crc == file_crc;
+ if (crc != file_crc)
+ {
+ warning (_("the debug information found in \"%s\""
+ " does not match \"%s\" (CRC mismatch).\n"),
+ name, parent_name);
+ return 0;
+ }
+
+ return 1;
}
char *debug_file_directory = NULL;
}
char *debug_file_directory = NULL;
@@
-1372,6
+1364,8
@@
find_separate_debug_file (struct objfile *objfile)
basename = get_debug_link_info (objfile, &crc32);
if (basename == NULL)
basename = get_debug_link_info (objfile, &crc32);
if (basename == NULL)
+ /* There's no separate debug info, hence there's no way we could
+ load it => no warning. */
return NULL;
dir = xstrdup (objfile->name);
return NULL;
dir = xstrdup (objfile->name);
@@
-1405,7
+1399,7
@@
find_separate_debug_file (struct objfile *objfile)
strcpy (debugfile, dir);
strcat (debugfile, basename);
strcpy (debugfile, dir);
strcat (debugfile, basename);
- if (separate_debug_file_exists (debugfile, crc32))
+ if (separate_debug_file_exists (debugfile, crc32
, objfile->name
))
{
xfree (basename);
xfree (dir);
{
xfree (basename);
xfree (dir);
@@
-1419,7
+1413,7
@@
find_separate_debug_file (struct objfile *objfile)
strcat (debugfile, "/");
strcat (debugfile, basename);
strcat (debugfile, "/");
strcat (debugfile, basename);
- if (separate_debug_file_exists (debugfile, crc32))
+ if (separate_debug_file_exists (debugfile, crc32
, objfile->name
))
{
xfree (basename);
xfree (dir);
{
xfree (basename);
xfree (dir);
@@
-1433,7
+1427,7
@@
find_separate_debug_file (struct objfile *objfile)
strcat (debugfile, dir);
strcat (debugfile, basename);
strcat (debugfile, dir);
strcat (debugfile, basename);
- if (separate_debug_file_exists (debugfile, crc32))
+ if (separate_debug_file_exists (debugfile, crc32
, objfile->name
))
{
xfree (basename);
xfree (dir);
{
xfree (basename);
xfree (dir);
@@
-1452,12
+1446,11
@@
find_separate_debug_file (struct objfile *objfile)
strcat (debugfile, "/");
strcat (debugfile, basename);
strcat (debugfile, "/");
strcat (debugfile, basename);
- if (separate_debug_file_exists (debugfile, crc32))
+ if (separate_debug_file_exists (debugfile, crc32
, objfile->name
))
{
xfree (canon_name);
xfree (basename);
xfree (dir);
{
xfree (canon_name);
xfree (basename);
xfree (dir);
- xfree (canon_name);
return xstrdup (debugfile);
}
}
return xstrdup (debugfile);
}
}
@@
-2334,6
+2327,8
@@
reread_symbols (void)
objfile->obfd = bfd_openr (obfd_filename, gnutarget);
if (objfile->obfd == NULL)
error (_("Can't open %s to read symbols."), objfile->name);
objfile->obfd = bfd_openr (obfd_filename, gnutarget);
if (objfile->obfd == NULL)
error (_("Can't open %s to read symbols."), objfile->name);
+ else
+ objfile->obfd = gdb_bfd_ref (objfile->obfd);
/* bfd_openr sets cacheable to true, which is what we want. */
if (!bfd_check_format (objfile->obfd, bfd_object))
error (_("Can't read symbols from %s: %s."), objfile->name,
/* bfd_openr sets cacheable to true, which is what we want. */
if (!bfd_check_format (objfile->obfd, bfd_object))
error (_("Can't read symbols from %s: %s."), objfile->name,
@@
-2437,7
+2432,7
@@
reread_symbols (void)
zero is OK since dbxread.c also does what it needs to do if
objfile->global_psymbols.size is 0. */
(*objfile->sf->sym_read) (objfile, 0);
zero is OK since dbxread.c also does what it needs to do if
objfile->global_psymbols.size is 0. */
(*objfile->sf->sym_read) (objfile, 0);
- if (!
have_partial_symbols () && !have_full_symbols (
))
+ if (!
objfile_has_symbols (objfile
))
{
wrap_here ("");
printf_unfiltered (_("(no debugging symbols found)\n"));
{
wrap_here ("");
printf_unfiltered (_("(no debugging symbols found)\n"));
@@
-2468,13
+2463,13
@@
reread_symbols (void)
if (reread_one)
{
if (reread_one)
{
+ /* Notify objfiles that we've modified objfile sections. */
+ objfiles_changed ();
+
clear_symtab_users ();
/* At least one objfile has changed, so we can consider that
the executable we're debugging has changed too. */
observer_notify_executable_changed ();
clear_symtab_users ();
/* At least one objfile has changed, so we can consider that
the executable we're debugging has changed too. */
observer_notify_executable_changed ();
-
- /* Notify objfiles that we've modified objfile sections. */
- objfiles_changed ();
}
}
}
}
@@
-2823,7
+2818,7
@@
clear_symtab_users (void)
clear_displays ();
breakpoint_re_set ();
clear_displays ();
breakpoint_re_set ();
- set_default_breakpoint (0, 0, 0, 0);
+ set_default_breakpoint (0,
NULL,
0, 0, 0);
clear_pc_function_cache ();
observer_notify_new_objfile (NULL);
clear_pc_function_cache ();
observer_notify_new_objfile (NULL);
@@
-4206,12
+4201,4
@@
the global debug-file directory prepended."),
NULL,
show_debug_file_directory,
&setlist, &showlist);
NULL,
show_debug_file_directory,
&setlist, &showlist);
-
- add_setshow_boolean_cmd ("symbol-loading", no_class,
- &print_symbol_loading, _("\
-Set printing of symbol loading messages."), _("\
-Show printing of symbol loading messages."), NULL,
- NULL,
- NULL,
- &setprintlist, &showprintlist);
}
}
This page took
0.026575 seconds
and
4
git commands to generate.