aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2012-09-11 21:26:16 +0000
committerJoel Brobecker <brobecker@gnat.com>2012-09-11 21:26:16 +0000
commitd9eaeb59a428f57acfe2877e3d21df5fac59fbe3 (patch)
treea7f661b937237d77fe2f15225c182eb5a0bc7de0 /gdb/elfread.c
parenta83e9154c2f2a7c2c3a399c25c3931560a990d40 (diff)
downloadgdb-d9eaeb59a428f57acfe2877e3d21df5fac59fbe3.zip
gdb-d9eaeb59a428f57acfe2877e3d21df5fac59fbe3.tar.gz
gdb-d9eaeb59a428f57acfe2877e3d21df5fac59fbe3.tar.bz2
Name of symbol missing when printing global variable's address
The build_address_symbolic funnction filters out data symbols if their size is set to zero. But the problem is that the COFF symbol table (for instance) does not provide any size information, leaving the size to its default value of zero, thus always triggering the filter. This shows up when trying to print the address of a global variable when debugging a Windows executable, for instance. gdb/ChangeLog: * symtab.h (struct minimal_symbol) [has_size]: New field. (MSYMBOL_SIZE): Adjust to forbid macro from being used as lvalue. (SET_MSYMBOL_SIZE, MSYMBOL_HAS_SIZE): New macros. * printcmd.c (build_address_symbolic): Only filter out zero-sized minimal symbols if the symbol's size is actually known. * minsyms.c (prim_record_minimal_symbol_full): Adjust setting of msymbol's size field. Add comment. * elfread.c (elf_symtab_read, elf_rel_plt_read): Use SET_MSYMBOL_SIZE to set the minimal symbol size.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index f3967d7..516cbd0 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -570,7 +570,7 @@ elf_symtab_read (struct objfile *objfile, int type,
elf_sym = (elf_symbol_type *) sym->udata.p;
if (elf_sym)
- MSYMBOL_SIZE(msym) = elf_sym->internal_elf_sym.st_size;
+ SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
msym->filename = filesymname;
gdbarch_elf_make_msymbol_special (gdbarch, sym, msym);
@@ -594,7 +594,7 @@ elf_symtab_read (struct objfile *objfile, int type,
sym->section, objfile);
if (mtramp)
{
- MSYMBOL_SIZE (mtramp) = MSYMBOL_SIZE (msym);
+ SET_MSYMBOL_SIZE (mtramp, MSYMBOL_SIZE (msym));
mtramp->created_by_gdb = 1;
mtramp->filename = filesymname;
gdbarch_elf_make_msymbol_special (gdbarch, sym, mtramp);
@@ -689,7 +689,7 @@ elf_rel_plt_read (struct objfile *objfile, asymbol **dyn_symbol_table)
1, address, mst_slot_got_plt, got_plt,
objfile);
if (msym)
- MSYMBOL_SIZE (msym) = ptr_size;
+ SET_MSYMBOL_SIZE (msym, ptr_size);
}
do_cleanups (back_to);