Re: RFC: printing pointers to global (data) variable on Windows...

Tom Tromey
2012-09-10T19:08:31Z

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> * symtab.h (struct minimal_symbol) [has_size]: New field.
Joel> (MSYMBOL_SIZE): Adjust to forbid macro from being used as lvalue.
Joel> (SET_MSYMBOL_SIZE, MSYMBOL_HAS_SIZE): New macros.
Joel> * printcmd.c (build_address_symbolic): Only filter out zero-sized
Joel> minimal symbols if the symbol's size is actually known.
Joel> * minsyms.c (prim_record_minimal_symbol_full): Adjust setting
Joel> of msymbol's size field. Add comment.
Joel> (install_minimal_symbols): Use SET_MSYMBOL_SIZE to set the
Joel> minimal symbol size.
Joel> * elfread.c (elf_symtab_read, elf_rel_plt_read): Use
Joel> SET_MSYMBOL_SIZE to set the minimal symbol size.

Joel> OK to commit?

Joel> @@ -1233,7 +1235,7 @@ install_minimal_symbols (struct objfile *objfile)
Joel> SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;
Joel> MSYMBOL_TARGET_FLAG_1 (&msymbols[mcount]) = 0;
Joel> MSYMBOL_TARGET_FLAG_2 (&msymbols[mcount]) = 0;
Joel> - MSYMBOL_SIZE (&msymbols[mcount]) = 0;
Joel> + SET_MSYMBOL_SIZE (&msymbols[mcount], 0);

I tend to think this hunk should not use SET_MSYMBOL_SIZE.
Maybe it even ought to use memset instead of what it currently does.

Or, if SET_MSYMBOL_SIZE is correct here, a comment would be helpful.

The rest looked good to me.

Tom