[patch] Fix gdb.fortran/common-block.exp crash in PIE mode

Tom Tromey tromey@redhat.com
Mon Jan 21 16:13:00 GMT 2013


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> as it thinks it can update it like SYMBOL_VALUE_ADDRESS
Jan> 	CORE_ADDR address;
Jan> due to its LOC_STATIC.

Jan> 	Fix gdb.fortran/common-block.exp crash in PIE mode.
Jan> 	* dwarf2read.c (new_symbol_full) <DW_TAG_common_block>: Use
Jan> 	LOC_COMMON_BLOCK.
Jan> 	* f-valprint.c (info_common_command_for_block): Expect
Jan> 	LOC_COMMON_BLOCK in gdb_assert.
Jan> 	* symtab.h (struct general_symbol_info): Update comment for the
Jan> 	common_block member.
Jan> 	(domain_enum): Extend comment for the COMMON_BLOCK_DOMAIN member.
Jan> 	(enum address_class): New member LOC_COMMON_BLOCK.

Looks good to me.

Perhaps the various symbol-value accessors like SYMBOL_VALUE_ADDRESS
should make assertions about the address class.  This is what GCC does
in its tree accessors.

Like

#define SYMBOL_VALUE_COMMON_BLOCK(symbol) \
  ((gdb_assert (SYMBOL_CLASS (symbol) == LOC_COMMON_BLOCK)), \
   (symbol)->info.value.common_block)

Tom



More information about the Gdb-patches mailing list