aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2015-09-18 21:43:38 -0700
committerDoug Evans <xdje42@gmail.com>2015-09-18 21:43:38 -0700
commit015d2e7e49056e0d5fea1c18bf8de9b1be7c096f (patch)
tree5e18796c5f9b2e007b0f0a5449f1fae6a1357625 /gdb/findvar.c
parentd96c806b9210f2a9dc07f9ebfc811b3fc0c0f870 (diff)
downloadgdb-015d2e7e49056e0d5fea1c18bf8de9b1be7c096f.zip
gdb-015d2e7e49056e0d5fea1c18bf8de9b1be7c096f.tar.gz
gdb-015d2e7e49056e0d5fea1c18bf8de9b1be7c096f.tar.bz2
default_read_var_value <LOC_UNRESOLVED>: Include minsym kind in error message.
bfd/ChangeLog: * targets.c (enum bfd_flavour): Add comment. (bfd_flavour_name): New function. * bfd-in2.h: Regenerate. gdb/ChangeLog: * findvar.c (default_read_var_value) <LOC_UNRESOLVED>: Include the kind of minimal symbol in the error message. * objfiles.c (objfile_flavour_name): New function. * objfiles.h (objfile_flavour_name): Declare. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-bad-unresolved.c: New file. * gdb.dwarf2/dw2-bad-unresolved.exp: New file.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index fd1b9d7..11325cf 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -737,8 +737,20 @@ default_read_var_value (struct symbol *var, const struct block *var_block,
symbol_objfile (var));
msym = lookup_data.result.minsym;
+ /* If we can't find the minsym there's a problem in the symbol info.
+ The symbol exists in the debug info, but it's missing in the minsym
+ table. */
if (msym == NULL)
- error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var));
+ {
+ const char *flavour_name
+ = objfile_flavour_name (symbol_objfile (var));
+
+ /* We can't get here unless we've opened the file, so flavour_name
+ can't be NULL. */
+ gdb_assert (flavour_name != NULL);
+ error (_("Missing %s symbol \"%s\"."),
+ flavour_name, SYMBOL_LINKAGE_NAME (var));
+ }
obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
/* Relocate address, unless there is no section or the variable is
a TLS variable. */